-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Add multiclass support for brier_score_loss #16055
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
Comments
The version of Brier Score currently implemented in scikit-learn is: (where y_hat is the probability of the positive class) This can be replaced by the multi-class formula, which is valid for the binary case as well: Unless we use the new formula, we still need 'pos_label' for the binary case. However, if the new formula is used for the binary case, it won't be backwards compatible, since when the new formula is used for the binary case, it is twice the value obtained from the old formula. This also means that the range of Brier Score will no longer be between 0 and 1 for the multiclass case. The workaround I can think of is to keep the binary case as is, and then implement the new formula for the multi-class case which can ignore 'pos_label'. The only downside to this approach is that users can expect to see a sudden jump in brier score when going from 2 classes to 3. However, I don't expect users to compare Brier Scores across models with different number of classes, so I think this should be fine. The second workaround, similar to the 'measures' package in R, is to have a separate function called multiclass_brier. Will be very happy to implement this. [EDITED] |
Hello @ogrisel, is this still not merged? It would be really useful for my current use case. Thank you! |
See #22046 (comment) for a decision that was made on how to implement it. |
Feature Request: The original formulation for Brier score inherently supports multiclass classification [source]. This is currently absent in scikit-learn, which restricts Brier score to binary classification.
I have found it useful to have multiclass brier_score_loss when comparing calibration, and have a custom function for the same. I would be happy to work on this and port the code to the scikit-learn API.
The text was updated successfully, but these errors were encountered: