A simple LearnerClassif used primarily in the unit tests and for debugging purposes. If no hyperparameter is set, it simply constantly predicts a randomly selected label. The following hyperparameters trigger the following actions:

message_train:

Probability to output a message during train.

message_predict:

Probability to output a message during predict.

warning_train:

Probability to signal a warning during train.

warning_predict:

Probability to signal a warning during predict.

error_train:

Probability to raises an exception during train.

error_predict:

Probability to raise an exception during predict.

segfault_train:

Probability to provokes a segfault during train.

segfault_predict:

Probability to provokes a segfault during predict.

predict_missing

Ratio of predictions which will be NA.

save_tasks:

Saves input task in model slot during training and prediction.

x:

Numeric tuning parameter. Has no effect.

Note that segfaults may not be triggered on your operating system. Also note that if they work, they will tear down your R session immediately!

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("classif.featureless")
lrn("classif.featureless")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

  • Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”

  • Required Packages: -

Parameters

IdTypeDefaultRangeLevels
message_trainnumeric0\([0, 1]\)-
message_predictnumeric0\([0, 1]\)-
warning_trainnumeric0\([0, 1]\)-
warning_predictnumeric0\([0, 1]\)-
error_trainnumeric0\([0, 1]\)-
error_predictnumeric0\([0, 1]\)-
segfault_trainnumeric0\([0, 1]\)-
segfault_predictnumeric0\([0, 1]\)-
predict_missingnumeric0\([0, 1]\)-
save_taskslogicalFALSE\((-\infty, \infty)\)TRUE, FALSE
xnumeric-\([0, 1]\)-

See also

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifDebug

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage

LearnerClassifDebug$new()


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifDebug$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

learner = lrn("classif.debug") learner$param_set$values = list(message_train = 1, save_tasks = TRUE) # this should signal a message task = tsk("iris") learner$train(task)
#> Message from classif.debug->train()
learner$predict(task)
#> <PredictionClassif> for 150 observations: #> row_id truth response #> 1 setosa versicolor #> 2 setosa versicolor #> 3 setosa versicolor #> --- #> 148 virginica versicolor #> 149 virginica versicolor #> 150 virginica versicolor
# task_train and task_predict are the input tasks for train() and predict() names(learner$model)
#> [1] "response" "pid" "task_train" "task_predict"