You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect interpretation of Brier score loss in docstring #10883
Therefore, the lower the Brier score is for a set of predictions, the
Therefore, the lower the Brier score is for a set of predictions, the better the predictions are calibrated.
As far as I can tell, this claim is incorrect (also incorrect in the Wikipedia entry cited) and should be deleted or detailed (one component of the two-term decomposition of the Brier score does assess calibration).
Here's a counter-example on a dataset with 12 points and 2 estimators.
I'm not familiar enough with this to evaluate it. Why do you consider model B a worse calibration? Can you find literature that makes a similar critique, or more clearly defines what calibration means?
I am looking to help with this project, but am having troubles getting the build to work properly. I am having particular difficulty with Atlas and Openblas. Where can I get some assisstance on this? Thanks!
@ericjam3 first search in the issues for a similar problem. If that does not solve your problem, open a new issue with the command you ran and the full error you get. An alternative is to ask on the mailing list: [email protected].
In general try to refrain from commenting in an issue if it is not 95% clear that your problem is related to its first post.
Suppose that a forecaster sequentially assigns probabilities to events. He is well calibrated if, for example, of those events to which he assigns a probability 30 percent, the long-run proportion that actually occurs turns out to be 30 percent.
In the example model A is well calibrated for all the predicted probabilities (0, 0.25, 0.5, 0.75 and 1) but model B is not well calibrated for probabilities 0.25 and 0.75 as 100% of predicted 0.25 (resp. 0.75) are in output class 0 (resp. 1), instead of 75%.
The Brier score can be decomposed as the sum of a calibration loss and a refinement loss (referred to as the "two-component decomposition" in the Wikipedia entry). The refinement measures the ability to distinguish between the classes across threshold bins. The best case for refinement is for all threshold bins the classes proportion is 100%-0%, and in the worst case the proportion is always 50%-50%.
So the following claim would be correct:
The Brier score can be decomposed as the sum of calibration and refinement losses, where the refinement loss measures the ability of the model to distinguish between the classes across threshold bins. Therefore, assuming equal refinement, the lower the Brier score is for a set of predictions, the better the predictions are calibrated.
I think that what you are saying makes sense. To minimize the briere_loss you want something that is a Heaviside function which is not the same as a well-calibrated classifier for which you want to be along the diagonal (if your classifier says proba=0.25, you want that 25% of your samples are actual ones that are misclassified as zeroes).
It seems like the primary motivation for introducing briere_score_loss was to judge the calibration of classifiers though. For example, this documentation page says: "The calibration performance is evaluated with Brier score brier_score_loss, reported in the legend (the smaller the better)."
@samronsin what would be a better measure to judge the calibration of a classifier?
Two further metrics relevant in the context of calibration are Expected Calibration Error (ECE) and Maximum Calibration Error (MCE) as proposed and used in the following papers:
Thanks for the references @amueller and @jmetzen ! I ended up implementing ECE and MCE from "Chuan Guo, Geoff Pleiss, Yu Sun, Kilian Q. Weinberger, On Calibration of Modern Neural Networks" in PR #11096.
Sorry @53X I didn't see that you were also interested in working on this. Let me know if you want to compare notes !
Activity
jnothman commentedon Mar 28, 2018
I'm not familiar enough with this to evaluate it. Why do you consider model B a worse calibration? Can you find literature that makes a similar critique, or more clearly defines what calibration means?
ericjam3 commentedon Mar 29, 2018
I am looking to help with this project, but am having troubles getting the build to work properly. I am having particular difficulty with Atlas and Openblas. Where can I get some assisstance on this? Thanks!
lesteve commentedon Mar 29, 2018
@ericjam3 first search in the issues for a similar problem. If that does not solve your problem, open a new issue with the command you ran and the full error you get. An alternative is to ask on the mailing list: [email protected].
In general try to refrain from commenting in an issue if it is not 95% clear that your problem is related to its first post.
samronsin commentedon Mar 29, 2018
Quoting from The well-calibrated Bayesian, A.P. Dawid, Journal of the American Statistical Association, 1982:
In the example model A is well calibrated for all the predicted probabilities (0, 0.25, 0.5, 0.75 and 1) but model B is not well calibrated for probabilities 0.25 and 0.75 as 100% of predicted 0.25 (resp. 0.75) are in output class 0 (resp. 1), instead of 75%.
jnothman commentedon Mar 29, 2018
samronsin commentedon Mar 29, 2018
The Brier score can be decomposed as the sum of a calibration loss and a refinement loss (referred to as the "two-component decomposition" in the Wikipedia entry). The refinement measures the ability to distinguish between the classes across threshold bins. The best case for refinement is for all threshold bins the classes proportion is 100%-0%, and in the worst case the proportion is always 50%-50%.
So the following claim would be correct:
lesteve commentedon Mar 29, 2018
I think that what you are saying makes sense. To minimize the briere_loss you want something that is a Heaviside function which is not the same as a well-calibrated classifier for which you want to be along the diagonal (if your classifier says proba=0.25, you want that 25% of your samples are actual ones that are misclassified as zeroes).
It seems like the primary motivation for introducing briere_score_loss was to judge the calibration of classifiers though. For example, this documentation page says: "The calibration performance is evaluated with Brier score brier_score_loss, reported in the legend (the smaller the better)."
@samronsin what would be a better measure to judge the calibration of a classifier?
lesteve commentedon Mar 29, 2018
ping @jmetzen and @agramfort who were involved in #1176.
samronsin commentedon Mar 29, 2018
The calibration loss that we would want to minimize should be roughly:
To avoid several (1/step_size) sequential full passes on the data it could be parallelized and / or y_pred could be sorted.
amueller commentedon Apr 5, 2018
I was thinking about this recently and yes, adding a calibration loss would be nice. There are several definitions. Some are using just the distance in the calibration curve (I think that's @samronsin's version).
This paper has some discussion:
https://www.math.ucdavis.edu/~saito/data/roc/ferri-class-perf-metrics.pdf
This paper has the definition of a more refined calibration loss based on the ROC curve:
https://pdfs.semanticscholar.org/7618/8dba4c840c638642cdbaa8fb196ec83cac16.pdf
(CalL in the paper above, while the code by @samronsin is CalB, I think).
aishgrt1 commentedon Apr 12, 2018
PR has been created for this. #10964
jmetzen commentedon Apr 13, 2018
Two further metrics relevant in the context of calibration are Expected Calibration Error (ECE) and Maximum Calibration Error (MCE) as proposed and used in the following papers:
Naeini, Mahdi Pakdaman, Cooper, Gregory F, and Hauskrecht, Milos. Obtaining well calibrated probabilities using bayesian binning. In AAAI, pp. 2901, 2015.
https://people.cs.pitt.edu/~milos/research/AAAI_Calibration.pdf
Chuan Guo, Geoff Pleiss, Yu Sun, Kilian Q. Weinberger, On Calibration of Modern Neural Networks
https://arxiv.org/abs/1706.04599
53X commentedon Apr 22, 2018
@jmetzen can I take this challenge of coding up the ECE and MCE as proposed by the papers given above?
jmetzen commentedon Apr 23, 2018
sure, that would be great @53X !
samronsin commentedon May 15, 2018
Thanks for the references @amueller and @jmetzen ! I ended up implementing ECE and MCE from "Chuan Guo, Geoff Pleiss, Yu Sun, Kilian Q. Weinberger, On Calibration of Modern Neural Networks" in PR #11096.
Sorry @53X I didn't see that you were also interested in working on this. Let me know if you want to compare notes !
ogrisel commentedon Jun 10, 2020
Reopening as #11096 is about implementing an alternative to Brier score but the Brier score docstring still needs to be fixed.
ogrisel commentedon Jun 10, 2020
Here is a good suggestion: #10883 (comment)
We should also link to https://en.wikipedia.org/wiki/Brier_score#Two-component_decomposition
ogrisel commentedon Jun 10, 2020
Actually I was confused. This was fixed in #10969.