[ML] Improve sampling and normalization of population chart.#24402
Merged
walterra merged 2 commits intoelastic:masterfrom Oct 24, 2018
Merged
[ML] Improve sampling and normalization of population chart.#24402walterra merged 2 commits intoelastic:masterfrom
walterra merged 2 commits intoelastic:masterfrom
Conversation
Contributor
|
Pinging @elastic/ml-ui |
Contributor
💚 Build Succeeded |
| { | ||
| random_score: { | ||
| // static seed to get same randomized results on every request | ||
| seed: 'ml' |
Contributor
There was a problem hiding this comment.
Looks like you now need to use a field parameter here as well as seed to get reproducible results - see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-function-score-query.html#function-random
Contributor
Author
There was a problem hiding this comment.
Thanks for pointing that out, I was working off some outdated docs. Push an update in 43ced43.
Contributor
|
This LGTM overall. 👍 I'm just waiting on responses to Pete's comments since I have less context on that bit. |
Contributor
💔 Build Failed |
Contributor
Author
|
retest |
Contributor
💚 Build Succeeded |
walterra
added a commit
to walterra/kibana
that referenced
this pull request
Oct 24, 2018
…#24402) This optimizes how contextual data is fetched for the population analysis chart.
walterra
added a commit
that referenced
this pull request
Oct 24, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR optimizes how contextual data is fetched for the population analysis chart. The previous structure of nested aggregations to get the data was like this:
This is now changed to the following structure:
boolquery withmustclauses only, all documents had the same score.countandsum. In contrast to functions likemean, the results of the former could be heavily skewed because of the sampling. The normalization adjusts the values to take into account the total amount of documents without sampling.The screenshots above show results before (left) and after (right) the optimization.
50000, the examples above are just to give you an impression how the sampling and normalization work before and after.Checklist
Checklist not applicable (existing tests pass, no DOM changes).
Part of #21163.