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_knnimpute(all_predictors(), neighbors = tune()) %>% step_pca(all_predictors(), num_comp = tune()) %>% dials::parameters()
#> Collection of 2 parameters for tuning #> #> id parameter type object class #> neighbors neighbors nparam[+] #> num_comp num_comp nparam[+] #>
# A peak under the hood tibble::as_tibble(.Last.value)
#> # A tibble: 1 x 1 #> value #> <lgl> #> 1 TRUE
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 #> #> id parameter type object class #> 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] id parameter type object class #> <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 #> #> id parameter type object class #> 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 #> #> id parameter type object class #> trees trees nparam[+] #> min_n min_n nparam[+] #>
# }