Skip to content

Commit

Permalink
address comments auguste
Browse files Browse the repository at this point in the history
  • Loading branch information
glemaitre committed Feb 10, 2025
1 parent ecc7a8c commit ad5d500
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions skore/src/skore/sklearn/_cross_validation/metrics_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -731,6 +731,8 @@ def custom_metric(
Ridge Split #0 50.1...
Split #1 52.6...
"""
# create a scorer with `greater_is_better=True` to not alter the output of
# `metric_function`
scorer = make_scorer(
metric_function,
greater_is_better=True,
Expand Down
7 changes: 7 additions & 0 deletions skore/src/skore/sklearn/_estimator/metrics_accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,13 @@ def custom_metric(
... response_method="predict",
... )
44.9...
>>> def metric_function(y_true, y_pred):
... return {"output": float(mean_absolute_error(y_true, y_pred))}
>>> report.metrics.custom_metric(
... metric_function=metric_function,
... response_method="predict",
... )
{'output': 44.9...}
"""
return self._custom_metric(
data_source=data_source,
Expand Down

0 comments on commit ad5d500

Please # to comment.