| dfr_padd | R Documentation |
Unsupervised batch drift detector of Komorniczak and
Ksieniewicz (2024). The data stream is processed in chunks of
chunk_size observations, each passed through a randomly initialised,
never trained neural network (one hidden ReLU layer of hidden units,
outputs ReLU outputs and a softmax, weights drawn from N(0, 0.1)). For
every output, replications Student t-tests compare a sample of
sample_size activations of the current chunk with a sample of the
activations stored since the last drift (both drawn with replacement). A
drift is reported when more than threshold * outputs * replications tests
are significant at level alpha; the stored activations are then cleared.
Since it monitors the inputs only, it is used for virtual concept drift.
dfr_padd(
target_feat = NULL,
chunk_size = 200,
alpha = 0.05,
threshold = 0.17,
outputs = 30,
replications = 35,
sample_size = 75,
hidden = 10,
seed = NULL,
weights = NULL
)
target_feat |
Names of the columns to be monitored. |
chunk_size |
Number of observations of a chunk (the batches of the paper, 200 in its experiments). |
alpha |
Significance level of the t-tests. |
threshold |
Fraction of significant tests above which a drift is reported. |
outputs |
Number of outputs of the network ( |
replications |
Number of t-tests per output ( |
sample_size |
Size of the samples drawn for every test ( |
|
Number of units of the hidden layer. | |
seed |
Seed of the network weights and of the samples. |
weights |
Optional fixed network: a list with the hidden layer
( |
The defaults are those of the reference implementation
(https://github.com/w4k2/padd, methods.py). The paper's experiments use
outputs = 12, replications = 12, sample_size = 50, and
alpha = 0.07, threshold = 0.19 for sudden drifts or alpha = 0.13, threshold = 0.26 for gradual ones.
As in the reference, the first chunk is only stored; after a drift the
stored activations are replaced by those of the drifting chunk; the t-test
is the pooled-variance (Student) test, and a test whose two samples are
constant (undefined p-value) is not significant. The drift is reported on
the last observation of the chunk. Rows with missing values are dropped.
reset_state() clears the stored activations and keeps the network.
dfr_padd object. After fit(), drifter_output holds, on the last
observation of every chunk, the fraction of significant tests
(significant), and obj$weights the network.
Komorniczak, J. and Ksieniewicz, P. (2024). Unsupervised concept drift detection based on parallel activations of neural network. arXiv:2404.07776.
library(daltoolbox)
library(heimdall)
set.seed(1)
# 12 chunks of 200 observations; the mean of 3 of the 10 features moves at chunk 7.
x <- matrix(stats::rnorm(2400 * 10), ncol = 10)
x[1201:2400, 1:3] <- x[1201:2400, 1:3] + 1
detector <- dfr_padd(outputs = 12, replications = 12, sample_size = 50,
alpha = 0.07, threshold = 0.19, seed = 1)
model <- fit(detector, as.data.frame(x))
which(!is.na(model$drifter_output$significant) & model$drifter_output$significant > 0.19)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.