mlr_learners_regr.debug: Regression Learner for Debugging

mlr_learners_regr.debugR Documentation

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.

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

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]

Super classes

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

Methods

Public 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

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

mlr3 documentation built on Oct. 18, 2024, 5:11 p.m.