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.

Format

R6::R6Class inheriting from Filter.

Construction

FilterImportance$new(learner = mlr3::lrn("classif.rpart"))
mlr_filters$get("importance")
flt("importance")
  • learner :: mlr3::Learner
    Learner to extract the importance values from.

See also

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