View source: R/dsg_benchmark.R
| dsg_source | R Documentation |
Creates a data source with controlled real and virtual drift,
following the pipeline of Hinder et al. (2026), "Real vs. Virtual Drift:
Creating Realistic Stream Learning Benchmarks". A source combines nv
feature distributions (virtual drift states, given by samplers) with nr
labelling rules (real drift states, given by labelers), so it has
nv * nr concepts. Moving between two concepts that share the labelling rule
is pure virtual drift; moving between two that share the feature
distribution is pure real drift.
Most users will create sources with dsg_source_data() (from a real-world
stream) or with the synthetic generators dsg_sea(), dsg_agrawal(),
dsg_sine() and dsg_mixed(), draw samples with dsg_take(), induce drift
with dsg_drift(), and build whole streams with dsg_stream().
dsg_source(
samplers,
labelers,
real_drift_level = 0.01,
virtual_p_value = 0.001,
test_size = 1000,
n_perm = 2500,
max_tries = 100
)
samplers |
List of functions; |
labelers |
List of functions; |
real_drift_level |
Smallest share of labels that a real drift must
change (on |
virtual_p_value |
Largest p-value of the kernel two-sample test
( |
test_size |
Number of points drawn to verify each drift. |
n_perm |
Number of permutations of the two-sample test. |
max_tries |
Number of candidate concepts tried by |
dsg_source object
Hinder, F., Brinkrolf, J., Lammers, K., and Hammer, B. (2026). Real vs. Virtual Drift: Creating Realistic Stream Learning Benchmarks. In Proceedings of the European Symposium on Artificial Neural Networks, Computational Intelligence and Machine Learning (ESANN 2026), 133-138.
# Two feature distributions and two labelling rules: four concepts.
source <- dsg_source(
samplers = list(
function(n) data.frame(x = stats::runif(n, 0, 1)),
function(n) data.frame(x = stats::runif(n, 0.5, 1.5))
),
labelers = list(
function(x) as.integer(x$x > 0.5),
function(x) as.integer(x$x > 1)
),
test_size = 200, n_perm = 200
)
set.seed(1)
stream <- dsg_stream(source, "-v-r", batch_size = 100)
stream$segments
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.