Skip to content

Commit

Permalink
anomaly_score as double
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Sep 20, 2023
1 parent 90a87ed commit 72d616f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/lib/alerts/alerting_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ export function alertingServiceProvider(
job_id: [...new Set(requestedAnomalies.map((h) => h._source.job_id))][0],
is_interim: requestedAnomalies.some((h) => h._source.is_interim),
anomaly_timestamp: timestamp,
anomaly_score: Math.floor(topAnomaly._source[getScoreFields(resultType, useInitialScore)]),
anomaly_score: topAnomaly._source[getScoreFields(resultType, useInitialScore)],
top_records: v.record_results.top_record_hits.hits.hits.map((h) => {
const { actual, typical } = getTypicalAndActualValues(h._source);
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const ANOMALY_DETECTION_AAD_CONFIG: IRuleTypeAlerts<MlAnomalyDetectionAle
array: false,
required: true,
},
[ALERT_ANOMALY_SCORE]: { type: ES_FIELD_TYPES.INTEGER, array: false, required: false },
[ALERT_ANOMALY_SCORE]: { type: ES_FIELD_TYPES.DOUBLE, array: false, required: false },
[ALERT_ANOMALY_IS_INTERIM]: { type: ES_FIELD_TYPES.BOOLEAN, array: false, required: false },
[ALERT_ANOMALY_TIMESTAMP]: { type: ES_FIELD_TYPES.DATE, array: false, required: false },
[ALERT_TOP_RECORDS]: {
Expand Down

0 comments on commit 72d616f

Please sign in to comment.