expand_model: Model Expansion Over Tuning Parameters

View source: R/expand.R

expand_modelR Documentation

Model Expansion Over Tuning Parameters

Description

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

Usage

expand_model(object, ..., random = FALSE)

Arguments

object

model function, function name, or object; or another object that can be coerced to a model.

...

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

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


## 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 Sept. 5, 2022, 5:08 p.m.