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

tunable(x, ...)

no_param

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Arguments

x

An object, such as a recipe, recipe step, or parsnip model specification.

...

Not currently used.

Format

An object of class tbl_df (inherits from tbl, data.frame) with 0 rows and 5 columns.

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" or recipes or "boost_tree" for models). The component_id column contains the unique step id field or, for models, a logical for whether the model specification argument was a main parameter or one associated with the engine.

Details

For a model specification, an engine must be chosen.

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). For model specifications, If the parameter is unknown to the underlying tunable method, a NULL is returned.

Examples

# \donttest{ library(recipes) recipe(mpg ~ ., data = mtcars) %>% step_knnimpute(all_predictors()) %>% step_pca(all_predictors()) %>% tunable()
#> # A tibble: 2 x 5 #> name call_info source component component_id #> <chr> <list> <chr> <chr> <chr> #> 1 neighbors <named list [3]> recipe step_knnimpute knnimpute_J8Cfd #> 2 num_comp <named list [3]> recipe step_pca pca_4Psoc
recipe(mpg ~ ., data = mtcars) %>% step_normalize(all_predictors()) %>% tunable()
#> # A tibble: 0 x 5 #> # … with 5 variables: name <chr>, call_info <list>, source <chr>, #> # component <chr>, component_id <chr>
library(parsnip) boost_tree() %>% set_engine("xgboost") %>% tunable()
#> # A tibble: 8 x 5 #> name call_info source component component_id #> <chr> <list> <chr> <chr> <chr> #> 1 tree_depth <named list [2]> model_spec boost_tree main #> 2 trees <named list [2]> model_spec boost_tree main #> 3 learn_rate <named list [2]> model_spec boost_tree main #> 4 mtry <named list [2]> model_spec boost_tree main #> 5 min_n <named list [2]> model_spec boost_tree main #> 6 loss_reduction <named list [2]> model_spec boost_tree main #> 7 sample_size <named list [2]> model_spec boost_tree main #> 8 stop_iter <named list [2]> model_spec boost_tree main
boost_tree() %>% set_engine("C5.0", rules = TRUE) %>% tunable()
#> # A tibble: 4 x 5 #> name call_info source component component_id #> <chr> <list> <chr> <chr> <chr> #> 1 trees <named list [3]> model_spec boost_tree main #> 2 min_n <named list [2]> model_spec boost_tree main #> 3 sample_size <named list [2]> model_spec boost_tree main #> 4 rules <NULL> model_spec boost_tree engine
# }