From 2499d85e39997b35ab82758ddbb0de6a1884a82a Mon Sep 17 00:00:00 2001 From: Joshua Palis Date: Mon, 14 Aug 2023 13:53:24 -0700 Subject: [PATCH] Defaulting grade to 0 if negative (#977) Signed-off-by: Joshua Palis --- src/main/java/org/opensearch/ad/model/AnomalyResult.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/opensearch/ad/model/AnomalyResult.java b/src/main/java/org/opensearch/ad/model/AnomalyResult.java index aa60ff6db..acf90fe26 100644 --- a/src/main/java/org/opensearch/ad/model/AnomalyResult.java +++ b/src/main/java/org/opensearch/ad/model/AnomalyResult.java @@ -426,7 +426,7 @@ public static AnomalyResult fromRawTRCFResult( detectorId, taskId, rcfScore, - grade, + Math.max(0, grade), confidence, featureData, dataStartTime,