MyNixOS website logo
Description

Online Time Series Anomaly Detectors.

Implements a set of online fault detectors for time-series, called: PEWMA see M. Carter et al. (2012) <doi:10.1109/SSP.2012.6319708>, SD-EWMA and TSSD-EWMA see H. Raza et al. (2015) <doi:10.1016/j.patcog.2014.07.028>, KNN-CAD see E. Burnaev et al. (2016) <arXiv:1608.04585>, KNN-LDCD see V. Ishimtsev et al. (2017) <arXiv:1706.03412> and CAD-OSE see M. Smirnov (2018) <https://github.com/smirmik/CAD>. The first three algorithms belong to prediction-based techniques and the last three belong to window-based techniques. In addition, the SD-EWMA and PEWMA algorithms are algorithms designed to work in stationary environments, while the other four are algorithms designed to work in non-stationary environments.

otsad

Online Time Series Anomaly Detectors

This package provides anomaly detectors in the context of online time series and their evaluation with the Numenta score.

Installation

Dependencies

CAD-OSE algorithm is implemented in Python. It uses bencode library in the hashing step. This dependency can be installed with the Python package manager pip.

$ sudo pip install bencode-python3

otsad package

You can install the released version of otsad from CRAN with:

# Get the released version from CRAN
install.packages("otsad")

# Get the latest development version from GitHub
devtools::install_github("alaineiturria/otsad")

Most useful functions

Detectors

  • PEWMA
    • Offline: CpPewma
    • Online: IpPewma
  • SD-EWMA
    • Offline: CpSdEwma
    • Online: IpSdEwma
  • TSSD-EWMA
    • Offline: CpTsSdEwma
    • Online: IpTsSdEwma
  • KNN-ICAD
    • Offline: CpKnnCad(ncm.type = "ICAD")
    • Online: IpKnnCad(ncm.type = "ICAD")
  • KNN-LDCD
    • Offline CpKnnCad(ncm.type = "LDCD")
    • Online: IpKnnCad(ncm.type = "LDCD")
  • CAD-OSE
    • Offline and Online: ContextualAnomalyDetector

NAB score

  • Get score: GetDetectorScore
  • Normalize score: NormalizeScore + GetNullAndPerfectScores

False Positve Reduction

  • Offline and Online: ReduceAnomalies

Static or interactive visualizations

  • Offline: PlotDetections

NOTE:As usual in R, the documentation pages for each function can be loaded from the command line with the commands ? or help:

?CpSdEwma
help(CpSdEwma)

Example

This is a basic example of the use of otsad package:

library(otsad)

## basic example code

# Generate data
set.seed(100)
n <- 500
x <- sample(1:100, n, replace = TRUE)
x[70:90] <- sample(110:115, 21, replace = TRUE) # distributional shift
x[25] <- 200 # abrupt transient anomaly
x[320] <- 170 # abrupt transient anomaly
df <- data.frame(timestamp = 1:n, value = x)

# Apply classic processing SD-EWMA detector
result <- CpSdEwma(data = df$value, n.train = 5, threshold = 0.01, l = 3)
res <- cbind(df, result)
PlotDetections(res, title = "SD-EWMA ANOMALY DETECTOR", return.ggplot = TRUE)

See plotly interactive graph

For more details, see otsad documentation and vignettes.

Metadata

Version

0.2.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows