From a2e4bc3bc592859dcf3f13cac3751fded8c98d6f Mon Sep 17 00:00:00 2001 From: kidluo <2438863173@qq.com> Date: Tue, 21 May 2019 15:44:15 +0800 Subject: [PATCH] Update exp_avg_detector.py abs bug fix --- .../algorithms/anomaly_detector_algorithms/exp_avg_detector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/luminol/algorithms/anomaly_detector_algorithms/exp_avg_detector.py b/src/luminol/algorithms/anomaly_detector_algorithms/exp_avg_detector.py index f7870f9..39be708 100644 --- a/src/luminol/algorithms/anomaly_detector_algorithms/exp_avg_detector.py +++ b/src/luminol/algorithms/anomaly_detector_algorithms/exp_avg_detector.py @@ -77,7 +77,7 @@ def _compute_anom_data_decay_all(self): ema = utils.compute_ema(self.smoothing_factor, values) stdev = numpy.std(values) for i, (timestamp, value) in enumerate(self.time_series_items): - anom_score = abs((value - ema[i]) / stdev) if stdev else value - ema[i] + anom_score = abs((value - ema[i]) / stdev) if stdev else abs(value - ema[i]) anom_scores[timestamp] = anom_score self.anom_scores = TimeSeries(self._denoise_scores(anom_scores))