Skip to contents

A simple LearnerClassif which only analyzes the labels during train, ignoring all features. Hyperparameter method determines the mode of operation during prediction:

mode:

Predicts the most frequent label. If there are two or more labels tied, randomly selects one per prediction. Probabilities correspond to the relative frequency of the class labels in the training set.

sample:

Randomly predict a label uniformly. Probabilities correspond to a uniform distribution of class labels, i.e. 1 divided by the number of classes.

weighted.sample:

Randomly predict a label, with probability estimated from the training distribution. For consistency, probabilities are 1 for the sampled label and 0 for all other labels.

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”, “POSIXct”

  • Required Packages: mlr3

Parameters

IdTypeDefaultLevels
methodcharactermodemode, sample, weighted.sample

See also

Other Learner: Learner, LearnerClassif, LearnerRegr, mlr_learners, mlr_learners_classif.debug, mlr_learners_classif.rpart, mlr_learners_regr.debug, mlr_learners_regr.featureless, mlr_learners_regr.rpart

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifFeatureless

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.


Method importance()

All features have a score of 0 for this learner.

Usage

LearnerClassifFeatureless$importance()

Returns

Named numeric().


Method selected_features()

Selected features are always the empty set for this learner.

Usage

LearnerClassifFeatureless$selected_features()

Returns

character(0).


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifFeatureless$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.