From 91aa92f153e024bdb5d5317ec9931aecbe716ab0 Mon Sep 17 00:00:00 2001 From: Auguste Baum Date: Fri, 20 Dec 2024 10:46:06 +0100 Subject: [PATCH] feat: Rename plot to "scores" --- examples/diagnose/plot_cross_validate.py | 4 ++-- examples/getting_started/plot_getting_started.py | 2 +- skore/src/skore/item/cross_validation_item.py | 2 +- .../sklearn/cross_validation/cross_validation_reporter.py | 4 ++-- skore/tests/unit/item/test_cross_validation_item.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/examples/diagnose/plot_cross_validate.py b/examples/diagnose/plot_cross_validate.py index 9ad7269c..11398e18 100644 --- a/examples/diagnose/plot_cross_validate.py +++ b/examples/diagnose/plot_cross_validate.py @@ -120,7 +120,7 @@ # %% reporter = skore.CrossValidationReporter(clf, X, y, cv=5) -reporter.plots.compare_scores +reporter.plots.scores # %% # Skore's :class:`~skore.CrossValidationReporter` advantages are the following: @@ -152,7 +152,7 @@ lasso = Lasso() reporter = skore.CrossValidationReporter(lasso, X, y, cv=5) -reporter.plots.compare_scores +reporter.plots.scores # %% # We can also access the plot after we have stored the ``CrossValidationReporter``: diff --git a/examples/getting_started/plot_getting_started.py b/examples/getting_started/plot_getting_started.py index 605093a4..d27f11b6 100644 --- a/examples/getting_started/plot_getting_started.py +++ b/examples/getting_started/plot_getting_started.py @@ -237,7 +237,7 @@ cv_reporter = CrossValidationReporter(Ridge(), X, y, cv=5) my_project.put("cv_reporter", cv_reporter) -cv_reporter.plots.compare_scores +cv_reporter.plots.scores # %% # Hence: diff --git a/skore/src/skore/item/cross_validation_item.py b/skore/src/skore/item/cross_validation_item.py index 978c08d0..0ad6979b 100644 --- a/skore/src/skore/item/cross_validation_item.py +++ b/skore/src/skore/item/cross_validation_item.py @@ -154,7 +154,7 @@ def factory(cls, reporter: CrossValidationReporter) -> CrossValidationItem: } humanized_plot_names = { - "compare_scores": "Scores", + "scores": "Scores", "timing": "Timings", "timing_normalized": "Normalized timings", } diff --git a/skore/src/skore/sklearn/cross_validation/cross_validation_reporter.py b/skore/src/skore/sklearn/cross_validation/cross_validation_reporter.py index 841fe63e..8dc52ab1 100644 --- a/skore/src/skore/sklearn/cross_validation/cross_validation_reporter.py +++ b/skore/src/skore/sklearn/cross_validation/cross_validation_reporter.py @@ -24,7 +24,7 @@ class CrossValidationPlots: """Plots of the cross-validation results.""" - compare_scores: plotly.graph_objects.Figure + scores: plotly.graph_objects.Figure timing: plotly.graph_objects.Figure timing_normalized: plotly.graph_objects.Figure @@ -187,7 +187,7 @@ def __repr__(self): def plots(self) -> CrossValidationPlots: """Plots of the cross-validation results.""" return CrossValidationPlots( - compare_scores=plot_cross_validation_compare_scores(self._cv_results), + scores=plot_cross_validation_compare_scores(self._cv_results), timing=plot_cross_validation_timing(self._cv_results), timing_normalized=plot_cross_validation_timing_normalized(self._cv_results), ) diff --git a/skore/tests/unit/item/test_cross_validation_item.py b/skore/tests/unit/item/test_cross_validation_item.py index 0336e268..6b99283d 100644 --- a/skore/tests/unit/item/test_cross_validation_item.py +++ b/skore/tests/unit/item/test_cross_validation_item.py @@ -30,7 +30,7 @@ class FakeCrossValidationReporter: X = numpy.array([[1.0]]) y = numpy.array([1]) plots = CrossValidationPlots( - compare_scores=plotly.graph_objects.Figure(), + scores=plotly.graph_objects.Figure(), timing=plotly.graph_objects.Figure(), timing_normalized=plotly.graph_objects.Figure(), )