add_model: Add a model specification to a model grid

Description Usage Arguments Value Examples

Description

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

Usage

1
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

1
2
3
4
5
6
7
8
9
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)

modelgrid documentation built on May 2, 2019, 8:32 a.m.