Base class for implementing different sampling strategies for feature importance methods like PFI and CFI
task(mlr3::Task) Original task.
label(character(1)) Name of the sampler.
feature_types(character()) Feature types supported by the sampler.
Will be checked against the provided mlr3::Task to ensure compatibility.
param_set(paradox::ParamSet) Parameter set for the sampler.
new()Creates a new instance of the FeatureSampler class
FeatureSampler$new(task)task(mlr3::Task) Task to sample from
sample()Sample values for feature(s) from stored task
FeatureSampler$sample(feature, row_ids = NULL)feature(character) Feature name(s) to sample (can be single or multiple). Must match those in the stored Task.
row_ids(integer(): NULL) Row IDs of the stored Task to use as basis for sampling.
Modified copy of the input features with the feature(s) sampled:
A data.table with same number of columns and one row matching the supplied row_ids
sample_newdata()Sample values for feature(s) using external data
FeatureSampler$sample_newdata(feature, newdata)feature(character) Feature name(s) to sample (can be single or multiple)
newdata(data.table ) External data to use for sampling.
...Ignored.
clone()The objects of this class are cloneable with this method.
FeatureSampler$clone(deep = FALSE)deepWhether to make a deep clone.