Learn R Programming

recipes (version 0.1.16)

tunable.recipe: Find recommended methods for generating parameter values

Description

tunable() determines which parameters in an object can be tuned along with information about the parameters.

Usage

# S3 method for recipe
tunable(x, ...)

# S3 method for step tunable(x, ...)

# S3 method for check tunable(x, ...)

Arguments

x

A recipe, recipe step, or recipe check object

...

Not currently used.

Value

A tibble with a column for the parameter name, information on the default method for generating a corresponding parameter object, the source of the parameter (e.g. "recipe", etc.), and the component within the source. For the component column, a little more specificity is given about the location of the parameter (e.g. "step_normalize" for recipes). The component_id column contains the unique step id field.

Details

These functions define what parameters can be tuned for specific steps. They also define the recommended objects from the dials package that can be used to generate new parameter values and other characteristics.

If the object has no tunable parameters, a tibble with no rows is returned.

The information about the default parameter object takes the form of a named list with an element for the function call and an optional element for the source of the function (e.g. the dials package).

Examples

Run this code
# NOT RUN {
library(recipes)

recipe(mpg ~ ., data = mtcars) %>%
  step_knnimpute(all_predictors()) %>%
  step_pca(all_numeric_predictors()) %>%
  tunable()

recipe(mpg ~ ., data = mtcars) %>%
  step_normalize(all_numeric_predictors()) %>%
  tunable()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab