Skip to content

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 probabilityBrier score
01.0000
0.050.9025
0.10.8100
0.150.7225
0.20.6400
0.250.5625
0.30.4900
0.350.4225
0.40.3600
0.450.3025
0.50.2500
0.550.2025
0.60.1600
0.650.1225
0.70.0900
0.750.0625
0.80.0400
0.850.0225
0.90.0100
0.950.0025
10.0000

Event absent

Predicted probabilityBrier score
00.0000
0.050.0025
0.10.0100
0.150.0225
0.20.0400
0.250.0625
0.30.0900
0.350.1225
0.40.1600
0.450.2025
0.50.2500
0.550.3025
0.60.3600
0.650.4225
0.70.4900
0.750.5625
0.80.6400
0.850.7225
0.90.8100
0.950.9025
11.0000

Soft target 0.3

Predicted probabilityBrier score
00.0900
0.050.0625
0.10.0400
0.150.0225
0.20.0100
0.250.0025
0.30.0000
0.350.0025
0.40.0100
0.450.0225
0.50.0400
0.550.0625
0.60.0900
0.650.1225
0.70.1600
0.750.2025
0.80.2500
0.850.3025
0.90.3600
0.950.4225
10.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:

\[ \mathrm{BS} = \frac{\sum_i w_i\, \cost{(p_i - y_i)^2}}{\sum_i w_i} \]

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:

\[ \mathbb{E}\bigl[(p - Y)^2\bigr] = (p - q)^2 + q\,(1 - q) \]

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.