Skip to content

[ML] Fix restore from checkpoint damaging seasonality modelling for anomaly detection - #821

Merged
tveasey merged 3 commits into
elastic:masterfrom
tveasey:fix-seasonality-persist-restore
Nov 13, 2019
Merged

tveasey merged 3 commits into
elastic:masterfrom
tveasey:fix-seasonality-persist-restore

Conversation

@tveasey

@tveasey tveasey commented Nov 13, 2019

Copy link
Copy Markdown
Contributor

We weren't persisting and restoring all the state we should have been. This should only affect behaviour after a restore.

Fixes #820.

@edsavage edsavage left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@droberts195 droberts195 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for fixing this. All my comments are minor nits and non-essential things that might help to avoid future mistakes.

Comment thread docs/CHANGELOG.asciidoc Resolved
// DO NOT change the existing tags if new sub-classes are added.
const core::TPersistenceTag DIURNAL_TIME_TAG{"a", "diurnal_time"};
const core::TPersistenceTag ARBITRARY_PERIOD_TIME_TAG{"b", "arbitrary_period_time"};
const std::string DELIMITER(",");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

There's a subtle dependency between this and the DELIMITER and PAIR_DELIMITER in core::CPersistUtils. This one has to be different to those two, since restoration is searching for it starting at the beginning of a string whose beginning portion contains core::CPersistUtils::DELIMITER and core::CPersistUtils::PAIR_DELIMITER. So this could be commented. Alternatively rfind could be used instead of find when deconstructing the persisted string.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like the rfind idea. I thought about defining both here to make this explicit, but decided this unit test would fail if anyone changed the delimiter used by CPersistUtils. (On that front, this would also invalidate all our saved state so I don't see it ever happening, but better to be safe.)

Comment thread lib/maths/CSeasonalTime.cc Resolved
Comment thread lib/maths/CSeasonalTime.cc Resolved
Comment thread lib/maths/unittest/Makefile Resolved
#include <maths/CChecksum.h>
#include <maths/CIntegerTools.h>

#include <boost/array.hpp>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It looks like this file had already been changed to std::array on master without changing the header, so this is fine on master. But note that on 6.8 the code is still using boost::array, so the header change shouldn't be included in the 6.8 backport.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I need to rewrite the tests as well on 6.8 so the back port is non-trivial.

@tveasey

tveasey commented Nov 13, 2019

Copy link
Copy Markdown
Contributor Author

retest

tveasey added a commit that referenced this pull request Nov 13, 2019
@droberts195 droberts195 added v6.8.5 and removed v6.8.6 labels Nov 13, 2019
@tveasey
tveasey merged commit f2f5fb1 into elastic:master Nov 13, 2019
@tveasey
tveasey deleted the fix-seasonality-persist-restore branch November 13, 2019 15:06
tveasey added a commit to tveasey/ml-cpp-1 that referenced this pull request Nov 13, 2019
tveasey added a commit to tveasey/ml-cpp-1 that referenced this pull request Nov 13, 2019
tveasey added a commit to tveasey/ml-cpp-1 that referenced this pull request Nov 13, 2019
tveasey added a commit that referenced this pull request Nov 13, 2019
tveasey added a commit that referenced this pull request Nov 13, 2019
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.

[ML] Weekend periodicity lost in first week after reopening anomaly detection job

3 participants