expand_model: Model Expansion Over Tuning Parameters

Description Usage Arguments Value See Also Examples

View source: R/expand.R

Description

Expand a model over all combinations of a grid of tuning parameters.

Usage

1
expand_model(x, ..., random = FALSE)

Arguments

x

model function, function name, or call.

...

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

random

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

Value

list of expanded models.

See Also

SelectedModel

Examples

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

data(Boston, package = "MASS")

models <- expand_model(GBMModel, n.trees = c(50, 100),
                                 interaction.depth = 1:2)

fit(medv ~ ., data = Boston, model = SelectedModel(models))

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