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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

# S3 method for step_window
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

# \donttest{
library(recipes)

recipe(mpg ~ ., data = mtcars) %>%
  step_knnimpute(all_predictors()) %>%
  step_pca(all_numeric_predictors()) %>%
  tunable()
#> Warning: `step_knnimpute()` was deprecated in recipes 0.1.16.
#> Please use `step_impute_knn()` instead.
#> This warning is displayed once every 8 hours.
#> Call `lifecycle::last_lifecycle_warnings()` to see where this warning was generated.
#> # A tibble: 3 × 5
#>   name      call_info        source component       component_id    
#>   <chr>     <list>           <chr>  <chr>           <chr>           
#> 1 neighbors <named list [3]> recipe step_impute_knn impute_knn_hw1Dj
#> 2 num_comp  <named list [3]> recipe step_pca        pca_nADLd       
#> 3 threshold <named list [2]> recipe step_pca        pca_nADLd       

recipe(mpg ~ ., data = mtcars) %>%
  step_normalize(all_numeric_predictors()) %>%
  tunable()
#> # A tibble: 0 × 5
#> # … with 5 variables: name <chr>, call_info <list>, source <chr>,
#> #   component <chr>, component_id <chr>
# }