diff --git a/river/anomaly/sad.py b/river/anomaly/sad.py index 21c1803618..ae691d9a16 100644 --- a/river/anomaly/sad.py +++ b/river/anomaly/sad.py @@ -65,13 +65,11 @@ def __init__(self, sub_stat: stats.base.Univariate = None): def learn_one(self, x, y): self.variance.update(y) - self.subtracted_statistic_estimator.update(y) + self.sub_stat.update(y) return self def score_one(self, x, y): - score = (y - self.subtracted_statistic_estimator.get()) / ( - self.variance.get() ** 0.5 + 1e-10 - ) + score = (y - self.sub_stat.get()) / (self.variance.get() ** 0.5 + 1e-10) return abs(score)