-
-
Notifications
You must be signed in to change notification settings - Fork 25.5k
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
ENH Add Multiclass Brier Score Loss #22046
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Olivier Grisel <[email protected]>
Co-authored-by: Olivier Grisel <[email protected]>
I guess the scorer strings would instead be "neg_binary_brier_score" and "neg_multiclass_brier_score" (to enforce the greater is better model selection convention that is common to all our scorer string names) while we would also introduce two The The Then we would deprecate the "neg_brier_score" name and If that's right I can start working on reviving this PR to implement this plan. |
The first step, if I recall correctly, would be to add keyword to |
For the changelog, I first tried two entries |
sklearn/metrics/_classification.py
Outdated
|
||
|
||
def multiclass_brier_score_loss(y_true, y_prob, sample_weight=None, labels=None): | ||
r"""Compute the Brier score loss. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ogrisel Should we add a @validate_params
here ? It seems that all metrics have this decorator now. Also should we rename y_prob -> y_proba
? It seems to be the new convention (eg in brier_score_loss
)
Should we add array api support for |
Follow-up PR. Let's keep different features well separated by PRs. |
@ogrisel @lorentzenchr have you settled on the scorer strings / normalization keyword debate ? It's not clear to me with the above comments whether you prefer:
|
I am -1000 for 2 different functions for binary and multiclass. I want a single function dealing with both, as does |
Let's keep y_prob, it's still used a lot elsewhere and y_proba sounds like a weird Frenchism. |
The Then b60cb3b results in the following for
There is some ambiguity on binary vs multiclass when
@lorentzenchr @ogrisel are you happy with the current API ? |
I think the API makes sense, apart from the meaning of However, I am not sure about the Shall we not just error when Alternatively, This parameter could be named |
I guess only for the correspondence with the MSE, if we divide by What about |
+1 for This way we can automatically switch between the two formula of the Wikipedia page: https://en.wikipedia.org/wiki/Brier_score It's also backward compatible with the current implementation, while also giving control to the user if they prefer to use a different convention. What do you think of this proposal @lorentzenchr? |
In my opinion, it's important to keep the goal in sight: one Brier scoring function, ideally with no scaling (always range [0, 2]).
|
+1
To me, I am ok with raising a |
Resolves #16055.
This PR updates #18699 by @aggvarun01 after a merge with
main
and resolves merge conflicts. I do not have the permissions to push directly in the original branch and opening a sub-PR pointing to #18699 would lead to an unreadable diff because of the one-year merge sync.I also added a changelog entry and demonstrate the new function in the multiclass calibration example.
@aggvarun01 if you want feel free to pull the last commit from this commit from this branch to your branch. Alternatively we can finalize the review here.