View source: R/TrainedInputs.R
TunedInput | R Documentation |
Recipe tuning over a grid of parameter values.
TunedInput(object, ...)
## S3 method for class 'recipe'
TunedInput(
object,
grid = expand_steps(),
control = MachineShop::settings("control"),
metrics = NULL,
cutoff = MachineShop::settings("cutoff"),
stat = MachineShop::settings("stat.TrainingParams"),
...
)
object |
untrained |
... |
arguments passed to other methods. |
grid |
|
control |
control function, function name, or object defining the resampling method to be employed. |
metrics |
metric function, function name, or vector of these with which to calculate performance. If not specified, default metrics defined in the performance functions are used. Recipe selection is based on the first calculated metric. |
cutoff |
argument passed to the |
stat |
function or character string naming a function to compute a summary statistic on resampled metric values for recipe tuning. |
TunedModelRecipe
class object that inherits from
TunedInput
and recipe
.
fit
, resample
, set_optim
library(recipes)
data(Boston, package = "MASS")
rec <- recipe(medv ~ ., data = Boston) %>%
step_pca(all_numeric_predictors(), id = "pca")
grid <- expand_steps(
pca = list(num_comp = 1:2)
)
fit(TunedInput(rec, grid = grid), model = GLMModel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.