A simple LearnerRegr used primarily in the unit tests and for debugging purposes. If no hyperparameter is set, it simply constantly predicts the mean value of the training data. The following hyperparameters trigger the following actions:
- predict_missing:
Ratio of predictions which will be NA.
- predict_missing_type:
To to encode missingness. “na” will insert NA values, “omit” will just return fewer predictions than requested.
- save_tasks:
Saves input task in
model
slot during training and prediction.- threads:
Number of threads to use. Has no effect.
- x:
Numeric tuning parameter. Has no effect.
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
Parameters
Id | Type | Default | Levels | Range |
predict_missing | numeric | 0 | \([0, 1]\) | |
predict_missing_type | character | na | na, omit | - |
save_tasks | logical | FALSE | TRUE, FALSE | - |
threads | integer | - | \([1, \infty)\) | |
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
mlr3::Learner
-> mlr3::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:mtcars> (20 x 11): Motor Trends
#> * Target: mpg
#> * Properties: -
#> * Features (10):
#> - dbl (10): am, carb, cyl, disp, drat, gear, hp, qsec, vs, wt
learner$model$task_predict
#> <TaskRegr:mtcars> (12 x 11): Motor Trends
#> * Target: mpg
#> * Properties: -
#> * Features (10):
#> - dbl (10): am, carb, cyl, disp, drat, gear, hp, qsec, vs, wt