Base class generalizing refit-based variable importance measures.
Default corresponds to leaving out each feature n_repeats times, which
corresponds to LOCO (Leave One Covariate Out).
xplainfi::FeatureImportanceMethod -> WVIM
direction(character(1)) Either "leave-out" or "leave-in".
design(logical()) Feature selection design matrix where TRUE equals "left in" and FALSE "left out".
Columns correspond to task$feature_names and the number of rows corresponds to length(features) * n_repeats.
The base matrix is created by wvim_design_matrix and then replicated n_repeats times before.
instance(FSelectInstanceBatchSingleCrit) The mlr3fselect feature selection instance containing
also the archive of all evaluations, possible useful for future use. Only stored if store_instance is TRUE.
new()Creates a new instance of this R6 class.
WVIM$new(
task,
learner,
measure = NULL,
resampling = NULL,
features = NULL,
groups = NULL,
direction = c("leave-out", "leave-in"),
label = "Williamson's Variable Importance Measure (WVIM)",
n_repeats = 1L
)task, learner, measure, resampling, features, groupsPassed to FeatureImportanceMethod for construction.
direction(character(1)) Either "leave-out" or "leave-in".
label(character(1)) Method label.
n_repeats(integer(1)) Number of refit iterations per resampling iteration.
compute()Computes leave-out or leave-in feature importance.
wvim_design_matrix(task$feature_names, "leave-out") corresponds to LOCO.
WVIM$compute(
store_models = TRUE,
store_backends = TRUE,
store_instance = FALSE
)store_models, store_backends(logical(1): TRUE) Whether to store fitted models / data backends, passed to mlr3::resample internally
backends in resample result.
Required for some measures, but may increase memory footprint.
store_instance(logical(1): FALSE) Whether to store the mlr3fselect::mlr3fselect instance in $instance.
clone()The objects of this class are cloneable with this method.
WVIM$clone(deep = FALSE)deepWhether to make a deep clone.