-
Notifications
You must be signed in to change notification settings - Fork 129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENH] Issue 1641 - Matrix profile-based anomaly detectors: left STAMPi #2091
[ENH] Issue 1641 - Matrix profile-based anomaly detectors: left STAMPi #2091
Conversation
Thank you for contributing to
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution!
I'm in favor of supporting streaming use cases, and I also like the idea of repeatedly calling predict
. However, this violates the convention that no internal representation is updated in predict
. We can neither use repeated calls to fit
because it is assumed to reset the estimator on the beginning of each call.
I guess, we need to design a new API for streaming. @MatthewMiddlehurst how do you think about this?
Until we have decided on the new API, I would suggest adding leftSTAMPi only with its batch API.
@CodeLionX Thanks for your comments and suggestions. The failing test-suite made me aware that the approach I took for the streaming case is violating the concept of Also, could you point me to the documentation of the sklearn and aeon conventions regarding the naming conventions ( |
…ter a decision about the streaming API has been made.
Still making changes to fix the failling tests. I will re-request a new review when I am done. |
It is sprinkled in this guide: https://scikit-learn.org/dev/developers/develop.html E.g.
is in Parameters and Init-section |
Thanks for the contribution. Feel free to ask if you have any questions regarding the failures, i.e. we have a tag for estimators which can't be pickled (usually due to dependencies outside of our control). |
Think adding to the base API should be a separate PR yeah, would need to see a proposal but if |
Another question is whether we actually want to introduce streaming algorithms in aeon. Are there already other streaming/online estimators? The current architecture is tailored to the batch-case. Maybe this is a topic for the next dev-meeting. |
Then maybe you discuss this in your next dev meeting and if you decide that you want to integrat a streaming api, I am happy to put in a proposal and another PR to implement this for the LeftSTUMPi algorithm. |
I guess I figured it out. I tagged the class with 'cant-pickle' and the tests are green now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, looks good 👍🏼
@CodeLionX How is the process after the PR is approved? Do I have to do something or is this simply integrated at some point? |
Don't have to do anything, can be merged at any point really. Usually give it some time for other comments though. Not really a massive rush until it's close to release time 🙂 |
We will wait a bit, so that other maintainers / core devs get the chance to object; otherwise, I'll merge it in later. EDIT: Matthew was faster 🤷🏼 |
@ferewi regarding the online-API, we decided in our dev-meeting that aeon will not support this in the near future. If you have a use case for streaming/online anomaly detection, we can, of course, talk about this again. Matthew will create an issue to track this. |
Fantastic, thanks for this |
Cool - I was just interested in how the usual process is :) Thank you for your help @CodeLionX @MatthewMiddlehurst :) |
@all-contributors add @ferewi for code This may be duplicated, dont remember if we did this 🙂 |
I've put up a pull request to add @ferewi! 🎉 |
Reference Issues/PRs
Fixes #1641
What does this implement/fix? Explain your changes.
This PR implements the LeftSTAMPi Anomaly Detector based on the implementation in TimeEval (https://github.com/TimeEval/TimeEval-algorithms/blob/main/left_stampi/algorithm.py)
The Algorithm can be run in two modes.
Remarks:
The batch mode is implemented in the
fit_predict
method.The stream mode is implemented in the
fit
andpredict
methods, wherefit
is used to init the algorithm andpredict
is used for imcremental updates. As thepredict
method only acceptsnp.ndarray
as its argument, on every update the new data point, which is a scalar has to be wrapped in a one-element numpy array. This is actually unnecessarry but avoiding this would involve a change to the interface inBaseAnomalyDetector
.Does your contribution introduce a new dependency? If yes, which one?
No.
Any other comments?
See remarks in the implementation description.
PR checklist
For all contributions
@all-contributors please add @ferewi for code, doc and test
For new estimators and functions
__maintainer__
at the top of relevant files and want to be contacted regarding its maintenance. Unmaintained files may be removed. This is for the full file, and you should not add yourself if you are just making minor changes or do not want to help maintain its contents.For developers with write access