Skip to main content

A change point detection package

Project description

Roerich

roerich is a library for online and offline change point detection. Currently, it implements algorithms based on direct density estimation from this article:

Hushchyn, Mikhail, and Andrey Ustyuzhanin. ‘Generalization of Change-Point Detection in Time Series Data Based on Direct Density Ratio Estimation’. ArXiv:2001.06386 [Cs, Stat], Jan. 2020. arXiv.org, http://arxiv.org/abs/2001.06386.

Dependencies and install

Basic usage

Make sure that your data has a shape (seq_len, n_dims) or you can generate synthetic data:

import numpy as np
import roerich

X, label = roerich.generate_dataset(period=2000, N_tot=20000)
T = np.arange(len(X))

You can use two algorithms: CLF or RuLSIF:

cpd = roerich.OnlineNNClassifier(net='default', scaler="default", metric="KL_sym",
                  periods=1, window_size=10, lag_size=500, step=10, n_epochs=10,
                  lr=0.1, lam=0.0001, optimizer="Adam"
                 )

# Detect change points
score, peaks = cpd.predict(X)

For data visualization use:

roerich.display(X, T, label, score, T, peaks)

Changelog

See the changelog for a history of notable changes to roerich.

Thanks to all our contributors

License

BSD 2-Clause License

Copyright (c) 2017, ENS Paris-Saclay, CNRS
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

roerich-0.1.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

roerich-0.1-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file roerich-0.1.tar.gz.

File metadata

  • Download URL: roerich-0.1.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for roerich-0.1.tar.gz
Algorithm Hash digest
SHA256 35cf4871715a2358552cf90075191d927d84ec0aec66dc7db95aa719d40c15f3
MD5 e47da325d7f0e74cc9a1978b912083fd
BLAKE2b-256 0112c1311e8b1220fde6fee037a80cb49d0dfaee69a89951407b68b4255114d7

See more details on using hashes here.

File details

Details for the file roerich-0.1-py3-none-any.whl.

File metadata

  • Download URL: roerich-0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for roerich-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20f210f5197b9c3e81d583ba6f8c76fc635200fedab0f885d983cb6e065d2aa4
MD5 34270ce2834059745b9214f8205fc841
BLAKE2b-256 f3c601951b6cd8bd84db88c6ab6e3c0531d313c00d85826d92413e48b9e0419b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page