From d069b960e707786ce7bbd446595c58e6f99588ed Mon Sep 17 00:00:00 2001 From: Ram Senthamarai Date: Wed, 11 Sep 2024 09:56:45 -0700 Subject: [PATCH] chore(anomaly-detection) Disable peak-trough detection --- .../anomaly_detection/detectors/mp_scorers.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/seer/anomaly_detection/detectors/mp_scorers.py b/src/seer/anomaly_detection/detectors/mp_scorers.py index 5a1da10a..660bcbcd 100644 --- a/src/seer/anomaly_detection/detectors/mp_scorers.py +++ b/src/seer/anomaly_detection/detectors/mp_scorers.py @@ -177,14 +177,14 @@ def _adjust_flag_for_vicinity( Time series subsequence that is used for teak-trough detection """ - if flag == "anomaly_higher_confidence" or flag == "anomaly_lower_confidence": - [Q1, Q3] = np.quantile(context, [0.25, 0.75]) - IQR = Q3 - Q1 - threshold_lower = Q1 - (0 * IQR) - threshold_upper = Q3 + (0 * IQR) - # if ts_value > Q1 and ts_value < Q3: - if ts_value >= threshold_lower and ts_value <= threshold_upper: - flag = "anomaly_lower_confidence" - else: - flag = "anomaly_higher_confidence" + # if flag == "anomaly_higher_confidence" or flag == "anomaly_lower_confidence": + # [Q1, Q3] = np.quantile(context, [0.25, 0.75]) + # IQR = Q3 - Q1 + # threshold_lower = Q1 - (0 * IQR) + # threshold_upper = Q3 + (0 * IQR) + # # if ts_value > Q1 and ts_value < Q3: + # if ts_value >= threshold_lower and ts_value <= threshold_upper: + # flag = "anomaly_lower_confidence" + # else: + # flag = "anomaly_higher_confidence" return flag