Base class for conditional sampling methods where features are sampled conditionally on other features. This is an abstract class that should be extended by concrete implementations.
Super class
FeatureSampler -> ConditionalSampler
Methods
Inherited methods
ConditionalSampler$new()
Creates a new instance of the ConditionalSampler class
Usage
ConditionalSampler$new(task, conditioning_set = NULL)Arguments
task(mlr3::Task) Task to sample from
conditioning_set(
character|NULL) Default conditioning set to use in$sample().
ConditionalSampler$sample()
Sample from stored task conditionally on other features.
Usage
ConditionalSampler$sample(
feature,
row_ids = NULL,
conditioning_set = NULL,
samples_per_row = 1L,
...
)Arguments
feature(
character) Feature(s) to sample.row_ids(
integer()|NULL) Row IDs to use. IfNULL, uses all rows.conditioning_set(
character|NULL) Features to condition on.samples_per_row(
integer(1):1L) Number of independent samples per input row. See FeatureSampler$sample()for output shape and ordering....Additional arguments passed to the sampler implementation.
ConditionalSampler$sample_newdata()
Sample from external data conditionally.
Usage
ConditionalSampler$sample_newdata(
feature,
newdata,
conditioning_set = NULL,
samples_per_row = 1L,
...
)Arguments
feature(
character) Feature(s) to sample.newdata(
data.table) External data to use.conditioning_set(
character|NULL) Features to condition on.samples_per_row(
integer(1):1L) Number of independent samples per input row. See FeatureSampler$sample()for output shape and ordering....Additional arguments passed to the sampler implementation.