-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Adding anomaly score explanations #142999
[ML] Adding anomaly score explanations #142999
Conversation
…-ref HEAD~1..HEAD --fix'
content={i18n.translate( | ||
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.recordScoreTooltip', | ||
{ | ||
defaultMessage: 'Record score normalized blah blah blah', |
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.
Description text needed
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.
@szabosteve and @valeriy42 can you please help me with this tooltip text.
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.
We have a lot of questions / SDHs where the final score is significantly different than the initial score. As well as the tooltip text here, I wonder if we need extra text (not behind a tooltip), possibly in the 'Impact on initial score' section clarifying why this is, giving reasons for 'why the actual score is so much lower than the initial score?'.
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.
It looks like this is just a repeat of the "Initial record score" and the "Record score" from the left column, just with an arrow in between? If that's true, having "normalized" in the label here seems to falsely imply the other values aren't normalized. Unless there's something else going on here that you want to cover in the tooltip?
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.
I was thinking that the label could be "Record score reduction" or something like that. With the tooltip explaining that normalization has caused the score to be reduced.
I wonder if we need extra text (not behind a tooltip), possibly in the 'Impact on initial score' section clarifying why this is, giving reasons for 'why the actual score is so much lower than the initial score?'.
Yes I think that would be helpful.
content={i18n.translate( | ||
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.anomalyCharacteristicsTooltip', | ||
{ | ||
defaultMessage: 'Anomaly characteristics impact blah blah blah', |
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.
Description text needed
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.
@szabosteve and @valeriy42 can you please help me with this tooltip text.
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 description we use in the API is: "Impact of the statistical properties of the detected anomalous interval", though hopefully we can make that more intelligible.
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.
Updated in 45313cd
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 high impact from the statistical properties of the detected anomaly compared to the previous anomalies." or "impact from the shape of the detected anomaly distribution compared to the previous anomalies."
content={i18n.translate( | ||
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.singleBucketTooltip', | ||
{ | ||
defaultMessage: 'Single bucket impact blah blah blah', |
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.
Description text needed
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.
@szabosteve and @valeriy42 can you please help me with this tooltip text.
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 text we used in the API was: "Impact of the deviation between actual and typical in the current bucket." However, a clearer tip here might be: "The impact of the difference between actual and typical values in this bucket on the score."
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.
Updated in 45313cd
content={i18n.translate( | ||
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.multiBucketTooltip', | ||
{ | ||
defaultMessage: 'Multi bucket impact blah blah blah', |
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.
Description text needed
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.
@szabosteve and @valeriy42 can you please help me with this tooltip text.
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 description in the API docs is " Impact of the deviation between actual and typical in the past 12 buckets." So to match my other suggestion, I'd suggest "The impact of the difference between actual and typical values in the past 12 buckets on the score."
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.
Updated in 45313cd
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.
I would skip putting "on the score." as the fields belong to the group "Impact on the initial score".
content={i18n.translate( | ||
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.highVarianceTooltip', | ||
{ | ||
defaultMessage: 'High variance interval blah blah blah', |
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.
Description text needed
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.
@szabosteve and @valeriy42 can you please help me with this tooltip text.
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 API docs for this one say "Indicates reduction of anomaly score for the bucket with large confidence intervals." However, I think that's another one we should try to make more intelligible if possible. For example, "If a bucket has large confidence intervals, the score is reduced." Though that begs the question of why this bucket has large confidence intervals.
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.
Updated in 45313cd
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 long and simplified answer is: We have detected a periodic pattern in the time series. The current bucket is in the part of the periodic interval where data can vary a lot. This leads to a large confidence interval since we have seen data all over the place in this part of the period before. Hence, we reduce the anomaly score for the current anomaly in this region.
Now, how to fit it in a tooltip?
content={i18n.translate( | ||
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.incompleteBucketTooltip', | ||
{ | ||
defaultMessage: 'Incomplete bucket blah blah blah', |
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.
Description text needed
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.
@szabosteve and @valeriy42 can you please help me with this tooltip text.
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 API docs for this one say "Indicates reduction of anomaly score if the bucket contains fewer samples than historically expected." It might be clearer to say something like "If the bucket contains fewer samples than expected, the score is reduced."
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.
Updated in 45313cd
Pinging @elastic/ml-ui (:ml) |
…-ref HEAD~1..HEAD --fix'
Having seen the examples which use the health indicator in #142999 (comment), I agree the underline style works better in this case where we are showing how the score has dropped. Happy to go with the underline style in the explanation section. |
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.anomalyCharacteristicsTooltip.low', | ||
{ | ||
defaultMessage: | ||
'The statistical properties of the detected anomalous interval have a low impact on the score.', |
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.
@valeriy42 are there any more details we can provide for the 'statistical properties' info? This text is a bit unclear to me and leaves me wondering 'what statistical properties'.
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.
@peteharverson: "The duration and magnitude of the current anomaly relative to the historical average among the detected anomalies."
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.
magnitude, scale, extent, expanse, range of deviation
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.
How about this?
Moderate / medium / high impact from the duration and magnitude of the detected anomaly relative to the historical average.
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.singleBucketTooltip.low', | ||
{ | ||
defaultMessage: | ||
'The difference between actual and typical values in this bucket have a moderate impact.', |
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.
Should be has a moderate..
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.singleBucketTooltip.medium', | ||
{ | ||
defaultMessage: | ||
'The difference between actual and typical values in this bucket have a significant impact.', |
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.
Should be has a significant..
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.singleBucketTooltip.high', | ||
{ | ||
defaultMessage: | ||
'The difference between actual and typical values in this bucket have a high impact.', |
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.
Should be has a high..
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.multiBucketTooltip.low', | ||
{ | ||
defaultMessage: | ||
'The difference between actual and typical values in the past 12 buckets have a moderate impact.', |
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.
Should be The differences
or switch have
to has
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.multiBucketTooltip.medium', | ||
{ | ||
defaultMessage: | ||
'The difference between actual and typical values in the past 12 buckets have a significant impact.', |
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.
Should be The differences
or switch have
to has
'xpack.ml.anomaliesTable.anomalyDetails.anomalyExplanationDetails.multiBucketTooltip.high', | ||
{ | ||
defaultMessage: | ||
'The difference between actual and typical values in the past 12 buckets have a high impact.', |
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.
Should be The differences
or switch have
to has
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.
Latest changes LGTM
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.
LGTM
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
…act (#146866) ## Summary Follow-up to #142999, using the `multi_bucket_impact` field from the `anomaly_score_explanation` data to populate the multi-bucket information in the anomaly chart tooltip using the same visualization style as used in the expanded table row. <img width="1174" alt="image" src="https://user-images.githubusercontent.com/7405507/205274876-b2007388-e37a-4f31-8c23-97fbac42f4d8.png"> The anomaly charts in the Anomaly Explorer and Single Metric Viewer, and the severity cell in the anomalies table now use a new `isMultiBucketAnomaly` check in `ml/common/util/anomaly_utils.ts`m to determine whether to indicate the anomaly as multi-bucket with the plus-shaped symbol. Note that this will result in some changes to whether anomalies are plotted as multi-bucket anomalies. Specifically anomalies with a 'moderate' multi-bucket impact are now likely to be marked with a plus symbol where before they were not: Before: <img width="775" alt="image" src="https://user-images.githubusercontent.com/7405507/205276861-613e0966-9041-4a77-a922-369bb0c6d3c3.png"> After: <img width="809" alt="image" src="https://user-images.githubusercontent.com/7405507/205277054-86895ab2-f5b1-42d4-a947-5d2cd5f3d82e.png"> ### Checklist Delete any items that are not applicable to this PR. - [x] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/packages/kbn-i18n/README.md) - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [x] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers)
Adds the new anomaly explanation data to the expanded rows in the anomaly explorer and the single metric viewer.
If no
anomaly_score_explanation
record data is present, the section is no shown.The elasticsearch changes are not in yet, but this can be tested by mocking the data by making these changes 1ab9b45
As soon as the backend changes are in, I will test throughly and raise a follow up PR to fix any issues.
Also refactors the
AnomalyDetails
component into typescript.@elastic/kibana-design removes some now unused rules from a sass file.
cc @valeriy42