Skip to main content
QUICK REVIEW

[Paper Review] ruptures: change point detection in Python

Charles Truong, Laurent Oudre|arXiv (Cornell University)|Jan 2, 2018
Statistical Methods and InferenceMathematics10 references19 citations
TL;DR

ruptures is a comprehensive, modular Python library for offline multiple change point detection in univariate and multivariate signals. It provides a consistent, easy-to-use interface with support for parametric and non-parametric cost functions, multiple optimization methods (e.g., dynamic programming, binary segmentation), and flexible regularization, enabling fast, reproducible analysis of non-stationary time series across diverse applications.

ABSTRACT

ruptures is a Python library for offline 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.

Motivation & Objective

  • To address the growing need for accessible, fast, and extensible tools for detecting changes in non-stationary signals across domains such as finance, bioinformatics, and system monitoring.
  • To provide a unified, consistent, and well-documented interface that lowers the barrier to entry for non-experts while supporting advanced users.
  • To enable seamless integration and extension of new algorithms and cost functions through a modular software architecture.
  • To support both exact and approximate detection methods under various constraints (e.g., fixed number of change points, cost budget, penalty terms).

Proposed method

  • The library implements a general optimization framework where change point detection is formulated as minimizing a contrast function $ V(\mathbf{t}, y) = \sum_{i} c(\{y_t\}_{t_i+1}^{t_{i+1}}) + \text{pen}(\mathbf{t}) $, with $ c $ as a cost function and $ \text{pen} $ as a regularization term.
  • It supports multiple search algorithms: dynamic programming (exact), binary segmentation, bottom-up segmentation, window-based segmentation, and $ l_0 $-constrained detection.
  • Cost functions include parametric models (e.g., for mean, scale, linear relationship, autoregressive coefficients) and non-parametric models (e.g., kernel-based or Mahalanobis-type metrics for distribution shifts).
  • The library uses Numpy arrays as input and integrates with Scipy for efficient numerical operations, with Matplotlib for visualization and Pytest for unit testing.
  • A caching mechanism is implemented to speed up repeated runs with different parameters on the same signal, and sub-sampling and minimum distance constraints are supported for scalability.
  • The modular design allows users to plug in custom cost functions and optimization methods by adhering to a standardized interface.

Experimental results

Research questions

  • RQ1How can a unified, user-friendly, and extensible Python library for change point detection be designed to support both non-experts and advanced users?
  • RQ2What combination of optimization methods and cost functions enables robust detection of diverse change types (e.g., mean shifts, scale changes, distributional shifts) in multivariate signals?
  • RQ3To what extent can modularity and caching improve performance and usability in iterative signal exploration workflows?
  • RQ4How does the integration of both exact and approximate algorithms in a single framework enhance the practical applicability of change point detection?
  • RQ5Can a single library effectively support a broad range of change detection tasks beyond simple mean shifts, including non-parametric and multivariate changes?

Key findings

  • ruptures is the first comprehensive Python library dedicated to multiple change point detection, offering a unified framework that integrates multiple algorithms and cost functions not previously available in a single Python package.
  • The library supports both parametric and non-parametric cost functions, enabling detection of changes in mean, variance, linear relationships, autoregressive parameters, and distributional shifts.
  • The use of dynamic programming ensures exact detection for small to moderate signal sizes, while approximate methods like binary segmentation and window-based segmentation allow scalable analysis on longer signals.
  • The modular architecture enables seamless integration of new algorithms and cost functions, reducing implementation overhead and promoting reproducibility and extensibility.
  • Caching and sub-sampling features significantly reduce computational cost during parameter tuning, enhancing usability in exploratory data analysis.
  • The library is available under the BSD license, with full documentation and support for cross-platform use (Windows, Linux, macOS), ensuring broad accessibility and integration into scientific workflows.

Better researchstarts right now

From reading papers to final review, dramatically reduce your research time.

No credit card · Free plan available

This review was created by AI and reviewed by human editors.