These methods extend the generic dials::parameters() to work with more complex objects, such as recipes, model specifications, and workflows.

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

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

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

Arguments

x

An object

...

Not currently used.

Value

A parameter set object

Examples

# \donttest{ library(tibble) library(recipes) recipe(mpg ~ ., data = mtcars) %>% step_impute_knn(all_predictors(), neighbors = tune()) %>% step_pca(all_predictors(), num_comp = tune()) %>% dials::parameters()
#> Collection of 2 parameters for tuning #> #> identifier type object #> neighbors neighbors nparam[+] #> num_comp num_comp nparam[+] #>
# A peak under the hood tibble::as_tibble(.Last.value)
#> Error: All columns in a tibble must be vectors. #> Column `repos` is NULL. #> Column `crayon.enabled` is NULL. #> Column `Ncpus` is NULL.
recipe(mpg ~ ., data = mtcars) %>% step_ns(disp, deg_free = tune("disp df")) %>% step_ns(wt, deg_free = tune("wt df")) %>% dials::parameters()
#> Collection of 2 parameters for tuning #> #> identifier type object #> disp df deg_free nparam[+] #> wt df deg_free nparam[+] #>
recipe(mpg ~ ., data = mtcars) %>% step_normalize(all_predictors()) %>% dials::parameters()
#> Collection of 0 parameters for tuning #> #> [1] identifier type object #> <0 rows> (or 0-length row.names) #>
library(parsnip) boost_tree(trees = tune(), min_n = tune()) %>% set_engine("xgboost") %>% dials::parameters()
#> Collection of 2 parameters for tuning #> #> identifier type object #> trees trees nparam[+] #> min_n min_n nparam[+] #>
boost_tree(trees = tune(), min_n = tune()) %>% set_engine("C5.0", rules = TRUE) %>% dials::parameters()
#> Collection of 2 parameters for tuning #> #> identifier type object #> trees trees nparam[+] #> min_n min_n nparam[+] #>
# }