Filter which uses the predictive performance of a mlr3::Learner as filter score. Performs a mlr3::resample() for each feature separately. The filter score is the aggregated performance of the mlr3::Measure, or the negated aggregated performance if the measure has to be minimized.

See also

Super class

mlr3filters::Filter -> FilterPerformance

Public fields

learner

(mlr3::Learner)

resampling

(mlr3::Resampling)

measure

(mlr3::Measure)

Methods

Public methods

Inherited methods

Method new()

Create a FilterDISR object.

Usage

FilterPerformance$new(
  id = "performance",
  task_type = learner$task_type,
  param_set = learner$param_set,
  feature_types = learner$feature_types,
  learner = mlr3::lrn("classif.rpart"),
  resampling = mlr3::rsmp("holdout"),
  measure = mlr3::msr("classif.ce"),
  packages = learner$packages
)

Arguments

id

(character(1))
Identifier for the filter.

task_type

(character())
Types of the task the filter can operator on. E.g., "classif" or "regr".

param_set

(paradox::ParamSet)
Set of hyperparameters.

feature_types

(character())
Feature types the filter operates on. Must be a subset of mlr_reflections$task_feature_types.

learner

(mlr3::Learner)
mlr3::Learner to use for model fitting.

resampling

(mlr3::Resampling)
mlr3::Resampling to be used within resampling.

measure

(mlr3::Measure)
mlr3::Measure to be used for evaluating the performance.

packages

(character())
Set of required packages. Note that these packages will be loaded via requireNamespace(), and are not attached.


Method clone()

The objects of this class are cloneable with this method.

Usage

FilterPerformance$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

task = mlr3::tsk("iris") learner = mlr3::lrn("classif.rpart") filter = flt("performance", learner = learner) filter$calculate(task) as.data.table(filter)
#> feature score #> 1: Petal.Width -0.06 #> 2: Petal.Length -0.10 #> 3: Sepal.Length -0.40 #> 4: Sepal.Width -0.54