Skip to content

Commit d63a0e3

Browse files
authored
Add anomaly score explanation for ML get records endpoint (#1983)
1 parent cfd0740 commit d63a0e3

File tree

3 files changed

+206
-3
lines changed

3 files changed

+206
-3
lines changed

output/schema/schema.json

Lines changed: 145 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/ml/_types/Anomaly.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import { DurationValue, EpochTime, UnitMillis, UnitSeconds } from '@_types/Time'
2323

2424
export class Anomaly {
2525
actual?: double[]
26+
/**
27+
* Information about the factors impacting the initial anomaly score.
28+
*/
29+
anomaly_score_explanation?: AnomalyExplanation
2630
bucket_span: DurationValue<UnitSeconds>
2731
by_field_name?: string
2832
by_field_value?: string
@@ -67,3 +71,46 @@ export class Influence {
6771
influencer_field_name: string
6872
influencer_field_values: string[]
6973
}
74+
75+
export class AnomalyExplanation {
76+
/**
77+
* Impact from the duration and magnitude of the detected anomaly relative to the historical average.
78+
*/
79+
anomaly_characteristics_impact?: integer
80+
/**
81+
* Length of the detected anomaly in the number of buckets.
82+
*/
83+
anomaly_length?: integer
84+
/**
85+
* Type of the detected anomaly: `spike` or `dip`.
86+
*/
87+
anomaly_type?: string
88+
/**
89+
* Indicates reduction of anomaly score for the bucket with large confidence intervals. If a bucket has large confidence intervals, the score is reduced.
90+
*/
91+
high_variance_penalty?: boolean
92+
/**
93+
* If the bucket contains fewer samples than expected, the score is reduced.
94+
*/
95+
incomplete_bucket_penalty?: boolean
96+
/**
97+
* Lower bound of the 95% confidence interval.
98+
*/
99+
lower_confidence_bound?: double
100+
/**
101+
* Impact of the deviation between actual and typical values in the past 12 buckets.
102+
*/
103+
multi_bucket_impact?: integer
104+
/**
105+
* Impact of the deviation between actual and typical values in the current bucket.
106+
*/
107+
single_bucket_impact?: integer
108+
/**
109+
* Typical (expected) value for this bucket.
110+
*/
111+
typical_value?: double
112+
/**
113+
* Upper bound of the 95% confidence interval.
114+
*/
115+
upper_confidence_bound?: double
116+
}

0 commit comments

Comments
 (0)