Learn R Programming

mlr3 (version 0.23.0)

mlr_learners_regr.debug: Regression Learner for Debugging

Description

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.

Arguments

Dictionary

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

mlr_learners$get("regr.debug")
lrn("regr.debug")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”, “se”, “quantiles”

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

  • Required Packages: mlr3

Parameters

IdTypeDefaultLevelsRange
predict_missingnumeric0\([0, 1]\)
predict_missing_typecharacternana, omit-
save_taskslogicalFALSETRUE, FALSE-
threadsinteger-\([1, \infty)\)
xnumeric-\([0, 1]\)

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrDebug

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage

LearnerRegrDebug$new()


Method importance()

Returns 0 for each feature seen in training.

Usage

LearnerRegrDebug$importance()

Returns

Named numeric().


Method selected_features()

Always returns character(0).

Usage

LearnerRegrDebug$selected_features()

Returns

character().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrDebug$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

See Also

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

Examples

Run this code
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
learner$model$task_predict

Run the code above in your browser using DataLab