TunedInput: Tuned Model Inputs

Description Usage Arguments Value See Also Examples

View source: R/TrainedInputs.R

Description

Recipe tuning over a grid of parameter values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
TunedInput(x, ...)

## S3 method for class 'recipe'
TunedInput(
  x,
  grid = expand_steps(),
  control = MachineShop::settings("control"),
  metrics = NULL,
  stat = MachineShop::settings("stat.Trained"),
  cutoff = MachineShop::settings("cutoff"),
  ...
)

Arguments

x

untrained recipe.

...

arguments passed to other methods.

grid

RecipeGrid containing parameter values at which to evaluate a recipe, such as those returned by expand_steps.

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.

stat

function or character string naming a function to compute a summary statistic on resampled metric values for recipe tuning.

cutoff

argument passed to the metrics functions.

Value

TunedModelRecipe class object that inherits from TunedInput and recipe.

See Also

fit, resample

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(recipes)
data(Boston, package = "MASS")

rec <- recipe(medv ~ ., data = Boston) %>%
  step_pca(all_numeric(), -all_outcomes(), id = "pca")

grid <- expand_steps(
  pca = list(num_comp = 1:2)
)

fit(TunedInput(rec, grid = grid), model = GLMModel)

MachineShop documentation built on Aug. 20, 2021, 1:10 a.m.