parameters.workflow: Determination of parameter sets for other objects

Description Usage Arguments Value Examples

View source: R/param_set.workflows.R

Description

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

Usage

1
2
3
4
5
6
7
8
## S3 method for class 'workflow'
parameters(x, ...)

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

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

Arguments

x

An object

...

Not currently used.

Value

A parameter set object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
library(tibble)
library(recipes)

recipe(mpg ~ ., data = mtcars) %>%
  step_impute_knn(all_predictors(), neighbors = tune()) %>%
  step_pca(all_predictors(), num_comp = tune()) %>%
  dials::parameters()

 # A peak under the hood
 tibble::as_tibble(.Last.value)

recipe(mpg ~ ., data = mtcars) %>%
  step_ns(disp, deg_free = tune("disp df")) %>%
  step_ns(wt, deg_free = tune("wt df")) %>%
  dials::parameters()

recipe(mpg ~ ., data = mtcars) %>%
  step_normalize(all_predictors()) %>%
  dials::parameters()

library(parsnip)

boost_tree(trees = tune(), min_n = tune()) %>%
  set_engine("xgboost") %>%
  dials::parameters()

boost_tree(trees = tune(), min_n = tune()) %>%
  set_engine("C5.0", rules = TRUE) %>%
  dials::parameters()

tune documentation built on July 21, 2021, 5:09 p.m.