expand_steps: Recipe Step Parameters Expansion

Description Usage Arguments Value See Also Examples

View source: R/expand.R

Description

Create a grid of parameter values from all combinations of lists supplied for steps of a preprocessing recipe.

Usage

1
expand_steps(..., random = FALSE)

Arguments

...

one or more lists containing parameter values over which to create the grid. For each list an argument name should be given as the id of the recipe step to which it corresponds.

random

number of points to be randomly sampled from the parameter grid or FALSE if all points are to be returned.

Value

RecipeGrid class object that inherits from data.frame.

See Also

TunedInput

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(recipes)
data(Boston, package = "MASS")

rec <- recipe(medv ~ ., data = Boston) %>%
  step_corr(all_numeric(), -all_outcomes(), id = "corr") %>%
  step_pca(all_numeric(), -all_outcomes(), id = "pca")

expand_steps(
  corr = list(threshold = c(0.8, 0.9),
              method = c("pearson", "spearman")),
  pca = list(num_comp = 1:3)
)

MachineShop documentation built on June 18, 2021, 9:06 a.m.