Scoring rule
In decision theory, a scoring rule[1] provides a summary measure for the evaluation of probabilistic predictions or forecasts. It is applicable to tasks in which predictions assign probabilities to events, i.e. one issues a probability distribution [math]\displaystyle{ F }[/math] as prediction. This includes probabilistic classification of a set of mutually exclusive outcomes or classes.
On the other hand, a scoring function[2] provides a summary measure for the evaluation of point predictions, i.e. one predicts a property or functional [math]\displaystyle{ T(F) }[/math], like the expectation or the median.
Scoring rules and scoring functions can be thought of as "cost function" or "loss function". They are evaluated as empirical mean of a given sample, simply called score. Scores of different predictions or models can then be compared to conclude which model is best.
If a cost is levied in proportion to a proper scoring rule, the minimal expected cost corresponds to reporting the true set of probabilities. Proper scoring rules are used in meteorology, finance, and pattern classification where a forecaster or algorithm will attempt to minimize the average score to yield refined, calibrated probabilities (i.e. accurate probabilities).
Motivation
Since the metrics in Evaluation of binary classifiers are not evaluating the calibration, scoring rules which can do so are needed. These scoring rules can be used as loss functions in empirical risk minimization.
Definition
Consider a sample space [math]\displaystyle{ \Omega }[/math], a σ-algebra [math]\displaystyle{ \mathcal A }[/math] of subsets of [math]\displaystyle{ \Omega }[/math] and a convex class [math]\displaystyle{ \mathcal F }[/math] of probability measures on [math]\displaystyle{ (\Omega, \mathcal A) }[/math]. A function defined on [math]\displaystyle{ \Omega }[/math] and taking values in the extended real line, [math]\displaystyle{ \overline{\mathbb{R}} = [-\infty, \infty] }[/math], is [math]\displaystyle{ \mathcal F }[/math]-quasi-integrable if it is measurable with respect to [math]\displaystyle{ \mathcal A }[/math] and is quasi-integrable with respect to all [math]\displaystyle{ F \in \mathcal{F} }[/math].
Probabilistic forecast
A probabilistic forecast is any probability measure [math]\displaystyle{ F \in \mathcal{F} }[/math].
Scoring rule
A scoring rule is any extended real-valued function [math]\displaystyle{ \mathbf{S}: \mathcal{F} \times \Omega \rightarrow \mathbb{R} }[/math] such that [math]\displaystyle{ \mathbf{S}(F, \cdot) }[/math] is [math]\displaystyle{ \mathcal F }[/math]-quasi-integrable for all [math]\displaystyle{ F \in \mathcal{F} }[/math]. [math]\displaystyle{ \mathbf{S}(F, y) }[/math] represents the loss or penalty when the forecast [math]\displaystyle{ F \in \mathcal{F} }[/math] is issued and the observation [math]\displaystyle{ y \in \Omega }[/math] materializes.
Point forecast
A point forecast is a functional, i.e. a potentially set-valued mapping [math]\displaystyle{ F \rightarrow T(F) \subseteq \Omega }[/math].
Scoring function
A scoring function is any real-valued function [math]\displaystyle{ S: \Omega \times \Omega \rightarrow \mathbb{R} }[/math] where [math]\displaystyle{ S(x, y) }[/math] represents the loss or penalty when the point forecast [math]\displaystyle{ x \in \Omega }[/math] is issued and the observation [math]\displaystyle{ y \in \Omega }[/math] materializes.
Orientation
Scoring rules [math]\displaystyle{ \mathbf{S}(F,y) }[/math] and scoring functions [math]\displaystyle{ S(x, y) }[/math] are negatively (positively) oriented if smaller (larger) values mean better. Here we adhere to negative orientation, hence the association with "loss".
Expected Score
We write for the expected score under [math]\displaystyle{ Q \in \mathcal{F} }[/math]
- [math]\displaystyle{ \mathbf{S}(F, Q) :=E_Y[S(F,Y)]= \int \mathbf{S}(F, \omega) \mathrm{d}Q(\omega) }[/math]
Sample average score
This article may require cleanup to meet Wikipedia's quality standards. The specific problem is: Needs attention from expert. Are the sample averages correct here? (September 2023) (Learn how and when to remove this template message) |
Given random samples [math]\displaystyle{ y_i, i=1\ldots n }[/math] and corresponding forecasts [math]\displaystyle{ F_i }[/math] or [math]\displaystyle{ x_i }[/math] (e.g. forecasts from a single model), one calculates the (importance sample) estimated expected score as
- [math]\displaystyle{ \bar{\mathbf{S}}:=\hat{E}_{F,Y}[S(F,Y)]=\frac{1}{n}\sum_i \mathbf{S}(F_i,y_i) }[/math]
or
- [math]\displaystyle{ \bar{S}:=\hat{E}_{X,Y}[S(X,Y)]=\frac{1}{n}\sum_i S(x_i,y_i) }[/math]
Average scores are used to compare and rank different forecast(er)s or models.
Propriety and consistency
Strictly proper scoring rules and strictly consistent scoring functions encourage honest forecasts by maximization of the expected reward: If a forecaster is given a reward of [math]\displaystyle{ -\mathbf{S}(F, y) }[/math] if [math]\displaystyle{ y }[/math] realizes (e.g. [math]\displaystyle{ y=rain }[/math]), then the highest expected reward (lowest score) is obtained by reporting the true probability distribution.[1]
Proper scoring rules
We write for the expected score under [math]\displaystyle{ Q \in \mathcal{F} }[/math]
- [math]\displaystyle{ \mathbf{S}(F, Q) = \int \mathbf{S}(F, \omega) \mathrm{d}Q(\omega) }[/math]
A scoring rule [math]\displaystyle{ \mathbf{S} }[/math] is proper relative to [math]\displaystyle{ \mathcal{F} }[/math] if (assuming negative orientation)
- [math]\displaystyle{ \mathbf{S}(Q, Q) \leq \mathbf{S}(F, Q) }[/math] for all [math]\displaystyle{ F,Q \in\mathcal{F} }[/math].
It is strictly proper if the above equation holds with equality if and only if [math]\displaystyle{ F=Q }[/math].
Consistent scoring functions
A scoring function [math]\displaystyle{ S }[/math] is consistent for the functional [math]\displaystyle{ T }[/math] relative to the class [math]\displaystyle{ \mathcal F }[/math] if
- [math]\displaystyle{ \operatorname{E}_F[S(t, Y)] \leq \operatorname{E}_F[S(x, Y)] }[/math] for all [math]\displaystyle{ F \in \mathcal{F} }[/math], all [math]\displaystyle{ t \in T(F) }[/math] and all [math]\displaystyle{ x \in \Omega }[/math].
It is strictly consistent if it is consistent and equality in the above equation implies that [math]\displaystyle{ x \in T(F) }[/math].
Example application of scoring rules
An example of probabilistic forecasting is in meteorology where a weather forecaster may give the probability of rain on the next day. One could note the number of times that a 25% probability was quoted, over a long period, and compare this with the actual proportion of times that rain fell. If the actual percentage was substantially different from the stated probability we say that the forecaster is poorly calibrated. A poorly calibrated forecaster might be encouraged to do better by a bonus system. A bonus system designed around a proper scoring rule will incentivize the forecaster to report probabilities equal to his personal beliefs.[3]
In addition to the simple case of a binary decision, such as assigning probabilities to 'rain' or 'no rain', scoring rules may be used for multiple classes, such as 'rain', 'snow', or 'clear', or continuous responses like the amount of rain per day.
The image to the right shows an example of a scoring rule, the logarithmic scoring rule, as a function of the probability reported for the event that actually occurred. One way to use this rule would be as a cost based on the probability that a forecaster or algorithm assigns, then checking to see which event actually occurs.
Examples of proper scoring rules
There are an infinite number of scoring rules, including entire parameterized families of strictly proper scoring rules. The ones shown below are simply popular examples.
Categorical variables
For a categorical response variable with [math]\displaystyle{ m }[/math] mutually exclusive events, [math]\displaystyle{ Y \in \Omega = \{1, \ldots, m\} }[/math], a probabilistic forecaster or algorithm will return a probability vector [math]\displaystyle{ \mathbf{r} }[/math] with a probability for each of the [math]\displaystyle{ m }[/math] outcomes.
Logarithmic score
The logarithmic scoring rule is a local strictly proper scoring rule. This is also the negative of surprisal, which is commonly used as a scoring criterion in Bayesian inference; the goal is to minimize expected surprise. This scoring rule has strong foundations in information theory.
- [math]\displaystyle{ L(\mathbf{r},i) = \ln(r_i) }[/math]
Here, the score is calculated as the logarithm of the probability estimate for the actual outcome. That is, a prediction of 80% that correctly proved true would receive a score of ln(0.8) = −0.22. This same prediction also assigns 20% likelihood to the opposite case, and so if the prediction proves false, it would receive a score based on the 20%: ln(0.2) = −1.6. The goal of a forecaster is to maximize the score and for the score to be as large as possible, and −0.22 is indeed larger than −1.6.
If one treats the truth or falsity of the prediction as a variable x with value 1 or 0 respectively, and the expressed probability as p, then one can write the logarithmic scoring rule as x ln(p) + (1 − x) ln(1 − p). Note that any logarithmic base may be used, since strictly proper scoring rules remain strictly proper under linear transformation. That is:
- [math]\displaystyle{ L(\mathbf{r},i) = \log_b(r_i) }[/math]
is strictly proper for all [math]\displaystyle{ b\gt 1 }[/math].
Brier/Quadratic score
The quadratic scoring rule is a strictly proper scoring rule
- [math]\displaystyle{ Q(\mathbf{r},i) = 2r_i - \mathbf{r}\cdot \mathbf{r} = 2r_i -\sum_{j=1}^C r_j^2 }[/math]
where [math]\displaystyle{ r_i }[/math] is the probability assigned to the correct answer and [math]\displaystyle{ C }[/math] is the number of classes.
The Brier score, originally proposed by Glenn W. Brier in 1950,[4] can be obtained by an affine transform from the quadratic scoring rule.
- [math]\displaystyle{ B(\mathbf{r},i) = \sum_{j=1}^C (y_j-r_j)^2 }[/math]
Where [math]\displaystyle{ y_j = 1 }[/math] when the [math]\displaystyle{ j }[/math]th event is correct and [math]\displaystyle{ y_j = 0 }[/math] otherwise and [math]\displaystyle{ C }[/math] is the number of classes.
An important difference between these two rules is that a forecaster should strive to maximize the quadratic score [math]\displaystyle{ Q }[/math] yet minimize the Brier score [math]\displaystyle{ B }[/math]. This is due to a negative sign in the linear transformation between them.
Hyvärinen scoring rule
The Hyvärinen scoring function (of a density p) is defined by[5]
- [math]\displaystyle{ s(p) = 2 \Delta_y \log p(y) + \|\nabla_y \log p(y)\|_2^2 }[/math]
Where [math]\displaystyle{ \Delta }[/math] denotes the Hessian trace and [math]\displaystyle{ \nabla }[/math] denotes the gradient. This scoring rule can be used to computationally simplify parameter inference and address Bayesian model comparison with arbitrarily-vague priors.[5][6] It was also used to introduce new information-theoretic quantities beyond the existing information theory.[7]
Spherical score
The spherical scoring rule is also a strictly proper scoring rule
- [math]\displaystyle{ S(\mathbf{r},i) = \frac{r_i}{\lVert \mathbf{r} \rVert} = \frac{r_i}{\sqrt{r_1^2 + \cdots + r_c^2}} }[/math]
Continuous variables
Continuous ranked probability score
The continuous ranked probability score (CRPS)[8] is a strictly proper scoring rule much used in Meteorology. It is defined as
[math]\displaystyle{ CRPS(F,y)=\int_\mathbb{R} ( F(x) - H(x \ge y) ) ^2 dx }[/math]
where [math]\displaystyle{ F }[/math] is the forecast cumulative distribution function, [math]\displaystyle{ H }[/math] is the Heaviside step function and [math]\displaystyle{ y \in \mathbb R }[/math] is the observation. Note that the forecast estimates multiple probabilities, so that a cumulative distribution function [math]\displaystyle{ F }[/math] arises.
Interpretation of proper scoring rules
All proper scoring rules are equal to weighted sums (integral with a non-negative weighting functional) of the losses in a set of simple two-alternative decision problems that use the probabilistic prediction, each such decision problem having a particular combination of associated cost parameters for false positive and false negative decisions. A strictly proper scoring rule corresponds to having a nonzero weighting for all possible decision thresholds. Any given proper scoring rule is equal to the expected losses with respect to a particular probability distribution over the decision thresholds; thus the choice of a scoring rule corresponds to an assumption about the probability distribution of decision problems for which the predicted probabilities will ultimately be employed, with for example the quadratic loss (or Brier) scoring rule corresponding to a uniform probability of the decision threshold being anywhere between zero and one. The classification accuracy score (percent classified correctly), a single-threshold scoring rule which is zero or one depending on whether the predicted probability is on the appropriate side of 0.5, is a proper scoring rule but not a strictly proper scoring rule because it is optimized (in expectation) not only by predicting the true probability but by predicting any probability on the same side of 0.5 as the true probability.[9][10][11][12][13][14]
Comparison of strictly proper scoring rules
Shown below on the left is a graphical comparison of the Logarithmic, Quadratic, and Spherical scoring rules for a binary classification problem. The x-axis indicates the reported probability for the event that actually occurred.
It is important to note that each of the scores have different magnitudes and locations. The magnitude differences are not relevant however as scores remain proper under affine transformation. Therefore, to compare different scores it is necessary to move them to a common scale. A reasonable choice of normalization is shown at the picture on the right where all scores intersect the points (0.5,0) and (1,1). This ensures that they yield 0 for a uniform distribution (two probabilities of 0.5 each), reflecting no cost or reward for reporting what is often the baseline distribution. All normalized scores below also yield 1 when the true class is assigned a probability of 1.
Characteristics
Affine transformation
A strictly proper scoring rule, whether binary or multiclass, after an affine transformation remains a strictly proper scoring rule.[3] That is, if [math]\displaystyle{ S(\mathbf{r},i) }[/math] is a strictly proper scoring rule then [math]\displaystyle{ a+bS(\mathbf{r},i) }[/math] with [math]\displaystyle{ b \neq 0 }[/math] is also a strictly proper scoring rule, though if [math]\displaystyle{ b \lt 0 }[/math] then the optimization sense of the scoring rule switches between maximization and minimization.
Locality
A proper scoring rule is said to be local if its estimate for the probability of a specific event depends only on the probability of that event. This statement is vague in most descriptions but we can, in most cases, think of this as the optimal solution of the scoring problem "at a specific event" is invariant to all changes in the observation distribution that leave the probability of that event unchanged. All binary scores are local because the probability assigned to the event that did not occur is determined so there is no degree of flexibility to vary over.
Affine functions of the logarithmic scoring rule are the only strictly proper local scoring rules on a finite set that is not binary.
Decomposition
The expectation value of a proper scoring rule [math]\displaystyle{ S }[/math] can be decomposed into the sum of three components, called uncertainty, reliability, and resolution,[15][16] which characterize different attributes of probabilistic forecasts:
- [math]\displaystyle{ E(S) = \mathrm{UNC} + \mathrm{REL} - \mathrm{RES}. }[/math]
If a score is proper and negatively oriented (such as the Brier Score), all three terms are positive definite. The uncertainty component is equal to the expected score of the forecast which constantly predicts the average event frequency. The reliability component penalizes poorly calibrated forecasts, in which the predicted probabilities do not coincide with the event frequencies.
The equations for the individual components depend on the particular scoring rule. For the Brier Score, they are given by
- [math]\displaystyle{ \mathrm{UNC} = \bar{x}(1-\bar{x}) }[/math]
- [math]\displaystyle{ \mathrm{REL} = E(p-\pi(p))^2 }[/math]
- [math]\displaystyle{ \mathrm{RES} = E(\pi(p)-\bar{x})^2 }[/math]
where [math]\displaystyle{ \bar{x} }[/math] is the average probability of occurrence of the binary event [math]\displaystyle{ x }[/math], and [math]\displaystyle{ \pi(p) }[/math] is the conditional event probability, given [math]\displaystyle{ p }[/math], i.e. [math]\displaystyle{ \pi(p) = P(x=1\mid p) }[/math]
Problems
Extreme class imbalance poses a major problem for obtaining good probability estimates.[17]
See also
Literature
- Strictly Proper Scoring Rules, Prediction, and Estimation. Tilmann Gneiting &Adrian E Raftery Pages 359-378, https://doi.org/10.1198/016214506000001437, pdf
References
- ↑ 1.0 1.1 Gneiting, Tilmann; Raftery, Adrian E. (2007). "Strictly Proper Scoring Rules, Prediction, and Estimation". Journal of the American Statistical Association 102 (447): 359–378. doi:10.1198/016214506000001437. https://sites.stat.washington.edu/raftery/Research/PDF/Gneiting2007jasa.pdf.
- ↑ Gneiting, Tilmann (2011). "Making and Evaluating Point Forecasts". Journal of the American Statistical Association 106 (494): 746–762. doi:10.1198/jasa.2011.r10138.
- ↑ 3.0 3.1 Bickel, E.J. (2007). "Some Comparisons among Quadratic, Spherical, and Logarithmic Scoring Rules". Decision Analysis 4 (2): 49–65. doi:10.1287/deca.1070.0089. http://faculty.engr.utexas.edu/bickel/Papers/QSL_Comparison.pdf.
- ↑ Brier, G.W. (1950). "Verification of forecasts expressed in terms of probability". Monthly Weather Review 78 (1): 1–3. doi:10.1175/1520-0493(1950)078<0001:VOFEIT>2.0.CO;2. Bibcode: 1950MWRv...78....1B. http://docs.lib.noaa.gov/rescue/mwr/078/mwr-078-01-0001.pdf.
- ↑ 5.0 5.1 Hyvärinen, Aapo (2005). "Estimation of Non-Normalized Statistical Models by Score Matching". Journal of Machine Learning Research 6 (24): 695–709. ISSN 1533-7928. http://jmlr.org/papers/v6/hyvarinen05a.html.
- ↑ Shao, Stephane; Jacob, Pierre E.; Ding, Jie; Tarokh, Vahid (2019-10-02). "Bayesian Model Comparison with the Hyvärinen Score: Computation and Consistency". Journal of the American Statistical Association 114 (528): 1826–1837. doi:10.1080/01621459.2018.1518237. ISSN 0162-1459. https://doi.org/10.1080/01621459.2018.1518237.
- ↑ Ding, Jie; Calderbank, Robert; Tarokh, Vahid (2019). "Gradient Information for Representation and Modeling". Advances in Neural Information Processing Systems 32: 2396–2405. http://papers.neurips.cc/paper/8510-gradient-information-for-representation-and-modeling.
- ↑ Zamo, Michaël; Naveau, Philippe (2018-02-01). "Estimation of the Continuous Ranked Probability Score with Limited Information and Applications to Ensemble Weather Forecasts" (in en). Mathematical Geosciences 50 (2): 209–234. doi:10.1007/s11004-017-9709-7. ISSN 1874-8953.
- ↑ Leonard J. Savage. Elicitation of personal probabilities and expectations. J. of the American Stat. Assoc., 66(336):783–801, 1971.
- ↑ Schervish, Mark J. (1989). "A General Method for Comparing Probability Assessors", Annals of Statistics 17(4) 1856–1879, https://projecteuclid.org/euclid.aos/1176347398
- ↑ Rosen, David B. (1996). "How good were those probability predictions? The expected recommendation loss (ERL) scoring rule". in Heidbreder, G.. Kluwer, Dordrecht, The Netherlands.
- ↑ Roulston, M. S., & Smith, L. A. (2002). Evaluating probabilistic forecasts using information theory. Monthly Weather Review, 130, 1653–1660. See APPENDIX "Skill Scores and Cost–Loss". [1]
- ↑ "Loss Functions for Binary Class Probability Estimation and Classification: Structure and Applications", Andreas Buja, Werner Stuetzle, Yi Shen (2005) http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.184.5203
- ↑ Hernandez-Orallo, Jose; Flach, Peter; and Ferri, Cesar (2012). "A Unified View of Performance Metrics: Translating Threshold Choice into Expected Classification Loss." Journal of Machine Learning Research 13 2813–2869. http://www.jmlr.org/papers/volume13/hernandez-orallo12a/hernandez-orallo12a.pdf
- ↑ Murphy, A.H. (1973). "A new vector partition of the probability score". Journal of Applied Meteorology 12 (4): 595–600. doi:10.1175/1520-0450(1973)012<0595:ANVPOT>2.0.CO;2. Bibcode: 1973JApMe..12..595M.
- ↑ Bröcker, J. (2009). "Reliability, sufficiency, and the decomposition of proper scores". Quarterly Journal of the Royal Meteorological Society 135 (643): 1512–1519. doi:10.1002/qj.456. Bibcode: 2009QJRMS.135.1512B. http://www.personal.reading.ac.uk/~pt904209/publications/decomposition_qjrms.pdf.
- ↑ Wallace, Byron & Dahabreh, Issa. (2012). Class Probability Estimates are Unreliable for Imbalanced Data (and How to Fix Them). Proceedings - IEEE International Conference on Data Mining, ICDM. 695-704. doi:10.1109/ICDM.2012.115
External links
- Video comparing spherical, quadratic and logarithmic scoring rules
- Local Proper Scoring Rules
- Scoring Rules and Decision Analysis Education
- Strictly Proper Scoring Rules
- Scoring Rules and uncertainty
- Damage Caused by Classification Accuracy and Other Discontinuous Improper Accuracy Scoring Rules
Original source: https://en.wikipedia.org/wiki/Scoring rule.
Read more |