expand_params: Model 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 supplied inputs.

Usage

1
expand_params(..., random = FALSE)

Arguments

...

named vectors or factors or a list of these containing the parameter values over which to create the grid.

random

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

Value

A data frame containing one row for each combination of the supplied inputs.

See Also

TunedModel

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Requires prior installation of suggested package gbm to run

data(Boston, package = "MASS")

grid <- expand_params(
  n.trees = c(50, 100),
  interaction.depth = 1:2
)

fit(medv ~ ., data = Boston, model = TunedModel(GBMModel, grid = grid))

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