Skip to content

[ML] Trap zero variance in forecast confidence interval calculation causing error to be logged #107

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 2 commits into from
Jun 5, 2018

Conversation

tveasey
Copy link
Contributor

@tveasey tveasey commented May 29, 2018

If all the values added to a model before a forecast are identical, it triggers the following error in the confidence interval when forecasting: ERROR CTrendComponent.cc@67 Failed calculating confidence interval: Error in function boost::math::normal_distribution<double>::normal_distribution: Scale parameter is 0, but must be > 0 !, prediction = 0, variance = 0, confidence = 95. In fact, this error is harmless (since we take the correct action in this case).

This change explicitly traps the problem case, i.e. creating a distribution with zero variance. It doesn't result in any change in behaviour, but does suppress the error.

Release note: Stops zero variance data from generating a log error in the forecast confidence interval

@tveasey tveasey changed the title [ML] Trap zero variance in forecast confidence interval calculation [ML] Trap zero variance in forecast confidence interval calculation causing error to be logged May 29, 2018
@tveasey tveasey requested a review from davidkyle May 29, 2018 11:05
Copy link
Member

@davidkyle davidkyle 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 force-pushed the bug/trap-zero-variance branch from dff5d5d to b3f15f2 Compare June 5, 2018 17:02
@tveasey tveasey merged commit 7c48975 into elastic:master Jun 5, 2018
tveasey added a commit to tveasey/ml-cpp-1 that referenced this pull request Jun 8, 2018
@sophiec20 sophiec20 added :ml and removed :ml labels Jun 12, 2018
@tveasey tveasey deleted the bug/trap-zero-variance branch May 1, 2019 14:55
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.

3 participants