Skip to main content

Change point detection.

Project description

Welcome to Roerich

PyPI version Documentation Downloads License

Roerich is a python library for online and offline change point detection for time series analysis, signal processing, and segmentation. It was named after the painter Nicholas Roerich, known as the Master of the Mountains. Read more at: https://www.roerich.org.

Fragment of "Himalayas", 1933

Currently, the library contains official implementations of change point detection algorithms based on direct density ratio estimation from the following articles:

  • Mikhail Hushchyn and Andrey Ustyuzhanin. “Generalization of Change-Point Detection in Time Series Data Based on Direct Density Ratio Estimation.” J. Comput. Sci. 53 (2021): 101385. [journal] [arxiv]
  • Mikhail Hushchyn, Kenenbek Arzymatov and Denis Derkach. “Online Neural Networks for Change-Point Detection.” ArXiv abs/2010.01388 (2020). [arxiv]

Dependencies and install

pip install roerich

or

git clone https://github.com/HSE-LAMBDA/roerich.git
cd roerich
pip install -e .

Basic usage

(See more examples in the documentation.)

The following code snippet generates a noisy synthetic data, performs change point detection, and displays the results. If you use own dataset, make sure that it has a shape (seq_len, n_dims).

import roerich
from roerich.change_point import ChangePointDetectionClassifier

# generate time series
X, cps_true = roerich.generate_dataset(period=200, N_tot=2000)

# detection
# base_classifier = 'logreg', 'qda', 'dt', 'rf', 'mlp', 'knn', 'nb'
# metric = 'klsym', 'pesym', 'jsd', 'mmd', 'fd'
cpd = ChangePointDetectionClassifier(base_classifier='mlp', metric='klsym', window_size=100)
score, cps_pred = cpd.predict(X)

# visualization
roerich.display(X, cps_true, score, cps_pred)

Support

Related libraries

Generic badge Generic badge Generic badge Generic badge

Thanks to all our contributors

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.6.0.tar.gz (22.8 kB view details)

Uploaded Source

Built Distribution

roerich-0.6.0-py3-none-any.whl (36.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: roerich-0.6.0.tar.gz
  • Upload date:
  • Size: 22.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for roerich-0.6.0.tar.gz
Algorithm Hash digest
SHA256 10ae9791adfb4fa0d6f83261b7895c1fd45745342c14d5fef7b3d5bcbf40569c
MD5 21316f4824ddd4738de56563009061e1
BLAKE2b-256 24473937b28ea505a13e813260803544bcc404497bcaac4be3e1b74c447cc361

See more details on using hashes here.

File details

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

File metadata

  • Download URL: roerich-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 36.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for roerich-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5e28671f200b2d095e9b01be51bb00217c6ecfb877d42437e7e8bf0a60808280
MD5 0f3583f0acc6516c541e4003d15baa7a
BLAKE2b-256 10d96f2b634558bc3d2bbab7cfc3fec76f1819cf21ddcc1c794f50d7734e112b

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