Abstract base class for marginal sampling strategies that do not condition on other features. Marginal samplers sample from P(X_S), the marginal distribution of features S, ignoring any dependencies with other features.
Details
This class provides a common interface for different marginal sampling approaches:
MarginalPermutationSampler: Shuffles features independently within the dataset
MarginalReferenceSampler: Samples complete rows from reference data
Both approaches sample from the marginal distribution P(X_S), but differ in how they preserve or break within-row dependencies:
Permutation breaks ALL dependencies (both with target and between features)
Reference sampling preserves WITHIN-row dependencies but breaks dependencies with test data
Comparison with ConditionalSampler:
MarginalSampler: Samples from \(P(X_S)\) - no conditioningConditionalSampler: Samples from \(P(X_S | X_{-S})\)- conditions on other features
This base class implements the public $sample() and $sample_newdata() methods,
delegating to private .sample_marginal() which subclasses must implement.
Super class
xplainfi::FeatureSampler -> MarginalSampler
Methods
Inherited methods
Method sample()
Sample features from their marginal distribution.
Arguments
feature(
character()) Feature name(s) to sample.row_ids(
integer()|NULL) Row IDs from task to use.
Method sample_newdata()
Sample from external data.
Arguments
feature(
character()) Feature(s) to sample.newdata(
data.table) External data to use.