add_model {modelgrid}R Documentation

Add a model specification to a model grid

Description

Define and add an individual model (and model training) specification to an existing model grid.

Usage

add_model(model_grid, model_name = NULL, custom_control = NULL, ...)

Arguments

model_grid

model_grid

model_name

character, your custom name for a given model. Must be unique within the model grid. If you do not provide a name, the model will be given a generic name - 'Model[int]'.

custom_control

list, any customization to subsettings of the 'trControl' component from the 'shared_settings' of the model grid (will only work if trControl' parameter has actually been set as part of the shared settings).

...

All (optional) individual settings (including model training settings) that the user wishes to set for the new model.

Value

model_grid with an additional individual model specification.

Examples

library(magrittr)

# Pre-allocate empty model grid.
mg <- model_grid()

# Add 'random forest' model spec.
mg <-
  mg %>%
  add_model(model_name = "Random Forest Test", method = "rf", tuneLength = 5)

[Package modelgrid version 1.2.0 Index]