A simple LearnerRegr used primarily in the unit tests and for debugging purposes. It constantly predicts the mean value of the training data, the standard deviation as standard error, and the quantiles of the training data. The following hyperparameters trigger the following actions:
- error_predict:
Probability to raise an exception during predict.
- error_train:
Probability to raise an exception during train.
- message_predict:
Probability to output a message during predict.
- message_train:
Probability to output a message during train.
- predict_missing:
Ratio of predictions which will be NA. The same observations are missing in the response and the standard error. Ignored for predict type
"quantiles".- predict_missing_type:
How to encode missingness. “na” will insert NA values, “omit” will just return fewer predictions than requested.
- save_tasks:
Saves input task in
modelslot during training and prediction.- segfault_predict:
Probability to provoke a segfault during predict.
- segfault_train:
Probability to provoke a segfault during train.
- threads:
Number of threads to use. Has no effect.
- warning_predict:
Probability to signal a warning during predict.
- warning_train:
Probability to signal a warning during train.
- x:
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!
Dictionary
This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():
Meta Information
Task type: “regr”
Predict Types: “response”, “se”, “quantiles”
Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”
Required Packages: mlr3, 'stats'
Parameters
| 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]\) | |
| threads | integer | - | \([1, \infty)\) | |
| warning_predict | numeric | 0 | \([0, 1]\) | |
| warning_train | numeric | 0 | \([0, 1]\) | |
| x | numeric | - | \([0, 1]\) |
See also
Chapter in the mlr3book: https://mlr3book.mlr-org.com/chapters/chapter2/data_and_basic_modeling.html#sec-learners
Package mlr3learners for a solid collection of essential learners.
Package mlr3extralearners for more 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:
Learner,
LearnerClassif,
LearnerRegr,
mlr_learners,
mlr_learners_classif.debug,
mlr_learners_classif.featureless,
mlr_learners_classif.rpart,
mlr_learners_regr.featureless,
mlr_learners_regr.rpart
Super classes
Learner -> LearnerRegr -> LearnerRegrDebug
Methods
Examples
task = tsk("mtcars")
learner = lrn("regr.debug", save_tasks = TRUE)
learner$train(task, row_ids = 1:20)
prediction = learner$predict(task, row_ids = 21:32)
learner$model$task_train
#>
#> ── <TaskRegr> (20x11): Motor Trends ────────────────────────────────────────────
#> • Target: mpg
#> • Properties: -
#> • Features (10):
#> • dbl (10): am, carb, cyl, disp, drat, gear, hp, qsec, vs, wt
learner$model$task_predict
#>
#> ── <TaskRegr> (12x11): Motor Trends ────────────────────────────────────────────
#> • Target: mpg
#> • Properties: -
#> • Features (10):
#> • dbl (10): am, carb, cyl, disp, drat, gear, hp, qsec, vs, wt