| cpd_scores | R Documentation |
Scores in [0, 1] of every time step of every sequence: the
probability of change of an indid() model, or the processed similarity of
consecutive windows of a tscp2() or ts2vec() model. For calibrated
models (cpd_calibrate()) the calibrated scores, and for ensembles
(cpd_ensemble()) the scores of every member.
cpd_scores(model, x, ...)
model |
A model: |
x |
Sequences, in the formats accepted by |
... |
Unused. |
A matrix [sequence, time]; for an ensemble an array
[member, sequence, time]. The representation models (TS-CP2 and
SN-TS2Vec) have no score for the first 2 * window - 1 steps (NA).
set.seed(1)
# 8 sequences of 12 steps with 2 features; the mean moves at step 7.
x <- array(stats::rnorm(8 * 12 * 2), c(8, 12, 2))
x[, 7:12, ] <- x[, 7:12, ] + 3
model <- ts2vec(x, window = 3, output_dim = 4, hidden_dim = 8, depth = 2, epochs = 5, seed = 1)
round(cpd_scores(model, x[1:2, , ]), 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.