Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kulbachcedric committed May 5, 2024
1 parent e41691e commit 37cbb15
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ For further examples check out the <a href="https://online-ml.github.io/deep-riv

>>> for x, y in dataset:
... y_pred = model_pipeline.predict_one(x) # make a prediction
... metric = metric.update(y, y_pred) # update the metric
... model_pipeline = model_pipeline.learn_one(x, y) # make the model learn
... metric.update(y, y_pred) # update the metric
... model_pipeline.learn_one(x, y) # make the model learn
>>> print(f"Accuracy: {metric.get():.4f}")
Accuracy: 0.6728
Accuracy: 0.6736

```
### Multi Target Regression
Expand Down Expand Up @@ -115,7 +115,7 @@ Accuracy: 0.6728
>>> metric = metrics.multioutput.MicroAverage(metrics.MAE())
>>> ev = evaluate.progressive_val_score(dataset, model, metric)
>>> print(f"MicroAverage(MAE): {metric.get():.2f}")
MicroAverage(MAE): 28.36
MicroAverage(MAE): 34.31

```

Expand Down Expand Up @@ -153,11 +153,11 @@ MicroAverage(MAE): 28.36

>>> for x, y in dataset:
... score = model.score_one(x)
... model = model.learn_one(x=x)
... metric = metric.update(y, score)
... model.learn_one(x=x)
... metric.update(y, score)
...
>>> print(f"ROCAUC: {metric.get():.4f}")
ROCAUC: 0.7447
ROCAUC: 0.9017

```

Expand Down
6 changes: 3 additions & 3 deletions deep_river/anomaly/ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,11 @@ class Autoencoder(DeepEstimator, AnomalyDetector):
>>> for x, y in dataset:
... score = model.score_one(x)
... model = model.learn_one(x=x)
... metric = metric.update(y, score)
... model.learn_one(x=x)
... metric.update(y, score)
...
>>> print(f"ROCAUC: {metric.get():.4f}")
ROCAUC: 0.7447
ROCAUC: 0.9017
"""

def __init__(
Expand Down
4 changes: 2 additions & 2 deletions deep_river/anomaly/probability_weighted_ae.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ class ProbabilityWeightedAutoencoder(ae.Autoencoder):
>>> for x, y in dataset:
... score = model.score_one(x)
... model = model.learn_one(x=x)
... metric = metric.update(y, score)
... model.learn_one(x=x)
... metric.update(y, score)
...
>>> print(f"ROCAUC: {metric.get():.4f}")
ROCAUC: 0.8599
Expand Down
6 changes: 3 additions & 3 deletions deep_river/classification/classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ class Classifier(DeepEstimator, base.MiniBatchClassifier):
>>> for x, y in dataset:
... y_pred = model_pipeline.predict_one(x) # make a prediction
... metric = metric.update(y, y_pred) # update the metric
... model_pipeline = model_pipeline.learn_one(x,y)
... metric.update(y, y_pred) # update the metric
... model_pipeline.learn_one(x,y)
>>> print(f'Accuracy: {metric.get()}')
Accuracy: 0.6728
Accuracy: 0.6736
"""

def __init__(
Expand Down
6 changes: 3 additions & 3 deletions deep_river/classification/rolling_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ class RollingClassifier(Classifier, RollingDeepEstimator):
>>> for x, y in dataset.take(5000):
... y_pred = model_pipeline.predict_one(x) # make a prediction
... metric = metric.update(y, y_pred) # update the metric
... model = model_pipeline.learn_one(x, y) # make the model learn
... metric.update(y, y_pred) # update the metric
... model_pipeline.learn_one(x, y) # make the model learn
>>> print(f'Accuracy: {metric.get()}')
Accuracy: 0.4552
Accuracy: 0.4548
"""

def __init__(
Expand Down
8 changes: 4 additions & 4 deletions deep_river/classification/zoo.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class LogisticRegression(Classifier):
>>> for x, y in dataset:
... y_pred = model_pipeline.predict_one(x) # make a prediction
... metric = metric.update(y, y_pred) # update the metric
... model_pipeline = model_pipeline.learn_one(x, y) # update the model
... metric.update(y, y_pred) # update the metric
... model_pipeline.learn_one(x, y) # update the model
>>> print(f"Accuracy: {metric.get():.2f}")
Accuracy: 0.44
Expand Down Expand Up @@ -181,8 +181,8 @@ class MultiLayerPerceptron(Classifier):
>>> for x, y in dataset:
... y_pred = model_pipeline.predict_one(x) # make a prediction
... metric = metric.update(y, y_pred) # update the metric
... model_pipeline = model_pipeline.learn_one(x, y) # update the model
... metric.update(y, y_pred) # update the metric
... model_pipeline.learn_one(x, y) # update the model
>>> print(f"Accuracy: {metric.get():.2f}")
Accuracy: 0.44
Expand Down
2 changes: 1 addition & 1 deletion deep_river/regression/multioutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class MultiTargetRegressor(RiverMultiTargetRegressor, DeepEstimator):
>>> metric = metrics.multioutput.MicroAverage(metrics.MAE())
>>> ev = evaluate.progressive_val_score(dataset, model, metric)
>>> print(f"MicroAverage(MAE): {metric.get():.2f}")
MicroAverage(MAE): 28.36
MicroAverage(MAE): 34.31
"""

Expand Down

0 comments on commit 37cbb15

Please sign in to comment.