Skip to content

Commit

Permalink
Update gaussian.py
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Jul 29, 2023
1 parent b877000 commit 3525891
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions river/anomaly/gaussian.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def __init__(self, window_size=None, grace_period=100):
)
self.grace_period = grace_period

def learn_one(self, _, y):
def learn_one(self, x, y):
self.gaussian.update(y)
return self

def score_one(self, _, y):
def score_one(self, x, y):
if self.gaussian.n_samples < self.grace_period:
return 0
return 2 * abs(self.gaussian.cdf(y) - 0.5)

0 comments on commit 3525891

Please sign in to comment.