salient_score: Computes the F-Score of salient algorithm.

View source: R/salient.R

salient_scoreR Documentation

Computes the F-Score of salient algorithm.

Description

This score function is useful for testing several values of n_bits for MDL discretization and checking against a known set of indexes. This increase the probability of better results on relevant subsequence extraction.

Usage

salient_score(.mp, gtruth, verbose = getOption("tsmp.verbose", 2))

Arguments

.mp

a Matrix Profile object.

gtruth

a vector of integers with the indexes of relevant subsequences.

verbose

an int. (Default is 2).

Value

Returns a list with f_score, precision, recall and bits used in the algorithm.

References

  • Yeh CCM, Van Herle H, Keogh E. Matrix profile III: The matrix profile allows visualization of salient subsequences in massive time series. Proc - IEEE Int Conf Data Mining, ICDM. 2017;579-88.

  • Hu B, Rakthanmanon T, Hao Y, Evans S, Lonardi S, Keogh E. Discovering the Intrinsic Cardinality and Dimensionality of Time Series Using MDL. In: 2011 IEEE 11th International Conference on Data Mining. IEEE; 2011. p. 1086-91.

Website: https://sites.google.com/site/salientsubs/

Examples

# toy example
data <- mp_toy_data$data[, 1]
mp <- tsmp(data, window_size = 30, verbose = 0)
mps <- salient_subsequences(mp, n_bits = c(4, 6, 8), verbose = 0)
label_idx <- seq(2, 500, by = 110) # fake data
salient_score(mps, label_idx, verbose = 0)

tsmp documentation built on Aug. 21, 2022, 1:13 a.m.