SAGE with marginal sampling (features are marginalized independently). This is the standard SAGE implementation.
Super classes
xplainfi::FeatureImportanceMethod
-> xplainfi::SAGE
-> MarginalSAGE
Methods
Method new()
Creates a new instance of the MarginalSAGE class.
Usage
MarginalSAGE$new(
task,
learner,
measure,
resampling = NULL,
features = NULL,
n_permutations = 10L,
reference_data = NULL,
batch_size = 5000L,
max_reference_size = 100L,
early_stopping = FALSE,
convergence_threshold = 0.01,
se_threshold = Inf,
min_permutations = 10L,
check_interval = 2L
)
Arguments
task, learner, measure, resampling, features, n_permutations, reference_data, batch_size, max_reference_size, early_stopping, convergence_threshold, se_threshold, min_permutations, check_interval
Passed to SAGE.
Examples
library(mlr3)
task = tgen("friedman1")$generate(n = 100)
sage = MarginalSAGE$new(
task = task,
learner = lrn("regr.ranger", num.trees = 50),
measure = msr("regr.mse"),
n_permutations = 3L
)
#> ℹ No <Resampling> provided
#> Using `resampling = rsmp("holdout")` with default `ratio = 0.67`.
sage$compute()
# Use batching for memory efficiency with large datasets
sage$compute(batch_size = 1000)