From e045bc2db4496529aa20bcacf00cc5c03d68e8ef Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Wed, 17 Oct 2018 14:26:04 +0100 Subject: [PATCH 1/2] [ML] Lowers multi-bucket impact thresholds used for anomaly display --- x-pack/plugins/ml/common/constants/multi_bucket_impact.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ml/common/constants/multi_bucket_impact.js b/x-pack/plugins/ml/common/constants/multi_bucket_impact.js index f37be00ed11d1..5c3a25954dbb7 100644 --- a/x-pack/plugins/ml/common/constants/multi_bucket_impact.js +++ b/x-pack/plugins/ml/common/constants/multi_bucket_impact.js @@ -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 }; From bc95ab72655be9ab98c93653a14ce1eadd086b9d Mon Sep 17 00:00:00 2001 From: Pete Harverson Date: Wed, 17 Oct 2018 16:37:47 +0100 Subject: [PATCH 2/2] [ML] Adjust thresholds used in multi bucket impact unit tests --- .../ml/common/util/__tests__/anomaly_utils.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js b/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js index da1160401fbe9..e093db28ba233 100644 --- a/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js +++ b/x-pack/plugins/ml/common/util/__tests__/anomaly_utils.js @@ -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', () => {