Skip to main content

Change point detection for signals in Python.

Project description

Welcome to ruptures

Maintenance build python PyPI version Conda Version docs PyPI - License Downloads Code style: black Binder Codecov

ruptures is a Python library for off-line change point detection. This package provides methods for the analysis and segmentation of non-stationary signals. Implemented algorithms include exact and approximate detection for various parametric and non-parametric models. ruptures focuses on ease of use by providing a well-documented and consistent interface. In addition, thanks to its modular structure, different algorithms and models can be connected and extended within this package.

How to cite. If you use ruptures in a scientific publication, we would appreciate citations to the following paper:

  • C. Truong, L. Oudre, N. Vayatis. Selective review of offline change point detection methods. Signal Processing, 167:107299, 2020. [journal] [pdf]

Basic usage

(Please refer to the documentation for more advanced use.)

The following snippet creates a noisy piecewise constant signal, performs a penalized kernel change point detection and displays the results (alternating colors mark true regimes and dashed lines mark estimated change points).

import matplotlib.pyplot as plt
import ruptures as rpt

# generate signal
n_samples, dim, sigma = 1000, 3, 4
n_bkps = 4  # number of breakpoints
signal, bkps = rpt.pw_constant(n_samples, dim, n_bkps, noise_std=sigma)

# detection
algo = rpt.Pelt(model="rbf").fit(signal)
result = algo.predict(pen=10)

# display
rpt.display(signal, bkps, result)
plt.show()

General information

Contact

Concerning this package, its use and bugs, use the issue page of the ruptures repository. For other inquiries, you can contact me here.

Important links

Dependencies and install

Installation instructions can be found here.

Changelog

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

Thanks to all our contributors

License

This project is under BSD license.

BSD 2-Clause License

Copyright (c) 2017-2022, 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

ruptures-1.1.9.tar.gz (308.1 kB view hashes)

Uploaded Source

Built Distributions

ruptures-1.1.9-cp312-cp312-win_amd64.whl (474.0 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

ruptures-1.1.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

ruptures-1.1.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

ruptures-1.1.9-cp312-cp312-macosx_10_9_x86_64.whl (491.7 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

ruptures-1.1.9-cp311-cp311-win_amd64.whl (473.1 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

ruptures-1.1.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

ruptures-1.1.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.3 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

ruptures-1.1.9-cp311-cp311-macosx_10_9_x86_64.whl (489.1 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

ruptures-1.1.9-cp310-cp310-win_amd64.whl (473.0 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

ruptures-1.1.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

ruptures-1.1.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

ruptures-1.1.9-cp310-cp310-macosx_10_9_x86_64.whl (489.5 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

ruptures-1.1.9-cp39-cp39-win_amd64.whl (474.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

ruptures-1.1.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

ruptures-1.1.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

ruptures-1.1.9-cp39-cp39-macosx_10_9_x86_64.whl (490.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

ruptures-1.1.9-cp38-cp38-win_amd64.whl (474.3 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

ruptures-1.1.9-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

ruptures-1.1.9-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ ARM64

ruptures-1.1.9-cp38-cp38-macosx_10_9_x86_64.whl (489.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

ruptures-1.1.9-cp37-cp37m-win_amd64.whl (473.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

ruptures-1.1.9-cp37-cp37m-win32.whl (449.6 kB view hashes)

Uploaded CPython 3.7m Windows x86

ruptures-1.1.9-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

ruptures-1.1.9-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.2 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ ARM64

ruptures-1.1.9-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ruptures-1.1.9-cp37-cp37m-macosx_10_9_x86_64.whl (490.1 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

ruptures-1.1.9-cp36-cp36m-win_amd64.whl (495.3 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

ruptures-1.1.9-cp36-cp36m-win32.whl (462.3 kB view hashes)

Uploaded CPython 3.6m Windows x86

ruptures-1.1.9-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

ruptures-1.1.9-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ ARM64

ruptures-1.1.9-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (1.1 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ i686 manylinux: glibc 2.5+ i686

ruptures-1.1.9-cp36-cp36m-macosx_10_9_x86_64.whl (486.4 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

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