Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxHalford committed Nov 2, 2023
1 parent 40a93c7 commit e9f8daf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/delete-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
my-job:
name: Delete all caches
runs-on: ubuntu-20.04
runs-on: ubuntu-latest

steps:
- name: Clear caches
Expand Down
20 changes: 10 additions & 10 deletions river/anomaly/sad.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,27 @@ class StandardAbsoluteDeviation(anomaly.base.SupervisedAnomalyDetector):
Examples
--------
>>> import numpy as np
>>> import random
>>> from river import anomaly
>>> from river import stats
>>> from river import stream
>>> np.random.seed(42)
>>> rng = random.Random(42)
>>> X = np.random.randn(150)
>>> model = anomaly.StandardAbsoluteDeviation(sub_stat=stats.Mean())
>>> model = anomaly.StandardAbsoluteDeviation(sub_stat="mean")
>>> for x in X:
... model = model.learn_one(None, x)
>>> for _ in range(150):
... y = rng.gauss(0, 1)
... model = model.learn_one(None, y)
>>> model.score_one(None, 2)
2.209735291993561
2.057...
>>> model.score_one(None, 0)
0.08736408615569183
0.084...
>>> model.score_one(None, 1)
1.1485496890746263
0.986...
"""

Expand Down

0 comments on commit e9f8daf

Please sign in to comment.