View source: R/learner_expand_grid.R
| learner_expand_grid | R Documentation |
Construct learners from a grid of parameters
learner_expand_grid(fun, args, names = TRUE, params = FALSE)
fun |
(function) A function that returns a learner. |
args |
(list) Parameters that generate a grid of parameters with
expand.list, where the set of parameters are then passed on to |
names |
(logical or character) If FALSE, then return a list without names. If TRUE, a named list is returned (see details). |
params |
(logical) If FALSE, then no information about the parameters
defined by |
list
lrs <- learner_expand_grid(
learner_xgboost,
list(formula = Sepal.Length ~ ., eta = c(0.2, 0.5, 0.3))
)
lrs # use info of constructed learner as names
lrs <- learner_expand_grid(
learner_xgboost,
list(formula = Sepal.Length ~ ., eta = c(0.2, 0.5, 0.3)),
names = "xgboost"
)
names(lrs) # use xgboost instead of info field for names
lrs <- learner_expand_grid(
learner_xgboost,
list(formula = Sepal.Length ~ ., eta = c(0.2, 0.5, 0.3)),
names = "xgboost",
params = TRUE
)
names(lrs) # also add parameters to names
lrs <- learner_expand_grid(
learner_xgboost,
list(formula = Sepal.Length ~ ., eta = c(0.2, 0.5, 0.3)),
names = FALSE
)
names(lrs) # unnamed list since names = FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.