Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

mlr_learners_classif.debug

Classification Learner for Debugging


Description

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:

message_train:

Probability to output a message during train.

message_predict:

Probability to output a message during predict.

warning_train:

Probability to signal a warning during train.

warning_predict:

Probability to signal a warning during predict.

error_train:

Probability to raises an exception during train.

error_predict:

Probability to raise an exception during predict.

segfault_train:

Probability to provokes a segfault during train.

segfault_predict:

Probability to provokes a segfault during predict.

predict_missing

Ratio of predictions which will be NA.

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.

Note that segfaults may not be triggered on your operating system. Also note that if they work, 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():

mlr_learners$get("classif.featureless")
lrn("classif.featureless")

Meta Information

  • Task type: “classif”

  • Predict Types: “response”, “prob”

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

  • Required Packages: -

Parameters

Id Type Default Range Levels
message_train numeric 0 [0, 1] -
message_predict numeric 0 [0, 1] -
warning_train numeric 0 [0, 1] -
warning_predict numeric 0 [0, 1] -
error_train numeric 0 [0, 1] -
error_predict numeric 0 [0, 1] -
segfault_train numeric 0 [0, 1] -
segfault_predict numeric 0 [0, 1] -
predict_missing numeric 0 [0, 1] -
save_tasks logical FALSE (-Inf, Inf) TRUE, FALSE
threads integer - [1, Inf) -
x numeric - [0, 1] -

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifDebug

Methods

Public methods


Method new()

Creates a new instance of this R6 class.

Usage
LearnerClassifDebug$new()

Method clone()

The objects of this class are cloneable with this method.

Usage
LearnerClassifDebug$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

See Also

as.data.table(mlr_learners) for a complete table of all (also dynamically created) Learner implementations.

Examples

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)

mlr3

Machine Learning in R - Next Generation

v0.11.0
LGPL-3
Authors
Michel Lang [cre, aut] (<https://orcid.org/0000-0001-9754-0393>), Bernd Bischl [aut] (<https://orcid.org/0000-0001-6002-6980>), Jakob Richter [aut] (<https://orcid.org/0000-0003-4481-5554>), Patrick Schratz [aut] (<https://orcid.org/0000-0003-0748-6624>), Giuseppe Casalicchio [ctb] (<https://orcid.org/0000-0001-5324-5966>), Stefan Coors [ctb] (<https://orcid.org/0000-0002-7465-2146>), Quay Au [ctb] (<https://orcid.org/0000-0002-5252-8902>), Martin Binder [aut], Marc Becker [ctb] (<https://orcid.org/0000-0002-8115-0400>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.