mlr_sugar: Syntactic Sugar for Object Construction

Description Usage Arguments Value Examples

Description

Functions to retrieve objects, set hyperparameters and assign to fields in one go. Relies on mlr3misc::dictionary_sugar() to extract objects from the respective mlr3misc::Dictionary:

Usage

1
2
3
4
5
6
7
8
9
tsk(.key, ...)

tgen(.key, ...)

lrn(.key, ...)

rsmp(.key, ...)

msr(.key, ...)

Arguments

.key

:: character(1)
Key passed to the respective mlr3misc::Dictionary to retrieve the object.

...

:: named list()
Named arguments passed to the constructor, to be set as parameters in the paradox::ParamSet, or to be set as public field. See mlr3misc::dictionary_sugar() for more details.

Value

R6::R6Class of the respective type.

Examples

1
2
3
4
5
6
7
8
9
# iris task with new id
tsk("iris", id = "iris2")

# classification tree with different hyperparameters
# and predict type set to predict probabilities
lrn("classif.rpart", cp = 0.1, predict_type = "prob")

# multiple learners with predict type 'prob'
lapply(c("classif.featureless", "classif.rpart"), lrn, predict_type = "prob")

mllg/mlr3 documentation built on Sept. 27, 2019, 9:38 a.m.