Skip to contents

A KnockoffSampler defaulting to second-order Gaussian knockoffs as created by seqknockoff::knockoffs_seq.

Details

This is equivalent to KnockoffSampler using knockoff_fun = seqknockoff::knockoffs_seq.

References

Watson D, Wright M (2021). “Testing conditional independence in supervised learning algorithms.” Machine Learning, 110(8), 2107-2129. doi:10.1007/s10994-021-06030-6 .

Blesch K, Watson D, Wright M (2023). “Conditional feature importance for mixed data.” AStA Advances in Statistical Analysis, 108(2), 259-278. doi:10.1007/s10182-023-00477-9 .

Super classes

xplainfi::FeatureSampler -> xplainfi::ConditionalSampler -> xplainfi::KnockoffSampler -> KnockoffSequentialSampler

Public fields

feature_types

(character()) Feature types supported by the sampler. Will be checked against the provied mlr3::Task to ensure compatibility.

x_tilde

Knockoff matrix

Methods

Inherited methods


Method new()

Creates a new instance using sequential knockoffs via seqknockoff::knockoffs_seq.

Usage

KnockoffSequentialSampler$new(task, iters = 1)

Arguments

task

(mlr3::Task) Task to sample from.

iters

(integer(1): 1) Number of repetitions the knockoff_fun is applied to create multiple x_tilde instances per observation.


Method clone()

The objects of this class are cloneable with this method.

Usage

KnockoffSequentialSampler$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

if (FALSE) { # \dontrun{
# Requires seqknockoff (https://github.com/kormama1/seqknockoff)
task = tgen("simplex")$generate(n = 100)
sampler_seq = KnockoffSampler$new(task)
sampled_seq = sampler_seq$sample("x1")
} # }