From f7932a38b4edb052a0409ce0a70363660765d897 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 1 Nov 2022 12:02:13 -0700 Subject: [PATCH 1/2] Add descriptions for anomaly record --- specification/ml/_types/Anomaly.ts | 66 ++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/specification/ml/_types/Anomaly.ts b/specification/ml/_types/Anomaly.ts index fc677c08ac..9a12ce4417 100644 --- a/specification/ml/_types/Anomaly.ts +++ b/specification/ml/_types/Anomaly.ts @@ -22,35 +22,101 @@ import { double, integer } from '@_types/Numeric' import { DurationValue, EpochTime, UnitMillis, UnitSeconds } from '@_types/Time' export class Anomaly { + /** + * The actual value for the bucket. + */ actual?: double[] /** * Information about the factors impacting the initial anomaly score. */ anomaly_score_explanation?: AnomalyExplanation + /** + * The length of the bucket in seconds. This value matches the `bucket_span` that is specified in the job. + */ bucket_span: DurationValue + /** + * The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split. + */ by_field_name?: string + /** + * The value of `by_field_name`. + */ by_field_value?: string + /** + * For population analysis, an over field must be specified in the detector. This property contains an array of anomaly records that are the causes for the anomaly that has been identified for the over field. This sub-resource contains the most anomalous records for the `over_field_name`. For scalability reasons, a maximum of the 10 most significant causes of the anomaly are returned. As part of the core analytical modeling, these low-level anomaly records are aggregated for their parent over field record. The `causes` resource contains similar elements to the record resource, namely `actual`, `typical`, `geo_results.actual_point`, `geo_results.typical_point`, `*_field_name` and `*_field_value`. Probability and scores are not applicable to causes. + */ causes?: AnomalyCause[] + /** + * A unique identifier for the detector. + */ detector_index: integer + /** + * Certain functions require a field to operate on, for example, `sum()`. For those functions, this value is the name of the field to be analyzed. + */ field_name?: string + /** + * The function in which the anomaly occurs, as specified in the detector configuration. For example, `max`. + */ function?: string + /** + * The description of the function in which the anomaly occurs, as specified in the detector configuration. + */ function_description?: string /** * If the detector function is `lat_long`, this object contains comma delimited strings for the latitude and longitude of the actual and typical values. */ geo_results?: GeoResults + /** + * If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly. + */ influencers?: Influence[] + /** + * A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed. + */ initial_record_score: double + /** + * If true, this is an interim result. In other words, the results are calculated based on partial input data. + */ is_interim: boolean + /** + * Identifier for the anomaly detection job. + */ job_id: string + /** + * The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits. + */ over_field_name?: string + /** + * The value of `over_field_name`. + */ over_field_value?: string + /** + * The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field. + */ partition_field_name?: string + /** + * The value of `partition_field_name`. + */ partition_field_value?: string + /** + * The probability of the individual anomaly occurring, in the range 0 to 1. For example, `0.0000772031`. This value can be held to a high precision of over 300 decimal places, so the `record_score` is provided as a human-readable and friendly interpretation of this. + */ probability: double + /** + * A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike `initial_record_score`, this value will be updated by a re-normalization process as new data is analyzed. + */ record_score: double + /** + * Internal. This is always set to `record`. + */ result_type: string + /** + * The start time of the bucket for which these results were calculated. + */ timestamp: EpochTime + /** + * The typical value for the bucket, according to analytical modeling. + */ typical?: double[] } From 57209bbc902a19166651b7da92a4afdda3d1d7bb Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 1 Nov 2022 12:02:59 -0700 Subject: [PATCH 2/2] Make generate output --- output/schema/schema.json | 32 +++++++++++++++++++++++++----- specification/ml/_types/Anomaly.ts | 4 ++-- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index d706db50bd..db605d5471 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -120969,6 +120969,7 @@ }, "properties": [ { + "description": "The actual value for the bucket.", "name": "actual", "required": false, "type": { @@ -120995,6 +120996,7 @@ } }, { + "description": "The length of the bucket in seconds. This value matches the `bucket_span` that is specified in the job.", "name": "bucket_span", "required": true, "type": { @@ -121015,6 +121017,7 @@ } }, { + "description": "The field used to split the data. In particular, this property is used for analyzing the splits with respect to their own history. It is used for finding unusual values in the context of the split.", "name": "by_field_name", "required": false, "type": { @@ -121026,6 +121029,7 @@ } }, { + "description": "The value of `by_field_name`.", "name": "by_field_value", "required": false, "type": { @@ -121037,6 +121041,7 @@ } }, { + "description": "For population analysis, an over field must be specified in the detector. This property contains an array of anomaly records that are the causes for the anomaly that has been identified for the over field. This sub-resource contains the most anomalous records for the `over_field_name`. For scalability reasons, a maximum of the 10 most significant causes of the anomaly are returned. As part of the core analytical modeling, these low-level anomaly records are aggregated for their parent over field record. The `causes` resource contains similar elements to the record resource, namely `actual`, `typical`, `geo_results.actual_point`, `geo_results.typical_point`, `*_field_name` and `*_field_value`. Probability and scores are not applicable to causes.", "name": "causes", "required": false, "type": { @@ -121051,6 +121056,7 @@ } }, { + "description": "A unique identifier for the detector.", "name": "detector_index", "required": true, "type": { @@ -121062,6 +121068,7 @@ } }, { + "description": "Certain functions require a field to operate on, for example, `sum()`. For those functions, this value is the name of the field to be analyzed.", "name": "field_name", "required": false, "type": { @@ -121073,6 +121080,7 @@ } }, { + "description": "The function in which the anomaly occurs, as specified in the detector configuration. For example, `max`.", "name": "function", "required": false, "type": { @@ -121084,6 +121092,7 @@ } }, { + "description": "The description of the function in which the anomaly occurs, as specified in the detector configuration.", "name": "function_description", "required": false, "type": { @@ -121107,6 +121116,7 @@ } }, { + "description": "If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly.", "name": "influencers", "required": false, "type": { @@ -121121,6 +121131,7 @@ } }, { + "description": "A normalized score between 0-100, which is based on the probability of the anomalousness of this record. This is the initial value that was calculated at the time the bucket was processed.", "name": "initial_record_score", "required": true, "type": { @@ -121132,6 +121143,7 @@ } }, { + "description": "If true, this is an interim result. In other words, the results are calculated based on partial input data.", "name": "is_interim", "required": true, "type": { @@ -121143,6 +121155,7 @@ } }, { + "description": "Identifier for the anomaly detection job.", "name": "job_id", "required": true, "type": { @@ -121154,6 +121167,7 @@ } }, { + "description": "The field used to split the data. In particular, this property is used for analyzing the splits with respect to the history of all splits. It is used for finding unusual values in the population of all splits.", "name": "over_field_name", "required": false, "type": { @@ -121165,6 +121179,7 @@ } }, { + "description": "The value of `over_field_name`.", "name": "over_field_value", "required": false, "type": { @@ -121176,6 +121191,7 @@ } }, { + "description": "The field used to segment the analysis. When you use this property, you have completely independent baselines for each value of this field.", "name": "partition_field_name", "required": false, "type": { @@ -121187,6 +121203,7 @@ } }, { + "description": "The value of `partition_field_name`.", "name": "partition_field_value", "required": false, "type": { @@ -121198,6 +121215,7 @@ } }, { + "description": "The probability of the individual anomaly occurring, in the range 0 to 1. For example, `0.0000772031`. This value can be held to a high precision of over 300 decimal places, so the `record_score` is provided as a human-readable and friendly interpretation of this.", "name": "probability", "required": true, "type": { @@ -121209,6 +121227,7 @@ } }, { + "description": "A normalized score between 0-100, which is based on the probability of the anomalousness of this record. Unlike `initial_record_score`, this value will be updated by a re-normalization process as new data is analyzed.", "name": "record_score", "required": true, "type": { @@ -121220,6 +121239,7 @@ } }, { + "description": "Internal. This is always set to `record`.", "name": "result_type", "required": true, "type": { @@ -121231,6 +121251,7 @@ } }, { + "description": "The start time of the bucket for which these results were calculated.", "name": "timestamp", "required": true, "type": { @@ -121251,6 +121272,7 @@ } }, { + "description": "The typical value for the bucket, according to analytical modeling.", "name": "typical", "required": false, "type": { @@ -121265,7 +121287,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L24-L55" + "specLocation": "ml/_types/Anomaly.ts#L24-L121" }, { "kind": "interface", @@ -121438,7 +121460,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L57-L72" + "specLocation": "ml/_types/Anomaly.ts#L123-L138" }, { "kind": "interface", @@ -121568,7 +121590,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L90-L131" + "specLocation": "ml/_types/Anomaly.ts#L156-L197" }, { "kind": "interface", @@ -126460,7 +126482,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L79-L88" + "specLocation": "ml/_types/Anomaly.ts#L145-L154" }, { "kind": "interface", @@ -127137,7 +127159,7 @@ } } ], - "specLocation": "ml/_types/Anomaly.ts#L74-L77" + "specLocation": "ml/_types/Anomaly.ts#L140-L143" }, { "kind": "interface", diff --git a/specification/ml/_types/Anomaly.ts b/specification/ml/_types/Anomaly.ts index 9a12ce4417..f0d95dff1c 100644 --- a/specification/ml/_types/Anomaly.ts +++ b/specification/ml/_types/Anomaly.ts @@ -66,8 +66,8 @@ export class Anomaly { * If the detector function is `lat_long`, this object contains comma delimited strings for the latitude and longitude of the actual and typical values. */ geo_results?: GeoResults - /** - * If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly. + /** + * If influencers were specified in the detector configuration, this array contains influencers that contributed to or were to blame for an anomaly. */ influencers?: Influence[] /**