| mlr_filters_ensemble | R Documentation |
FilterEnsemble aggregates several Filters by averaging their scores
(or ranks) with user-defined weights. Each wrapped filter is evaluated on the supplied task,
and the resulting feature scores are combined feature-wise by a convex combination determined
through the weights parameter. This allows leveraging complementary inductive biases of
multiple filters without committing to a single criterion. The concept was introduced by
Binder et al. (2020). This implementation follows the idea but leaves the exact choice of
weights to the user.
R6Class object inheriting from Filter.
FilterEnsemble$new(filters)
filters :: list of Filter
Filters that are evaluated and aggregated. Each filter must be cloneable and support the
task type and feature types of the ensemble. The ensemble identifier defaults to the wrapped
filter ids concatenated by ".".
weights :: numeric()
Required non-negative weights, one for each wrapped filter, with at least one strictly positive value.
Values are used as given when calculating the weighted mean. If named, names must match the wrapped filter ids.
rank_transform :: logical(1)
If TRUE, ranks of individual filter scores are used instead of the raw scores before
averaging. Initialized to FALSE.
Parameters of wrapped filters are available via $param_set and can be referenced using
the wrapped filter id followed by ".", e.g. "variance.na.rm".
$wrapped :: named list of Filter
Read-only access to the wrapped filters.
get_weights_search_space(weights_param_name = "weights", normalize_weights = "uniform", prefix = "w")
(character(1), character(1), character(1)) -> ParamSet
Construct a ParamSet describing a weight search space.
get_weights_tunetoken(normalize_weights = "uniform")
(character(1)) -> TuneToken
Shortcut returning a TuneToken for tuning the weights.
set_weights_to_tune(normalize_weights = "uniform")
(character(1)) -> self
Convenience wrapper that stores the TuneToken returned by
get_weights_tunetoken() in $param_set$values$weights.
All wrapped filters are called with nfeat equal to the number of features to ensure that
complete score vectors are available for aggregation. Scores are combined per feature by
computing the weighted (optionally rank-based) mean.
Binder M, Moosbauer J, Thomas J, Bischl B (2020). “Multi-objective hyperparameter tuning and feature selection using filter ensembles.” In Proceedings of the 2020 Genetic and Evolutionary Computation Conference, 471–479. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1145/3377930.3389815")}.
library("mlr3")
library("mlr3filters")
task = tsk("sonar")
flt = mlr_filters$get("ensemble",
filters = list(FilterVariance$new(), FilterAUC$new()))
flt$param_set$values$weights = c(variance = 0.5, auc = 0.5)
flt$calculate(task)
head(as.data.table(flt))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.