Brier score for aligned targets, version 1¶
The Brier score is the weighted mean squared difference between predicted probabilities and targets. It runs from 0 to 1, and lower is better.
What does the Brier score penalise?¶
The cost grows with the square of the distance between the predicted probability and the target: a confident wrong answer costs far more than a hesitant one. The red line is the penalty, and so is the red term in the formula.
Numbers behind this figure
Event present
| Predicted probability | Brier score |
|---|---|
| 0 | 1.0000 |
| 0.05 | 0.9025 |
| 0.1 | 0.8100 |
| 0.15 | 0.7225 |
| 0.2 | 0.6400 |
| 0.25 | 0.5625 |
| 0.3 | 0.4900 |
| 0.35 | 0.4225 |
| 0.4 | 0.3600 |
| 0.45 | 0.3025 |
| 0.5 | 0.2500 |
| 0.55 | 0.2025 |
| 0.6 | 0.1600 |
| 0.65 | 0.1225 |
| 0.7 | 0.0900 |
| 0.75 | 0.0625 |
| 0.8 | 0.0400 |
| 0.85 | 0.0225 |
| 0.9 | 0.0100 |
| 0.95 | 0.0025 |
| 1 | 0.0000 |
Event absent
| Predicted probability | Brier score |
|---|---|
| 0 | 0.0000 |
| 0.05 | 0.0025 |
| 0.1 | 0.0100 |
| 0.15 | 0.0225 |
| 0.2 | 0.0400 |
| 0.25 | 0.0625 |
| 0.3 | 0.0900 |
| 0.35 | 0.1225 |
| 0.4 | 0.1600 |
| 0.45 | 0.2025 |
| 0.5 | 0.2500 |
| 0.55 | 0.3025 |
| 0.6 | 0.3600 |
| 0.65 | 0.4225 |
| 0.7 | 0.4900 |
| 0.75 | 0.5625 |
| 0.8 | 0.6400 |
| 0.85 | 0.7225 |
| 0.9 | 0.8100 |
| 0.95 | 0.9025 |
| 1 | 1.0000 |
Soft target 0.3
| Predicted probability | Brier score |
|---|---|
| 0 | 0.0900 |
| 0.05 | 0.0625 |
| 0.1 | 0.0400 |
| 0.15 | 0.0225 |
| 0.2 | 0.0100 |
| 0.25 | 0.0025 |
| 0.3 | 0.0000 |
| 0.35 | 0.0025 |
| 0.4 | 0.0100 |
| 0.45 | 0.0225 |
| 0.5 | 0.0400 |
| 0.55 | 0.0625 |
| 0.6 | 0.0900 |
| 0.65 | 0.1225 |
| 0.7 | 0.1600 |
| 0.75 | 0.2025 |
| 0.8 | 0.2500 |
| 0.85 | 0.3025 |
| 0.9 | 0.3600 |
| 0.95 | 0.4225 |
| 1 | 0.4900 |
Definition¶
This is a binary proper scoring rule evaluated independently for one class on
aligned targets and predictions. Both are finite probabilities in \([0, 1]\).
There is no implicit sigmoid, score calibration, or event-to-frame conversion.
Each frame has weight 1, or its duration in seconds when duration weighting is
selected. Finite, increasing nonnegative frame boundaries are required for the
latter. Empty inputs return None; invalid dimensions or values raise.
For targets \(y_i\), probabilities \(p_i\) and positive weights \(w_i\), the score is returned together with its numerator and weight:
The minimum is zero and the maximum is one. For a soft target \(q\), this is the squared distance to \(q\). The expected loss over a Bernoulli outcome \(Y\) adds a constant that this score leaves out:
Interpretation and verification¶
So the same prediction minimises both, while the reported values differ. Annotator agreement should not automatically be interpreted as a well-calibrated population probability. Macro and micro averaging are not yet offered. This is not a localization or alert-delay metric.
Example: targets [1, 0], probabilities [0.8, 0.1], equal weights yield
(0.04 + 0.01)/2 = 0.025. Binary target fixtures are compared with
sklearn.metrics.brier_score_loss with matching sample weights at 1e-12.
Source: Brier (1950).
Common questions¶
Is a lower Brier score better?¶
Yes. 0 is a perfect prediction of binary targets and 1 is the worst.
Does SEDMetrics apply a sigmoid first?¶
No. Inputs must already be probabilities between 0 and 1.