mlr3filters adds filters, feature selection methods and embedded feature selection methods of algorithms to mlr3.

Travis build status CRAN Status Badge cran checks CRAN Downloads Coverage status StackOverflow

Installation

CRAN version

install.packages("mlr3filters")

Development version

remotes::install_github("mlr-org/mlr3filters")

Filters

Implemented Filters

Name Task Type Feature Types Package
anova Classif Integer, Numeric stats
auc Classif Integer, Numeric mlr3measures
carscore Regr Numeric care
cmim Classif & Regr Integer, Numeric, Factor, Ordered praznik
correlation Regr Integer, Numeric stats
disr Classif Integer, Numeric, Factor, Ordered praznik
importance Universal Logical, Integer, Numeric, Character, Factor, Ordered rpart
information_gain Classif & Regr Integer, Numeric, Factor, Ordered FSelectorRcpp
jmi Classif Integer, Numeric, Factor, Ordered praznik
jmim Classif Integer, Numeric, Factor, Ordered praznik
kruskal_test Classif Integer, Numeric stats
mim Classif Integer, Numeric, Factor, Ordered praznik
mrmr Classif & Regr Numeric, Factor, Integer, Character, Logical praznik
njmim Classif Integer, Numeric, Factor, Ordered praznik
performance Universal Logical, Integer, Numeric, Character, Factor, Ordered rpart
variance Classif & Regr Integer, Numeric stats

Variable Importance Filters

The following learners allow the extraction of variable importance and therefore are supported by FilterImportance:

If your learner is not listed here but capable of extracting variable importance from the fitted model, the reason is most likely that it is not yet integrated in mlr3learners or mlr3extralearners. Please open an issue so we can add your package.

Some learners need to have their variable importance measure “activated” during learner creation. For example, to use the “impurity” measure of Random Forest via the ranger package:

task = tsk("iris")
lrn = lrn("classif.ranger")
lrn$param_set$values = list(importance = "impurity")

filter = flt("importance", learner = lrn)
filter$calculate(task)
head(as.data.table(filter), 3)

Performance Filter

FilterPerformance is a univariate filter method which calls resample() with every predictor variable in the dataset and ranks the final outcome using the supplied measure. Any learner can be passed to this filter with classif.rpart being the default. Of course, also regression learners can be passed if the task is of type “regr”.