Feature Importance Method Class
Feature Importance Method Class
Public fields
label
(
character(1)
) Method label.task
learner
measure
resampling
resample_result
features
(
character
)param_set
importance
(data.table) Aggregated importance scores
scores
(data.table) Individual performance scores used to compute
$importance
per resampling iteration and permutation iteration.obs_losses
(data.table) Observation-wise losses when available (e.g., when using obs_loss = TRUE). Contains columns for row_ids, feature, iteration indices, individual loss values, and both reference and feature-specific predictions.
predictions
(data.table) Feature-specific prediction objects when using obs_loss = TRUE. Contains columns for feature, iteration, iter_refit, and prediction objects. Similar to ResampleResult$predictions() but extended for feature-specific models.
Methods
Method new()
Creates a new instance of this R6 class. This is typically intended for use by derived classes.
Usage
FeatureImportanceMethod$new(
task,
learner,
measure,
resampling = NULL,
features = NULL,
param_set = paradox::ps(),
label
)
Method compute()
Compute feature importance scores
Usage
FeatureImportanceMethod$compute(
relation = c("difference", "ratio"),
store_backends = TRUE
)
Method combine()
Combine two FeatureImportanceMethod
objects with computed scores.
Arguments
y
(FeatureImportanceMethod) Object to combine. Must have computed scores.
...
(any) Unused.
Returns
A new FeatureImportanceMethod of the same subclass as x
and y
.
Currently this method merges the following:
$scores
is combined, withiter_rsmp
increased fory
.$importance
is re-computed from the combined$scores
.$resample_result
is combined to a mlr3::BenchmarkResult$resampling
is combined into a mlr3::ResamplingCustom, again continuing teiteration
count fromx
with that ofy
.
Method reset()
Resets all stored fields populated by $compute
: $resample_result
, $importance
, $scores
, $obs_losses
, and $predictions
.