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:
Probability to raise an exception during predict.
Probability to raises an exception during train.
Probability to output a message during predict.
Probability to output a message during train.
Ratio of predictions which will be NA.
To to encode missingness. “na” will insert NA values, “omit” will just return fewer predictions than requested.
Saves input task in model
slot during training and prediction.
Probability to provokes a segfault during predict.
Probability to provokes a segfault during train.
Function returning a single number determining how many seconds to sleep during $train()
.
Function returning a single number determining how many seconds to sleep during $predict()
.
Number of threads to use. Has no effect.
Probability to signal a warning during predict.
Probability to signal a warning during train.
Numeric tuning parameter. Has no effect.
Note that segfaults may not be triggered reliably on your operating system. Also note that if they work as intended, they will tear down your R session immediately!
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn()
:
mlr_learners$get("classif.debug")
lrn("classif.debug")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3
Id | Type | Default | Levels | Range |
error_predict | numeric | 0 | \([0, 1]\) | |
error_train | numeric | 0 | \([0, 1]\) | |
message_predict | numeric | 0 | \([0, 1]\) | |
message_train | numeric | 0 | \([0, 1]\) | |
predict_missing | numeric | 0 | \([0, 1]\) | |
predict_missing_type | character | na | na, omit | - |
save_tasks | logical | FALSE | TRUE, FALSE | - |
segfault_predict | numeric | 0 | \([0, 1]\) | |
segfault_train | numeric | 0 | \([0, 1]\) | |
sleep_train | untyped | - | - | |
sleep_predict | untyped | - | - | |
threads | integer | - | \([1, \infty)\) | |
warning_predict | numeric | 0 | \([0, 1]\) | |
warning_train | numeric | 0 | \([0, 1]\) | |
x | numeric | - | \([0, 1]\) | |
iter | integer | 1 | \([1, \infty)\) |
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifDebug
Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more learners.
Dictionary of Learners: mlr_learners
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).
mlr3pipelines to combine learners with pre- and postprocessing steps.
Package mlr3viz for some generic visualizations.
Extension packages for additional task types:
mlr3proba for probabilistic supervised regression and survival analysis.
mlr3cluster for unsupervised clustering.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Other Learner:
LearnerClassif
,
LearnerRegr
,
Learner
,
mlr_learners_classif.featureless
,
mlr_learners_classif.rpart
,
mlr_learners_regr.debug
,
mlr_learners_regr.featureless
,
mlr_learners_regr.rpart
,
mlr_learners
learner = lrn("classif.debug")
learner$param_set$values = list(message_train = 1, save_tasks = TRUE)
# this should signal a message
task = tsk("penguins")
learner$train(task)
learner$predict(task)
# task_train and task_predict are the input tasks for train() and predict()
names(learner$model)
Run the code above in your browser using DataLab