Skip to contents

Create pre-defined parameter grids for common models

Usage

tl_default_param_grid(method, size = "medium", is_classification = TRUE)

Arguments

method

Model method ("tree", "forest", "boost", "svm", etc.)

size

Grid size: "small", "medium", "large"

is_classification

Whether the task is classification or regression

Value

A named list of parameter values suitable for passing to tl_tune_grid or tl_tune_random. Each element is a numeric or character vector of candidate values for that hyperparameter, or for "deep"'s hidden_layers a list of layer-size vectors. The grid is built without the data, so a "forest" mtry can exceed the number of predictors; the tuners cap it. "polynomial" tunes degree. "linear" and "logistic" have no tuneable hyperparameter and return an empty list with a warning, as does an unknown method.

Examples

# \donttest{
grid <- tl_default_param_grid("tree", size = "small")
grid <- tl_default_param_grid("forest", size = "medium")
# }