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

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

# iris task with new id tsk("iris", id = "iris2")
#> <TaskClassif:iris2> (150 x 5) #> * Target: Species #> * Properties: multiclass #> Features (4): #> * dbl (4): Petal.Length, Petal.Width, Sepal.Length, Sepal.Width
# classification tree with different hyperparameters # and predict type set to predict probabilities lrn("classif.rpart", cp = 0.1, predict_type = "prob")
#> <LearnerClassifRpart:classif.rpart> #> * Model: - #> * Parameters: xval=0, cp=0.1 #> * Packages: rpart #> * Predict Type: prob #> * Feature types: logical, integer, numeric, character, factor, ordered #> * Properties: importance, missings, multiclass, selected_features, #> twoclass, weights
# multiple learners with predict type 'prob' lapply(c("classif.featureless", "classif.rpart"), lrn, predict_type = "prob")
#> [[1]] #> <LearnerClassifFeatureless:classif.featureless> #> * Model: - #> * Parameters: method=mode #> * Packages: - #> * Predict Type: prob #> * Feature types: logical, integer, numeric, character, factor, ordered #> * Properties: importance, missings, multiclass, selected_features, #> twoclass #> #> [[2]] #> <LearnerClassifRpart:classif.rpart> #> * Model: - #> * Parameters: xval=0 #> * Packages: rpart #> * Predict Type: prob #> * Feature types: logical, integer, numeric, character, factor, ordered #> * Properties: importance, missings, multiclass, selected_features, #> twoclass, weights #>