| KnockoffGaussianSampler | R Documentation |
A KnockoffSampler defaulting to second-order Gaussian knockoffs as created by knockoff::create.second_order.
This is equivalent to KnockoffSampler using the default knockoff_fun.
xplainfi::FeatureSampler -> xplainfi::KnockoffSampler -> KnockoffGaussianSampler
feature_types(character()) Feature types supported by the sampler.
Will be checked against the provided mlr3::Task to ensure compatibility.
x_tildeKnockoff matrix
new()Creates a new instance using Gaussian knockoffs via knockoff::create.second_order.
KnockoffGaussianSampler$new(task, iters = 1)
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.
clone()The objects of this class are cloneable with this method.
KnockoffGaussianSampler$clone(deep = FALSE)
deepWhether to make a deep clone.
Watson D, Wright M (2021). “Testing Conditional Independence in Supervised Learning Algorithms.” Machine Learning, 110(8), 2107–2129. \Sexpr[results=rd]{tools:::Rd_expr_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. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10182-023-00477-9")}.
library(mlr3)
task = tgen("2dnormals")$generate(n = 100)
# Create sampler
sampler = KnockoffGaussianSampler$new(task)
# Sample using row_ids from stored task
sampled_data = sampler$sample("x1")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.