diff --git a/API-v0.3.2 b/API-v0.3.2 new file mode 100644 index 0000000..a617fb3 --- /dev/null +++ b/API-v0.3.2 @@ -0,0 +1,77 @@ +# API for tsmp package + +## Exported functions + +as.arccount(.mp) +as.chain(.mp) +as.fluss(.mp) +as.matrixprofile(.mp) +as.motif(.mp) +as.multimatrixprofile(.mp) +as.multimotif(.mp) +as.salient(.mp) +av_apply(.mp) +av_complexity(.mp, data, dilution_factor = 0, apply = FALSE) +av_hardlimit_artifact(.mp, data, apply = FALSE) +av_motion_artifact(.mp, data, apply = FALSE) +av_stop_word(.mp, data, stop_word_loc, exclusion_zone = NULL, threshold = 0.1, apply = FALSE) +av_zerocrossing(.mp, data, apply = FALSE) +fast_movavg(data, window_size) +fast_movsd(data, window_size) +find_chains(.mp) +find_motif(.mp, ...) +fluss(.mp, num_segments, exclusion_zone = NULL) +fluss_cac(.mp, exclusion_zone = NULL) +fluss_extract(.mpac, num_segments, exclusion_zone = NULL) +fluss_score(gtruth, extracted, data_size) +get_data(.mp) +mass(data_fft, query_window, data_size, window_size, data_mean, data_sd, query_mean, query_sd) +mass_pre(data, data_size, query = NULL, query_size = NULL, window_size) +mstomp(data, window_size, exclusion_zone = 1/2, verbose = 2, must_dim = NULL, exc_dim = NULL) +mstomp_par(data, window_size, exclusion_zone = 1/2, verbose = 2, must_dim = NULL, exc_dim = NULL, n_workers = 2) +plot_arcs(pairs, alpha = NULL, quality = 30, lwd = 15, col = c("blue", "orange"), main = "Arc Plot", ylab, xlab = "Profile Index", ...) +salient_mds(.mp, data, bit_idx = 1) +salient_score(.mp, gtruth) +salient_subsequences(.mp, data, n_bits = 8, n_cand = 10, exclusion_zone = NULL, verbose = 2) +scrimp(..., window_size, exclusion_zone = 1/2, verbose = 2, s_size = Inf, pre_scrimp = 1/4) +sdts_predict(model, data, window_size) +sdts_score(pred, gtruth, beta = 1) +sdts_train(data, label, window_size, beta = 1, pat_max = Inf, parallel = TRUE, verbose = 2) +set_data(.mp, data) +simple_fast(..., window_size, exclusion_zone = 1/2, verbose = 2) +stamp(..., window_size, exclusion_zone = 1/2, verbose = 2, s_size = Inf) +stamp_par(..., window_size, exclusion_zone = 1/2, verbose = 2, s_size = Inf, n_workers = 2) +stomp(..., window_size, exclusion_zone = 1/2, verbose = 2) +stomp_par(..., window_size, exclusion_zone = 1/2, verbose = 2, n_workers = 2) +tsmp(..., window_size, exclusion_zone = 1/2, mode = c("stomp", "stamp", "simple", "mstomp", "scrimp"), verbose = 2, s_size = Inf, must_dim = NULL, exc_dim = NULL, n_workers = 1, .keep_data = TRUE) + +## Own S3 methods + +find_motif.MatrixProfile(.mp, data, n_motifs = 3, n_neighbors = 10, radius = 3, exclusion_zone = NULL, ...) +find_motif.MultiMatrixProfile(.mp, data, n_motifs = 3, mode = c("guided", "unconstrained"), n_bit = 4, exclusion_zone = NULL, n_dim = NULL, ...) + +## Foreign S3 methods + +plot.ArcCount(x, data, type = c("data", "matrix"), exclusion_zone = NULL, edge_limit = NULL, threshold = stats::quantile(x$cac, 0.1), main = "Arcs Discover", xlab = "index", ylab, ...) +plot.Chain(x, data, type = c("data", "matrix"), main = "Chain Discover", xlab = "index", ylab, ...) +plot.Fluss(x, data, type = c("data", "matrix"), main = "Fast Low-cost Unipotent Semantic Segmentation", xlab = "index", ylab, ...) +plot.MatrixProfile(x, ylab = "distance", xlab = "index", main = "Unidimensional Matrix Profile", ...) +plot.Motif(x, data, type = c("data", "matrix"), ncol = 3, main = "MOTIF Discover", xlab = "index", ylab, ...) +plot.MultiMatrixProfile(x, ylab = "distance", xlab = "index", main = "Multidimensional Matrix Profile", ...) +plot.MultiMotif(x, data, type = c("data", "matrix"), ncol = 3, main = "Multidimensional MOTIF Discover", xlab = "index", ylab, ...) +plot.Salient(x, data, main = "Salient Subsections", xlab = "index", ylab, ...) +plot.SimpleMatrixProfile(x, ylab = "distance", xlab = "index", main = "SiMPle Matrix Profile", ...) +print.ArcCount(x, ...) +print.Chain(x, ...) +print.Fluss(x, ...) +print.MatrixProfile(x, ...) +print.Motif(x, ...) +print.MultiMatrixProfile(x, ...) +print.MultiMotif(x, ...) +print.Salient(x, ...) +print.SimpleMatrixProfile(x, ...) + +## Reexported objects + +::%>% +::%T>% diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7a6ce3d..e8e586c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,7 @@ CONTRIBUTING ================ Francisco Bischoff -\- 16 Oct 2018 +\- 23 Oct 2018 diff --git a/CRAN-RELEASE b/CRAN-RELEASE index fc44cc3..d9edbc1 100644 --- a/CRAN-RELEASE +++ b/CRAN-RELEASE @@ -1,2 +1,2 @@ -This package was submitted to CRAN on 2018-09-10. -Once it is accepted, delete this file and tag the release (commit 4801b48199). +This package was submitted to CRAN on 2018-10-23. +Once it is accepted, delete this file and tag the release (commit 0e7131cff8). diff --git a/DESCRIPTION b/DESCRIPTION index 6b810ad..537a5c6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: tsmp Type: Package Title: Time Series with Matrix Profile -Version: 0.3.1.9031 +Version: 0.3.2 Authors@R: c( person("Francisco", "Bischoff", email = "fbischoff@med.up.pt", role = c("aut", "cre"), comment = c(ORCID = "https://orcid.org/0000-0002-5301-8672")), diff --git a/NEWS.md b/NEWS.md index d01da8e..d791bac 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,7 +1,7 @@ NEWS ================ Francisco Bischoff -\- 16 Oct 2018 +\- 23 Oct 2018 diff --git a/R/sdts-train.R b/R/sdts-train.R index dcbece2..ad9ebd5 100644 --- a/R/sdts-train.R +++ b/R/sdts-train.R @@ -92,12 +92,17 @@ sdts_train <- function(data, label, window_size, beta = 1, pat_max = Inf, parall } pos <- unlist(pos) - pos_alt_st <- which(is.infinite(pos)) + 1 + pos_alt_st <- list() + for (i in 1:n_window_size) { + pos_alt_st[[i]] <- which(is.infinite(pos)) + 1 + max_pos_idx <- pos_alt_st[[i]] > (length(pos) - window_size[i] + 1) + pos_alt_st[[i]][max_pos_idx] <- (length(pos) - window_size[i] + 1) + } + pos_alt_ed <- which(is.infinite(pos)) - 1 pos_alt_ed <- c(pos_alt_ed[-1], length(pos)) - max_pos_idx <- pos_alt_st > (length(pos) - max(window_size) + 1) - pos_alt_st[max_pos_idx] <- (length(pos) - max(window_size) + 1) + # run matrix profile on concatenated positive segment ---- if (verbose > 0) { @@ -125,7 +130,7 @@ sdts_train <- function(data, label, window_size, beta = 1, pat_max = Inf, parall candi_dist <- rep(0, n_pos) for (j in 1:n_pos) { - temp <- mat_pro[[i]][pos_alt_st[j]:max(pos_alt_st[j], (pos_alt_ed[j] - window_size[i] + 1), na.rm = TRUE)] + temp <- mat_pro[[i]][pos_alt_st[[i]][j]:max(pos_alt_st[[i]][j], (pos_alt_ed[j] - window_size[i] + 1), na.rm = TRUE)] rlt_idx <- which.min(temp) if (length(temp[rlt_idx]) == 0) { print("Zero") @@ -133,7 +138,7 @@ sdts_train <- function(data, label, window_size, beta = 1, pat_max = Inf, parall candi_dist[j] <- temp[rlt_idx] - alt_idx <- pos_alt_st[j] + rlt_idx - 1 + alt_idx <- pos_alt_st[[i]][j] + rlt_idx - 1 candi[[i]][[j]] <- pos[alt_idx:(alt_idx + window_size[i] - 1)] candi_idx[[i]][j] <- pos_st[j] + rlt_idx - 1 } diff --git a/README.Rmd b/README.Rmd index 72c2bd1..601bd3e 100644 --- a/README.Rmd +++ b/README.Rmd @@ -113,7 +113,6 @@ devtools::install_github("franzbischoff/tsmp") ## Roadmap -* MOTIFs under Uniform Scaling * Exact Detection of Variable Length Motifs * Profile-Based Shapelet Discovery * GPU-STOMP diff --git a/README.md b/README.md index f1e8c55..6799ac2 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ README ================ Francisco Bischoff -\- 16 Oct 2018 +\- 23 Oct 2018 @@ -109,7 +109,6 @@ devtools::install_github("franzbischoff/tsmp") ## Roadmap - - MOTIFs under Uniform Scaling - Exact Detection of Variable Length Motifs - Profile-Based Shapelet Discovery - GPU-STOMP diff --git a/docs/CODE_OF_CONDUCT.html b/docs/CODE_OF_CONDUCT.html index af3d60f..3a21a30 100644 --- a/docs/CODE_OF_CONDUCT.html +++ b/docs/CODE_OF_CONDUCT.html @@ -61,7 +61,7 @@ tsmp - 0.3.1.9031 + 0.3.2 diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index 086546b..05617d0 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -61,7 +61,7 @@ tsmp - 0.3.1.9031 + 0.3.2 @@ -117,7 +117,7 @@

CONTRIBUTING

-

Francisco Bischoff - 16 Oct 2018

+

Francisco Bischoff - 23 Oct 2018

diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 2e68de3..568353f 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -61,7 +61,7 @@ tsmp - 0.3.1.9031 + 0.3.2

diff --git a/docs/articles/index.html b/docs/articles/index.html index aad41c0..756d27c 100644 --- a/docs/articles/index.html +++ b/docs/articles/index.html @@ -61,7 +61,7 @@ tsmp - 0.3.1.9031 + 0.3.2
diff --git a/docs/articles/press.html b/docs/articles/press.html index e75454e..936d0a1 100644 --- a/docs/articles/press.html +++ b/docs/articles/press.html @@ -30,7 +30,7 @@ tsmp - 0.3.1.9031 + 0.3.2 @@ -83,7 +83,7 @@

Time Series with Matrix Profile

Francisco Bischoff

-

2018-10-16

+

2018-10-23

Source: vignettes/press.Rmd diff --git a/docs/authors.html b/docs/authors.html index 1f3d805..fe6652b 100644 --- a/docs/authors.html +++ b/docs/authors.html @@ -61,7 +61,7 @@ tsmp - 0.3.1.9031 + 0.3.2 diff --git a/docs/index.html b/docs/index.html index 60b8ad9..6f2cdaf 100644 --- a/docs/index.html +++ b/docs/index.html @@ -30,7 +30,7 @@ tsmp - 0.3.1.9031 + 0.3.2 @@ -233,7 +233,6 @@

Roadmap