Skip to content

Commit

Permalink
Finish v0.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
franzbischoff committed Oct 23, 2018
2 parents 8fea7ce + a60bead commit dca9924
Show file tree
Hide file tree
Showing 56 changed files with 143 additions and 64 deletions.
77 changes: 77 additions & 0 deletions API-v0.3.2
Original file line number Diff line number Diff line change
@@ -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>%
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CONTRIBUTING
================
Francisco Bischoff
\- 16 Oct 2018
\- 23 Oct 2018

<!-- CONTRIBUTING.md is generated from CONTRIBUTING.Rmd Please edit that file -->

Expand Down
4 changes: 2 additions & 2 deletions CRAN-RELEASE
Original file line number Diff line number Diff line change
@@ -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).
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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")),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
NEWS
================
Francisco Bischoff
\- 16 Oct 2018
\- 23 Oct 2018

<!-- NEWS.md is generated from NEWS.Rmd. Please edit that file -->

Expand Down
15 changes: 10 additions & 5 deletions R/sdts-train.R
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -125,15 +130,15 @@ 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")
}

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
}
Expand Down
1 change: 0 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
README
================
Francisco Bischoff
\- 16 Oct 2018
\- 23 Oct 2018

<!-- README.md is generated from README.Rmd. Please edit that file -->

Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/press.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/as.matrixprofile.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/av_apply.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/av_complexity.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/av_hardlimit_artifact.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/av_motion_artifact.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/av_stop_word.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/av_zerocrossing.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fast_movavg.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fast_movsd.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/find_chains.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/find_motif.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fluss.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fluss_cac.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/fluss_extract.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dca9924

Please sign in to comment.