Skip to content

[ENH] Implement PELTSegmenter for optimal time series changepoint detection - #3969

Open
shivamkumxr wants to merge 7 commits into
aeon-toolkit:mainfrom
shivamkumxr:feature/pelt-segmenter
Open

shivamkumxr wants to merge 7 commits into
aeon-toolkit:mainfrom
shivamkumxr:feature/pelt-segmenter

Conversation

@shivamkumxr

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Closes #3948

What does this implement/fix? Explain your changes.

Adds PELTSegmenter under aeon.segmentation based on Killick et al. (2012).

Summary of changes:

  • Implemented PELTSegmenter on top of BaseSegmenter.
  • Uses prefix sums to compute segment costs in $O(1)$ time with NumPy.
  • Added pruning step to discard candidate changepoints as the series is traversed.
  • Supported costs: L2 (mean shifts) and Gaussian log-likelihood (mean + variance shifts).
  • Penalty can be passed directly as a float or chosen via 'bic' / 'aic'.
  • Works on multivariate series by computing costs across channels.
  • Added tests in test_pelt.py and patched _yield_segmentation_checks.py to handle empty changepoint edge cases during generic estimator checks.

Does your contribution introduce a new dependency? If yes, which one?

No.

PR checklist

  • The PR title starts with [ENH].
  • Added PELTSegmenter to API documentation (docs/api_reference/segmentation.rst).
  • Added unit tests (test_pelt.py) and docstrings following numpydoc standards.
  • Verified compatibility with check_estimator(PELTSegmenter).

@aeon-actions-bot aeon-actions-bot Bot added enhancement New feature, improvement request or other non-bug code enhancement segmentation Segmentation package testing Testing related issue or pull request labels Oct 27, 2026
@aeon-actions-bot

Copy link
Copy Markdown
Contributor

Thank you for contributing to aeon

I have added the following labels to this PR based on the title: enhancement.
I have added the following labels to this PR based on the changes made: segmentation testing. Feel free to change these if they do not properly represent the PR.

The Checks tab will show the status of our automated tests. You can click on individual test runs in the tab or "Details" in the panel below to see more information if there is a failure.

If our pre-commit code quality check fails, please run pre-commit locally and push the fixes to your PR branch.

Don't hesitate to ask questions on the aeon Discord channel if you have any.

PR CI actions

These checkboxes will add labels to enable or disable CI functionality for this PR. This may not take effect immediately, and a new commit may be required to run the new configuration.

  • Run pre-commit checks for all files
  • Run mypy typecheck tests
  • Run all pytest tests and configurations
  • Run all notebook example tests
  • Run numba-disabled codecov tests
  • Disable numba cache loading
  • Regenerate expected results for testing
  • Push an empty commit to re-run CI checks

@baraline baraline left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a correctness review, only looked at testing side, some functions to move.

Comment thread aeon/segmentation/tests/test_pelt.py Resolved

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature, improvement request or other non-bug code enhancement segmentation Segmentation package testing Testing related issue or pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ENH] Implement native PELT (Pruned Exact Linear Time) segmentation estimator

2 participants