https://github.com/deepcharles/ruptures
ruptures: change point detection in Python
https://github.com/deepcharles/ruptures
change-point-detection changepoint python science scientific-computing signal-processing
Last synced: 28 days ago
JSON representation
ruptures: change point detection in Python
- Host: GitHub
- URL: https://github.com/deepcharles/ruptures
- Owner: deepcharles
- License: bsd-2-clause
- Created: 2018-01-20T17:25:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-09-03T21:16:32.000Z (8 months ago)
- Last Synced: 2024-10-29T15:04:50.103Z (6 months ago)
- Topics: change-point-detection, changepoint, python, science, scientific-computing, signal-processing
- Language: Python
- Homepage:
- Size: 10.9 MB
- Stars: 1,613
- Watchers: 29
- Forks: 163
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome_time_series_in_python - ruptures
- awesome-time-series - ruptures - line change point detection. This package provides methods for the analysis and segmentation of non-stationary signals. (📦 Packages / Python)
README
# Welcome to ruptures
[](https://GitHub.com/deepcharles/ruptures/graphs/commit-activity)
[](https://github.com/deepcharles/ruptures/actions/workflows/run-test.yml)

[](https://badge.fury.io/py/ruptures)
[](https://anaconda.org/conda-forge/ruptures)
[](https://github.com/deepcharles/ruptures/actions/workflows/check-docs.yml)

[](https://pepy.tech/project/ruptures)![]()
[](https://mybinder.org/v2/gh/deepcharles/ruptures/master)
[](https://app.codecov.io/gh/deepcharles/ruptures/branch/master)`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]](https://doi.org/10.1016/j.sigpro.2019.107299) [[pdf]](http://www.laurentoudre.fr/publis/TOG-SP-19.pdf)
## Latest news
- Welcome to our new PhD student, [Nicolas Cecchi](https://fr.linkedin.com/in/nicolascecchi/fr)! He will integrate new algorithms in ruptures and create tutorials and illustrative examples.
- NASA uses ruptures! They monitor crops in California and Iran. We submitted an article, let's hope for the best!!
- Jalilvand, E., Kumar, S.V., Haacker, E., Truong, C., Mahanama, S., 2024, Characterizing spatiotemporal variability in irrigation extent and timing through thermal remote sensing, submitted to Remote Sensing of Environment.- We have been contacted by CHELSEA FC to monitor players using ruptures. Stay tuned...
- We use ruptures to understand the regulation of acetylcholine, an important neurotransmitter that plays a role in muscle contraction (involved in myasthenia gravis). Check out our work at the [Journal of Physiology](https://doi.org/10.1113/JP287243)
- They use ruptures to detect changes in classroom engagement and student participation in Japan. [Check out their work](https://doi.org/10.1186/s40561-024-00317-6)
- ruptures is part of a larger pipeline to observe Earth, in particular marine biodiversity. The authors use it to find change in the phytoplankton diversity. [Check out their work](https://doi.org/10.1007/s10712-024-09859-3)
- We work with Croatian crystallographers (hi [Zoran Štefanić](https://www.irb.hr/eng/About-RBI/People/Zoran-Stefanic)!) to [understand protein motions using angular diagrams](https://pubs.acs.org/doi/10.1021/acs.jcim.4c00650). We will keep you posted for our next joint publications.
- [Charles Truong](https://charles.doffy.net) presented ruptures at [PyConDE & PyData Berlin 2024](https://pretalx.com/pyconde-pydata-2024/speaker/BFRLAK/). [Check out the video.](https://kiwi.cmla.ens-cachan.fr/index.php/s/ss3rZwNSKwGtyQW)
## Basic usage
(Please refer to the [documentation](https://centre-borelli.github.io/ruptures-docs/ "Link to 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).
```python
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](https://github.com/deepcharles/ruptures/issues) of the [ruptures repository](https://github.com/deepcharles/ruptures). For other inquiries, you can contact me [here](https://charles.doffy.net/contact/).
#### Important links
- [Documentation](https://centre-borelli.github.io/ruptures-docs)
- [Pypi package index](https://pypi.python.org/pypi/ruptures)#### Dependencies and install
Installation instructions can be found [here](https://centre-borelli.github.io/ruptures-docs/install/).
#### Changelog
See the [changelog](https://github.com/deepcharles/ruptures/blob/master/CHANGELOG.md) for a history of notable changes to `ruptures`.
## Thanks to all our contributors
## License
This project is under BSD license.
```
BSD 2-Clause LicenseCopyright (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.
```