Skip to content

[BUG] Fix LeftSTAMPi predict() returning incorrect output shape#3374

Open
Nandinisingh07 wants to merge 4 commits intoaeon-toolkit:mainfrom
Nandinisingh07:fix/leftstampi-clean
Open

[BUG] Fix LeftSTAMPi predict() returning incorrect output shape#3374
Nandinisingh07 wants to merge 4 commits intoaeon-toolkit:mainfrom
Nandinisingh07:fix/leftstampi-clean

Conversation

@Nandinisingh07
Copy link
Copy Markdown
Contributor

Fixes #2819

predict(X) was returning scores for the entire accumulated series instead
of just the new input X. After fit(20 points), predict(15 points) would
return 35 scores instead of 15.

Root cause: fit_is_empty was True, so the base class skipped fit()
during fit_predict(), leaving self.mp as None when _predict() ran.

Changes:

  • Set fit_is_empty to False
  • _fit() now initialises stumpy on only the first n_init_train points
  • _predict() prepends zeros for the init region and scores only new points
  • Replaced reverse_windowing with end-of-window score assignment

No new dependencies introduced.

Only _left_stampi.py and its test file are changed.
All unit tests pass locally.

@aeon-actions-bot aeon-actions-bot bot added anomaly detection Anomaly detection package bug Something isn't working labels Mar 28, 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: [ bug ].
I have added the following labels to this PR based on the changes made: [ anomaly detection ]. 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, any trivial fixes will automatically be pushed to your PR unless it is a draft.

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/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
  • Stop automatic pre-commit fixes (always disabled for drafts)
  • Disable numba cache loading
  • Regenerate expected results for testing
  • Push an empty commit to re-run CI checks

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

Labels

anomaly detection Anomaly detection package bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] LeftSTAMPi output has incorrect shape

1 participant