Perturbation Feature Importance Base Class
Source:R/PerturbationImportance.R
PerturbationImportance.RdAbstract base class for perturbation-based importance methods PFI, CFI, and RFI
Super class
xplainfi::FeatureImportanceMethod -> PerturbationImportance
Public fields
sampler(FeatureSampler) Sampler object for feature perturbation
Methods
Method new()
Creates a new instance of the PerturbationImportance class
Usage
PerturbationImportance$new(
task,
learner,
measure,
resampling = NULL,
features = NULL,
groups = NULL,
sampler = NULL,
relation = "difference",
n_repeats = 1L,
batch_size = NULL
)Arguments
task, learner, measure, resampling, features, groupsPassed to FeatureImportanceMethod.
sampler(FeatureSampler) Sampler to use for feature perturbation.
relation(
character(1):"difference") How to relate perturbed and baseline scores. Can also be"ratio".n_repeats(
integer(1):1L) Number of permutation/conditional sampling iterations. Can be overridden in$compute().batch_size(
integer(1)|NULL:NULL) Maximum number of rows to predict at once. WhenNULL, predicts alltest_size * n_repeatsrows in one call. Use smaller values to reduce memory usage at the cost of more prediction calls. Can be overridden in$compute().
Method importance()
Get aggregated importance scores.
Extends the base $importance() method to support the additional "cpi" ci_method.
Arguments
relation(
character(1)) How to relate perturbed scores to originals ("difference" or "ratio"). IfNULL, uses stored parameter value.standardize(
logical(1):FALSE) IfTRUE, importances are standardized by the highest score so all scores fall in[-1, 1].ci_method(
character(1):"none") Variance estimation method. In addition to base methods ("none","raw","nadeau_bengio","quantile"), perturbation methods support"cpi"(Conditional Predictive Impact). CPI is specifically designed for CFI with knockoff samplers and uses one-sided hypothesis tests.conf_level(
numeric(1):0.95) Confidence level for confidence intervals whenci_method != "none".test(
character(1):"t") Test to use for CPI. One of"t","wilcoxon","fisher", or"binomial". Only used whenci_method = "cpi".B(
integer(1):1999) Number of replications for Fisher test. Only used whenci_method = "cpi"andtest = "fisher"....Additional arguments passed to the base method.
Returns
(data.table) Aggregated importance scores.