Skip to content

Commit

Permalink
feat: Rename plot to "scores"
Browse files Browse the repository at this point in the history
  • Loading branch information
augustebaum committed Dec 20, 2024
1 parent 46685f8 commit 91aa92f
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/diagnose/plot_cross_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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``:
Expand Down
2 changes: 1 addition & 1 deletion examples/getting_started/plot_getting_started.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion skore/src/skore/item/cross_validation_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def factory(cls, reporter: CrossValidationReporter) -> CrossValidationItem:
}

humanized_plot_names = {
"compare_scores": "Scores",
"scores": "Scores",
"timing": "Timings",
"timing_normalized": "Normalized timings",
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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),
)
2 changes: 1 addition & 1 deletion skore/tests/unit/item/test_cross_validation_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down

0 comments on commit 91aa92f

Please sign in to comment.