From d9f312300eef7849fc27a18ee61680eda414f04a Mon Sep 17 00:00:00 2001 From: Joshua Palis Date: Fri, 11 Aug 2023 23:12:34 +0000 Subject: [PATCH] Defaulting grade to 0 if negative 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,