| dfr_ensemble | R Documentation |
Combines the detections of several drift detectors by voting (Giusti Tavares et al., 2025). At every time step the vote is the sum of the members' scores, and the ensemble reports a drift when the vote passes the voting rule:
"efer" (early find, early report): vote >= 1;
"majority": vote > n / 2 (n members);
"threshold": vote >= threshold.
With tolerance k <= 1 the scores are crisp: 1 when the member detects a
drift at that time step, 0 otherwise (crisp ensemble drift detector, CEDD).
With k > 1 they are fuzzy (fuzzy ensemble drift detector, FEDD). A detection
at time d gives time t the score 1 - |t - d| / k when |t - d| < k. A
member's score is the largest over its detections. So detections that are
close in time but not simultaneous can still add up to a majority.
dfr_ensemble(
drifter_list,
voting = c("majority", "efer", "threshold"),
threshold = NULL,
tolerance = 0,
lookahead = TRUE
)
drifter_list |
Named list of drifters ( |
voting |
Voting rule: |
threshold |
Vote needed by the |
tolerance |
Time tolerance k of the fuzzy scores; |
lookahead |
With fuzzy scores, |
The combination follows the reference code
(https://github.com/cefet-rj-dal/reproduce, fedd/core/4-ensemble-fuzzy.R,
with the triangular fuzzification of harbinger):
The majority rule is strict, vote > n / 2 (the paper writes vote >= the ceiling of n / 2).
After a fuzzy ensemble drift at time t, the detections before t are forgotten. Each member with a positive score at t also loses its first detection at or after t, or its next detection if none has arrived yet. So one detection does not raise a second ensemble drift.
The scores are (k - j) * (1 / k) at distance j, as in
harbinger. The paper's Equation 3 prints |t - t'| / k, which would give
0 at the detection itself.
Members with a target_feat receive that column of each row, the other
univariate members the row mean, and multivariate members the row (as
dfr_multi_criteria()). The members are not reset by the ensemble. The
paper's members are also run as separate detectors, each with its own warm-up
and normalisation, before the vote.
ensemble_vote() applies the same voting to detection series computed
beforehand.
dfr_ensemble object. After fit(), drifter_output holds, on
every observation, the decision of each member, the time step whose vote was
decided (time) and the vote (vote). obj$events holds the time steps of
the ensemble drifts, including those decided when the stream ended.
Giusti Tavares, L., Lima, J., Melo, M., Chen, C., Garibaldi, J., Scatena, G. S., Costa, A. H. R., Gomi, E. S., Salles, R., Pacitti, E., Santos, I., Siqueira, I. G., Carvalho, D., Coutinho, R., Porto, F. and Ogasawara, E. (2025). Fuzzy-based ensemble method for robust concept drift detection in multivariate time series. 2025 International Joint Conference on Neural Networks (IJCNN). doi:10.1109/IJCNN64981.2025.11228919
ensemble_vote(), dfr_multi_criteria().
library(daltoolbox)
library(heimdall)
set.seed(1)
data <- data.frame(serie = c(stats::rnorm(500), stats::rnorm(500, 3)))
members <- list(ph = dfr_page_hinkley(), kswin = dfr_kswin(), adwin = dfr_adwin())
# Crisp majority: the members must agree on the same observation.
crisp <- fit(dfr_ensemble(members, voting = "majority"), data)
crisp$events
# Fuzzy majority with a tolerance of 50 observations.
fuzzy <- fit(dfr_ensemble(members, voting = "majority", tolerance = 50), data)
fuzzy$events
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.