Skip to content
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] Lowers multi-bucket impact thresholds used for anomaly display #24136

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions x-pack/plugins/ml/common/constants/multi_bucket_impact.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@


// Thresholds for indicating the impact of multi-bucket features in an anomaly.
// As a rule-of-thumb, a threshold value T corresponds to the multi-bucket probability
// being 1000^(T/5) times smaller than the single bucket probability.
// So, for example, for HIGH it is 63 times smaller.
export const MULTI_BUCKET_IMPACT = {
HIGH: 4,
MEDIUM: 3,
HIGH: 3,
MEDIUM: 2,
LOW: 1,
NONE: -5
};
14 changes: 7 additions & 7 deletions x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,19 +284,19 @@ describe('ML - anomaly utils', () => {

describe('getMultiBucketImpactLabel', () => {

it('returns high for 4 <= score <= 5', () => {
expect(getMultiBucketImpactLabel(4)).to.be('high');
it('returns high for 3 <= score <= 5', () => {
expect(getMultiBucketImpactLabel(3)).to.be('high');
expect(getMultiBucketImpactLabel(5)).to.be('high');
});

it('returns medium for 3 <= score < 4', () => {
expect(getMultiBucketImpactLabel(3)).to.be('medium');
expect(getMultiBucketImpactLabel(3.99)).to.be('medium');
it('returns medium for 2 <= score < 3', () => {
expect(getMultiBucketImpactLabel(2)).to.be('medium');
expect(getMultiBucketImpactLabel(2.99)).to.be('medium');
});

it('returns low for 1 <= score < 3', () => {
it('returns low for 1 <= score < 2', () => {
expect(getMultiBucketImpactLabel(1)).to.be('low');
expect(getMultiBucketImpactLabel(2.99)).to.be('low');
expect(getMultiBucketImpactLabel(1.99)).to.be('low');
});

it('returns none for -5 <= score < 1', () => {
Expand Down