Variable Importance filter using embedded feature selection of machine learning algorithms. Takes a mlr3::Learner which is capable of extracting the variable importance (property "importance"), fits the model and extracts the importance values to use as filter scores.

See also

Super class

mlr3filters::Filter -> FilterImportance

Public fields

learner

(mlr3::Learner)
Learner to extract the importance values from.

Methods

Public methods

Inherited methods

Method new()

Create a FilterImportance object.

Usage

FilterImportance$new(
  id = "importance",
  task_type = learner$task_type,
  feature_types = learner$feature_types,
  learner = mlr3::lrn("classif.rpart"),
  packages = learner$packages,
  param_set = learner$param_set
)

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".

feature_types

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

learner

(mlr3::Learner)
Learner to extract the importance values from.

packages

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

param_set

(paradox::ParamSet)
Set of hyperparameters.


Method clone()

The objects of this class are cloneable with this method.

Usage

FilterImportance$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

task = mlr3::tsk("iris") learner = mlr3::lrn("classif.rpart") filter = flt("importance", learner = learner) filter$calculate(task) as.data.table(filter)
#> feature score #> 1: Petal.Width 88.96940 #> 2: Petal.Length 81.34496 #> 3: Sepal.Length 54.09606 #> 4: Sepal.Width 36.01309