knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-" ) library(tsmp)
| | Build | Dev |
|--------------|-------|-----|
| Linux x86_64 | |
|
| OSX |
|
|
| Windows |
|
|
| Coverage |
|
|
R Functions implementing UCR Matrix Profile Algorithm (http://www.cs.ucr.edu/~eamonn/MatrixProfile.html).
This package allows you to use the Matrix Profile concept as a toolkit.
This package provides:
# Basic workflow: matrix <- tsmp(data, window_size = 30) %>% find_motif(n_motifs = 3) %T>% plot() # SDTS still have a unique way to work: model <- sdts_train(data, labels, windows) result <- sdts_predict(model, data, round(mean(windows)))
Please refer to the User Manual for more details.
Please be welcome to suggest improvements.
set.seed(2018) data <- cumsum(sample(c(-1, 1), 40000, TRUE))
w <- 1000 workers <- 8 data_size <- 40000 set.seed(2018) times <- 5L mbm_stomp <- round(median(microbenchmark::microbenchmark(tsmp(data, window_size = w, mode = "stomp", verbose = 0), times = times, setup = (data <- cumsum(sample(c(-1, 1), data_size, TRUE))))$time) / 10^9, 2) mbm_stomp_par <- round(median(microbenchmark::microbenchmark(tsmp(data, window_size = w, mode = "stomp", n_workers = workers, verbose = 0), times = times, setup = (data <- cumsum(sample(c(-1, 1), data_size, TRUE))))$time) / 10^9, 2) mbm_scrimp <- round(median(microbenchmark::microbenchmark(tsmp(data, window_size = w, mode = "scrimp", verbose = 0), times = times, setup = (data <- cumsum(sample(c(-1, 1), data_size, TRUE))))$time) / 10^9, 2) times <- 10L mbm_mpx <- round(median(microbenchmark::microbenchmark(mpx(data, window_size = w), times = times, setup = (data <- cumsum(sample(c(-1, 1), data_size, TRUE))))$time) / 10^9, 2) mbm_mpx_par <- round(median(microbenchmark::microbenchmark(mpx(data, window_size = w, n_workers = workers), times = times, setup = (data <- cumsum(sample(c(-1, 1), data_size, TRUE))))$time) / 10^9, 2) times <- 3L mbm_stamp <- round(median(microbenchmark::microbenchmark(tsmp(data, window_size = w, mode = "stamp", verbose = 0), times = times, setup = (data <- cumsum(sample(c(-1, 1), data_size, TRUE))))$time) / 10^9, 2) mbm_stamp_par <- round(median(microbenchmark::microbenchmark(tsmp(data, window_size = w, mode = "stamp", n_workers = workers, verbose = 0), times = times, setup = (data <- cumsum(sample(c(-1, 1), data_size, TRUE))))$time) / 10^9, 2)
bench_data <- data.frame("Elapsed Time(s)" = c(mbm_stamp, mbm_stamp_par, mbm_stomp, mbm_stomp_par, mbm_scrimp, mbm_mpx, mbm_mpx_par), "Data Size" = data_size, "Window Size" = w, Threads = c(1, workers, 1, workers, 1, 1, workers), Lang = c("R", "R", "R", "R", "R", "Rcpp", "Rcpp"), row.names = c("`stamp`", "`stamp_par`", "`stomp`", "`stomp_par`", "`scrimp`", "`mpx`", "`mpx_par`"), check.names = FALSE) knitr::kable(bench_data[order(bench_data$`Elapsed Time(s)`),])
# Install the released version from CRAN install.packages("tsmp") # Or the development version from GitHub: # install.packages("devtools") devtools::install_github("matrix-profile-foundation/tsmp")
head()
, tail()
, [
, etc.)Our next step unifying the Matrix Profile implementation in several programming languages.
Visit: Matrix Profile Foundation
Please note that the 'tsmp' project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.