| cpd_ensemble | R Documentation |
cpd_ensemble() groups trained change point models (indid()
with BCE or InDiD loss, tscp2(), ts2vec(), or calibrated ones) into an
ensemble, possibly mixing types; cpd_ensemble_fit() trains the members of
an ensemble of one type. The scores of the members (cpd_scores()) are
aggregated by wwaggr() or monitored on a stream by dfr_wwaggr().
cpd_ensemble(members)
cpd_ensemble_fit(
x,
labels = NULL,
model = c("bce", "indid", "tscp2", "ts2vec"),
n_models = 10,
boot_sample_size = NULL,
seed = NULL,
...
)
members |
A list of trained change point models with the same input features. |
x |
Training sequences, in the formats accepted by |
labels |
Their labels (0/1 matrix |
model |
Type of the members: |
n_models |
Number of members. |
boot_sample_size |
|
seed |
Seed of the ensemble: member |
... |
Settings of the members, passed to |
The paper also compares ensembles trained with stochastic gradient Langevin dynamics; the reference code has no implementation of them and they are not provided.
A cpd_ensemble object (members).
Stepikin, A., Romanenkova, E. and Zaytsev, A. (2025). WWAggr: A window Wasserstein-based aggregation for ensemble change point detection. 2025 IEEE International Conference on Data Mining (ICDM), 1535-1544. doi:10.1109/ICDM65498.2025.00163
set.seed(1)
make <- function(n) {
change <- sample(5:24, n, replace = TRUE)
x <- t(vapply(change, function(c) stats::rnorm(24, ifelse(seq_len(24) < c, 0, 3)), numeric(24)))
list(x = x, labels = t(vapply(change, function(c) (seq_len(24) >= c) * 1, numeric(24))))
}
train <- make(64)
ensemble <- cpd_ensemble_fit(train$x, train$labels, model = "bce", n_models = 3,
epochs = 5, seed = 1)
dim(cpd_scores(ensemble, train$x[1:2, ]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.