Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Accept d2_absolute_error_score as named scorer #28836

Merged
merged 2 commits into from Apr 18, 2024

Conversation

ArturoAmorQ
Copy link
Member

Reference Issues/PRs

Follow-up from #28750. See also #22118.

What does this implement/fix? Explain your changes.

As mentioned in #28750 (comment), accepting d2_absolute_error_score as a named scorer (a string to be passed to scoring) could be a common enough practice to be worth the shortcut. In fact, such possibility is already documented in model_evaluation.rst L105.

Any other comments?

Snippet for testing:

from sklearn.datasets import load_diabetes
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import cross_val_score

X, y = load_diabetes(return_X_y=True)
model = LinearRegression()
cross_val_score(model, X, y, scoring="d2_absolute_error_score")

@ArturoAmorQ ArturoAmorQ added the Quick Review For PRs that are quick to review label Apr 15, 2024
Copy link

github-actions bot commented Apr 15, 2024

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 2ddd9a3. Link to the linter CI: here

@adrinjalali
Copy link
Member

Doesn't this also need to modify the score tables in the user guide?

@ArturoAmorQ
Copy link
Member Author

Doesn't this also need to modify the score tables in the user guide?

It is already documented in the user guide on main.

Copy link
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @ArturoAmorQ

@OmarManzoor OmarManzoor merged commit 05ee9dd into scikit-learn:main Apr 18, 2024
30 of 31 checks passed
@ArturoAmorQ ArturoAmorQ deleted the d2_absolute_error branch April 18, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants