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:
Outputs a message during train.
Outputs a message during predict.
Signals a warning during train.
Signals a warning during predict.
Raises an exception during train.
Raises an exception during predict.
Provokes a segfault during train.
Provokes a segfault during predict.
Ratio of predictions which will be NA.
Saves input task in
model slot during training and prediction.
Numeric parameter. Ignored.
Note that segfaults may not work on your operating system. Also note that if they work, they will tear down your R session immediately!
learner = LearnerClassifDebug$new() learner$param_set$values = list(message_train = TRUE, save_tasks = TRUE) # this should signal a message task = mlr_tasks$get("iris") learner$train(task)#>learner$predict(task)#> <PredictionClassif> for 150 observations: #> row_id truth response #> 1: 1 setosa versicolor #> 2: 2 setosa versicolor #> 3: 3 setosa versicolor #> --- #> 148: 148 virginica versicolor #> 149: 149 virginica versicolor #> 150: 150 virginica versicolor# task_train and task_predict are the input tasks for train() and predict() names(learner$model)#>  "response" "task_train" "task_predict"