diff --git a/CHANGELOG.md b/CHANGELOG.md index b99b7a95..732e22fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update the Client, it takes a backend type instead of debug=True + env variable to set the spawner - (#210) - Do not use Model.category since this field is being removed from the SDK +- Update the tests and benchmark with the change on Metrics from substratools (#24) ### Changed @@ -260,7 +261,7 @@ import substratools as tools from sklearn.metrics import roc_auc_score -class AUC(tools.Metrics): +class AUC(tools.MetricAlgo): def score(self, y_true, y_pred): """AUC""" metric = roc_auc_score(y_true, y_pred) if len(set(y_true)) > 1 else 0 @@ -269,7 +270,7 @@ class AUC(tools.Metrics): if __name__ == "__main__": - tools.metrics.execute(AUC()) + tools.algo.execute(AUC()) ``` the metric files should look like: @@ -280,7 +281,7 @@ import substratools as tools from sklearn.metrics import roc_auc_score -class AUC(tools.Metrics): +class AUC(tools.MetricAlgo): def score(self, inputs, outputs): """AUC""" @@ -293,7 +294,7 @@ class AUC(tools.Metrics): if __name__ == "__main__": - tools.metrics.execute(AUC()) + tools.algo.execute(AUC()) ``` ## 0.26.0 - 2022-08-22 diff --git a/benchmark/camelyon/pure_substrafl/assets/metric.py b/benchmark/camelyon/pure_substrafl/assets/metric.py index cb764565..18cb1cbd 100644 --- a/benchmark/camelyon/pure_substrafl/assets/metric.py +++ b/benchmark/camelyon/pure_substrafl/assets/metric.py @@ -3,7 +3,7 @@ from sklearn.metrics import roc_auc_score -class AUC(tools.Metrics): +class AUC(tools.MetricAlgo): def score(self, inputs, outputs, task_properties): """AUC""" @@ -19,4 +19,4 @@ def get_predictions(self, path): if __name__ == "__main__": - tools.metrics.execute(AUC()) + tools.algo.execute(AUC()) diff --git a/tests/assets_factory.py b/tests/assets_factory.py index e47de89d..19c4d5e1 100644 --- a/tests/assets_factory.py +++ b/tests/assets_factory.py @@ -34,7 +34,8 @@ import substratools as tools import math import numpy as np -class AccuracyMetric(tools.Metrics): + +class AccuracyMetric(tools.MetricAlgo): def score(self, inputs, outputs, task_properties): # Datasamples are passed as a tuple of two elements: x and y y_true = inputs['{InputIdentifiers.datasamples}'][1] @@ -46,7 +47,7 @@ def load_predictions(self, path): if __name__ == "__main__": - tools.metrics.execute(AccuracyMetric()) + tools.algo.execute(AccuracyMetric()) """ DEFAULT_OPENER_FILE = """