dsg_stream: Generate a benchmark stream with controlled drift

View source: R/dsg_benchmark.R

dsg_streamR Documentation

Generate a benchmark stream with controlled drift

Description

Builds a stream segment by segment. Each character of pattern first induces a drift with dsg_drift() ("-" or "_" none, "v" virtual, "r" real, "c" both, "a" any) and then draws batch_size samples from the resulting concept.

Usage

dsg_stream(source, pattern, batch_size = 500)

Arguments

source

dsg_source object

pattern

Drift pattern, such as "--v--r-".

batch_size

Number of samples per segment.

Value

list with

  • data: data frame with the features, the label y, the segment and the drift code of the segment (0 none, 1 virtual, 2 real, 3 both, as in the reference implementation);

  • segments: one row per segment with the drift type, the concept and the verification statistics;

  • source: the source in its final concept.

Examples

set.seed(3)
# small settings keep the example fast; use the defaults for real benchmarks
source <- dsg_sea(n_perm = 200, test_size = 300, init_size = 300, n_clusters = 8)
stream <- dsg_stream(source, "-v-r", batch_size = 100)
head(stream$data)
stream$segments

heimdall documentation built on Dec. 2, 2026, 5:08 p.m.