Skip to content

Evaluation, diagnostics, benchmarks, and additional tests · Evaluation, diagnostics, benchmarks, and additional hypothesis tests · EVA026 · Metric

Brier score

Evaluates probabilistic predictions with a squared-error proper scoring rule.

Runs in CodeSplash Complete calculation CodeSplash's run and the reference's record

In CodeSplash

A CodeSplash method runs this entry in Python and R. Set it up from the method's page.

Do it in CodeSplash Run it on your own data, in Python or R.

Availability
Runs in CodeSplash
Code example
Complete calculation
Who ran it
CodeSplash's run and the reference's record
CodeSplash's run
Verified in Python and R through diagnostic.calibration. The reference's example ran in Python and R here, and they agree.
The reference's record
Python: Ran in the reference's review. The report doesn't record which version of the code ran. R: Reviewed but not run: R wasn't available to the reference's authors.

Purpose

Evaluates probabilistic predictions with a squared-error proper scoring rule.

Question / hypotheses

How accurate are the entire predicted probabilities, rather than only the winning class?

Architecture / computational structure

A fixed scoring/calibration pipeline applied to model outputs or supplied observations; the formula and usage sections identify its operations.

Assumptions

Outcomes and probability columns must be aligned and probabilities normalized. Choose binary or multiclass normalization explicitly.

Formula / computational definition

BS=1n∑i∑c=1C(pic−1{yi=c})2.BS=\frac1n\sum_i\sum_{c=1}^C(p_{ic}-\mathbf1\{y_i=c\})^2.

Parameters and notation

p_ic are model probabilities; no metric parameters are fitted. For binary data, the one-column convention gives half the corresponding two-column score.

Fitting, fine-tuning, and adaptation

There is no model fine-tuning step for this evaluation procedure. Freeze the evaluated systems and evaluator before the final test. Select evaluation settings on development data; if a learned evaluator or calibration model is adapted, use separate fitting data, version it, and reassess its validity.

How to use and calibrate

Evaluate on untouched examples, compare with a prevalence-only forecast, and report relevant subgroup or time slices. Pair with reliability diagrams to separate calibration questions from overall scoring performance.

Example application

Compare anomaly risk probabilities after supervised calibration on a labeled validation subset.

Interpretation / pitfalls

Watch out

The score includes discrimination and calibration effects; it is not a pure calibration error. Class imbalance can make a weak prevalence predictor look numerically favorable.

Python and R code examples

Scope: Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

Validation: Python — Executed successfully on synthetic inputs. R — reviewed but not executed in this environment. Python dependencies are explicit imports; R uses base R unless a package/bridge is explicitly named.

Python and R

The reference's own programs, shown as written. A component demo shows one central piece of the method; it doesn't train a full model.

Python

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline. · needs numpy

import numpy as np
p=np.array([.1,.3,.8,.9]); y=np.array([0,1,1,1])
print(np.mean((p-y)**2))  # binary one-column convention
R

Complete calculation — Mathematical calculation on synthetic inputs; not a complete benchmark pipeline.

p <- c(.1,.3,.8,.9); y <- c(0,1,1,1)
print(mean((p-y)^2))

Sources

From the CodeSplash reference, entry EVA026.