In order to allow a meaningful visualization in Multi-Dimensional Space (MDS), this function retrieves the most relevant subsequences using Minimal Description Length (MDL) framework.

salient_subsequences(
  .mp,
  data,
  n_bits = 8,
  n_cand = 10,
  exclusion_zone = NULL,
  verbose = getOption("tsmp.verbose", 2)
)

Arguments

.mp

a TSMP object of class MatrixProfile.

data

the data used to build the Matrix Profile, if not embedded.

n_bits

an int or vector of int. Number of bits for MDL discretization. (Default is 8).

n_cand

an int. number of candidate when picking the subsequence in each iteration. (Default is 10).

exclusion_zone

if a number will be used instead of embedded value. (Default is NULL).

verbose

an int. See details. (Default is 2).

Value

Returns the input .mp object with a new name salient. It contains: indexes, a vector with the starting position of each subsequence, idx_bit_size, a vector with the associated bitsize for each iteration and bits the value used as input on n_bits.

Details

verbose changes how much information is printed by this function; 0 means nothing, 1 means text, 2 adds the progress bar.

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, data, verbose = 0)
# \donttest{
# full example
data <- mp_meat_data$sub$data
w <- mp_meat_data$sub$sub_len
mp <- tsmp(data, window_size = w, verbose = 2, n_workers = 2)
#> 
Computing: [=                                       ] 2%  (~2m26s remaining)       
Computing: [==                                      ] 4%  (~1m14s remaining)       
Computing: [===                                     ] 6%  (~1m33s remaining)       
Computing: [====                                    ] 8%  (~1m11s remaining)       
Computing: [====                                    ] 9%  (~1m20s remaining)       
Computing: [=====                                   ] 11%  (~1m8s remaining)       
Computing: [======                                  ] 13%  (~1m13s remaining)       
Computing: [======                                  ] 15%  (~1m5s remaining)       
Computing: [=======                                 ] 17%  (~1m8s remaining)       
Computing: [========                                ] 19%  (~1m2s remaining)       
Computing: [=========                               ] 21%  (~1m4s remaining)       
Computing: [==========                              ] 23%  (~59s remaining)       
Computing: [==========                              ] 25%  (~1m0s remaining)       
Computing: [===========                             ] 26%  (~56s remaining)       
Computing: [============                            ] 28%  (~56s remaining)       
Computing: [============                            ] 30%  (~53s remaining)       
Computing: [=============                           ] 32%  (~53s remaining)       
Computing: [==============                          ] 34%  (~50s remaining)       
Computing: [===============                         ] 36%  (~50s remaining)       
Computing: [================                        ] 38%  (~47s remaining)       
Computing: [================                        ] 40%  (~46s remaining)       
Computing: [=================                       ] 42%  (~45s remaining)       
Computing: [==================                      ] 43%  (~43s remaining)       
Computing: [==================                      ] 45%  (~42s remaining)       
Computing: [===================                     ] 47%  (~40s remaining)       
Computing: [====================                    ] 49%  (~39s remaining)       
Computing: [=====================                   ] 51%  (~37s remaining)       
Computing: [======================                  ] 53%  (~36s remaining)       
Computing: [======================                  ] 55%  (~34s remaining)       
Computing: [=======================                 ] 57%  (~33s remaining)       
Computing: [========================                ] 58%  (~31s remaining)       
Computing: [========================                ] 60%  (~30s remaining)       
Computing: [=========================               ] 62%  (~28s remaining)       
Computing: [==========================              ] 64%  (~27s remaining)       
Computing: [===========================             ] 66%  (~25s remaining)       
Computing: [============================            ] 68%  (~24s remaining)       
Computing: [============================            ] 70%  (~22s remaining)       
Computing: [=============================           ] 72%  (~21s remaining)       
Computing: [==============================          ] 74%  (~19s remaining)       
Computing: [==============================          ] 75%  (~18s remaining)       
Computing: [===============================         ] 77%  (~17s remaining)       
Computing: [================================        ] 79%  (~15s remaining)       
Computing: [=================================       ] 81%  (~14s remaining)       
Computing: [==================================      ] 83%  (~12s remaining)       
Computing: [==================================      ] 85%  (~11s remaining)       
Computing: [===================================     ] 87%  (~10s remaining)       
Computing: [====================================    ] 89%  (~8s remaining)       
Computing: [=====================================   ] 91%  (~7s remaining)       
Computing: [=====================================   ] 92%  (~5s remaining)       
Computing: [======================================  ] 94%  (~4s remaining)       
Computing: [======================================= ] 96%  (~2s remaining)       
Computing: [========================================] 98%  (~1s remaining)       
Computing: [========================================] 100% (done)                         
#> Finished in 1.27 mins
mps <- salient_subsequences(mp, data, n_bits = c(4, 6, 8), verbose = 2)
#> Finished in 7.19 secs
# }