-
Notifications
You must be signed in to change notification settings - Fork 524
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
Additive Holt-Winters for anomaly detection #71
Conversation
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Show resolved
Hide resolved
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Outdated
Show resolved
Hide resolved
nPointsToForecast: Int, | ||
alpha: Double, | ||
beta: Double, | ||
gamma: Double): ModelResults = { |
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.
In this function, please separate computation of the initial statistics from the invocation of the ListBuffer constructors, the code is really hard to read otherwise
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 initial computation is a bit more readable now, let me know what you think about it.
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Show resolved
Hide resolved
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/amazon/deequ/anomalydetection/seasonal/HoltWinters.scala
Outdated
Show resolved
Hide resolved
*/ | ||
private[seasonal] def additiveHoltWinters( | ||
series: Seq[Double], | ||
periodicity: Int, |
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.
do we need a != 0 check for this?
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.
for now no, maybe later when we want to infer the series cycle length automatically
Description of changes:
Adds additive HW's method for anomaly detection including model selection on the data before the detection interval. The implementation is based on https://otexts.org/fpp2/holt-winters.html. The detector uses the standard deviation of the forecasting residuals to flag anomalies.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.