Skip to contents

SAGE with conditional sampling (features are "marginalized" conditionally). Uses ARFSampler as default ConditionalSampler.

See also

Super classes

xplainfi::FeatureImportanceMethod -> xplainfi::SAGE -> ConditionalSAGE

Methods

Inherited methods


Method new()

Creates a new instance of the ConditionalSAGE class.

Usage

ConditionalSAGE$new(
  task,
  learner,
  measure,
  resampling = NULL,
  features = NULL,
  n_permutations = 10L,
  reference_data = NULL,
  sampler = 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.

sampler

(ConditionalSampler) Optional custom sampler. Defaults to ARFSampler.


Method clone()

The objects of this class are cloneable with this method.

Usage

ConditionalSAGE$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

library(mlr3)
task = tgen("friedman1")$generate(n = 100)
sage = ConditionalSAGE$new(
  task = task,
  learner = lrn("regr.ranger", num.trees = 50),
  measure = msr("regr.mse"),
  n_permutations = 3L
)
#>  No <ConditionalSampler> provided, using <ARFSampler> with default settings.
#>  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)