-
-
Notifications
You must be signed in to change notification settings - Fork 555
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
Implementation of the StandardAbsoluteDeviation (SAD) anomaly detection algorithm #1357
Conversation
@MaxHalford Would you mind having a look through this PR? There are two problems that are making the tests fail, including
Thank you so much in advance! |
river/anomaly/sad.py
Outdated
__all__ = ["StandardAbsoluteDeviation"] | ||
|
||
|
||
class StandardAbsoluteDeviation(anomaly.base.AnomalyDetector): |
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.
The issue with this method is that it is univariate. You're trying to fit into the multivariate anomaly detection framework, which is not the right way.
What you should do is inspire yourself from anomaly.GaussianScorer
. It's also a univariate anomaly detection method.
Let me know if this isn't clear
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.
@MaxHalford I think I can understand the idea, and have also implemented it in my upcoming commits. It would be much appreciated if you can have a look through and see whether the new approach is appropriate!
…ion algorithm as that of `GaussianScorer`.
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.
Cool! Can you add a note to unreleased.md
?
@MaxHalford Thank you so much for approving the changes! The entry has also been added to the UNRELEASED.md file. |
This PR contains the implementation of the Standard Absolute Deviation (SAD) anomaly detection algorithm.
This implementation is adapted from the implementation within PySAD (Python Streaming Anomaly Detection) package, which calculates the anomaly score by dividing the deviation from the mean/median to the standard deviation of all points seen within the data stream. This idea is adapted from the paper by Hochenbaum et al. (2017).
Despite being a fairly simple algorithm, the implementation of this algorithm allows the
anomaly
submodule ofRiver
to have a solid competitor to conduct any benchmarking work.There is no unit test for this algorithm since the result has already been compared locally with the implementation in PySAD, which yielded exactly similar results. Creating unit tests upstream would require the installation of another package, which seem unnecessary.