Skip to contents

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

xplainfi::FeatureSampler -> ConditionalSampler

Methods

Inherited methods


Method new()

Creates a new instance of the ConditionalSampler class

Usage

Arguments

task

(mlr3::Task) Task to sample from


Method sample()

Sample from stored task conditionally on other features.

Usage

ConditionalSampler$sample(feature, row_ids, conditioning_set = NULL)

Arguments

feature

(character) Feature(s) to sample.

row_ids

(integer() | NULL) Row IDs to use. If NULL, uses all rows.

conditioning_set

(character | NULL) Features to condition on. If NULL, uses all other features.

Returns

Modified copy with sampled feature(s).


Method sample_newdata()

Sample from external data conditionally. See $sample() for details.

Usage

ConditionalSampler$sample_newdata(feature, newdata, conditioning_set = NULL)

Arguments

feature

(character) Feature(s) to sample.

newdata

(data.table) External data to use.

conditioning_set

(character | NULL) Features to condition on.

Returns

Modified copy with sampled feature(s).


Method clone()

The objects of this class are cloneable with this method.

Usage

ConditionalSampler$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.