Skip to content

Commit

Permalink
Update sad.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Nov 2, 2023
1 parent 8d00d56 commit 40a93c7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions river/anomaly/sad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 40a93c7

Please sign in to comment.