Skip to content

[ML] Assorted time series modelling stability fixes #1675

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

Merged
merged 11 commits into from
Jan 26, 2021

Conversation

tveasey
Copy link
Contributor

@tveasey tveasey commented Jan 18, 2021

This addresses various sources of instability in the time series modelling for anomaly detection:

  1. Our update dynamics were stable (just). However, we do other things which aren't considered in this analysis, such as apply different weights to different updates. I added a small margin.
  2. There was an error in the times at which we asked for model predictions when component models were restricted to time windows, i.e. weekdays and weekends.
  3. We could use stale predictions when there were long gaps in the data.
  4. Changing the seasonal derivative too fast can create transient instability after data changes.

I've also added some more unit testing. Particular, in the area of when we refresh predictions and an explicit testing long term stability.

Copy link
Contributor

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

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

LGTM

@tveasey tveasey merged commit 62c60f3 into elastic:master Jan 26, 2021
@tveasey tveasey deleted the stability-v2 branch January 26, 2021 18:11
tveasey added a commit that referenced this pull request Jan 28, 2021
#1675 introduced a subtle bug in the updating of newly initialised seasonal components. It switched to using state to 
track when it refreshes the seasonal model predictions to reflect new data (to correct behaviour when there are long 
gaps in the data). However, we test for seasonal components on a window which can sometimes extend beyond the 
current time (with future values set to "null"). As a result we were sometimes setting the time to refresh into the future 
and the model wasn't reflecting new data immediately after a seasonal component was added.
tveasey added a commit to tveasey/ml-cpp-1 that referenced this pull request Feb 5, 2021
This addresses various sources of instability in the time series modelling for anomaly detection:
 1. Our update dynamics were stable (just). However, we do other things which aren't considered in this analysis, such
    as apply different weights to different updates. I added a small margin.
 2. There was an error in the times at which we asked for model predictions when component models were restricted 
    to time windows, i.e. weekdays and weekends.
 3. We could use stale predictions when there were long gaps in the data.
 4. Changing the seasonal derivative too fast can create transient instability after data changes.
I've also added some more unit testing. Particular, in the area of when we refresh predictions and explicitly test long
term stability.
tveasey added a commit to tveasey/ml-cpp-1 that referenced this pull request Feb 5, 2021
elastic#1675 introduced a subtle bug in the updating of newly initialised seasonal components. It switched to using state to 
track when it refreshes the seasonal model predictions to reflect new data (to correct behaviour when there are long 
gaps in the data). However, we test for seasonal components on a window which can sometimes extend beyond the 
current time (with future values set to "null"). As a result we were sometimes setting the time to refresh into the future 
and the model wasn't reflecting new data immediately after a seasonal component was added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants