A probability calibration lab

Make every probability count.

TrueOdds fits temperature scaling and isotonic regression in the browser, then measures what changes on untouched UCI Adult test predictions.

01 / Live analysis

Calibration Lab

All values below are computed locally from committed classifier outputs. No key, server, or library is used.

Reliability bins

Loading held-out predictions...

Figure 1

Reliability Diagram and Bin Counts

  • Raw
  • Temperature
  • Isotonic
  • Perfect calibration

Points compare mean predicted probability with the observed positive rate. The bars report the sample count behind each point. ECE and MCE change with the selected binning rule.

Reliability Data Table
Values plotted in Figure 1
MethodBinMean probabilityObserved rateCount

Table 1

Held-Out Probability Metrics

Deltas are against raw predictions. Lower is better except for resolution and AUC. The Murphy rows group identical issued probabilities, independent of the display bins, so REL - RES + UNC reconstructs the Brier score exactly.

Raw and recalibrated metrics on the untouched test split
MetricRawTemperatureDeltaIsotonicDelta

Decision study

Cost-Sensitive Threshold

Predict positive when the probability exceeds CFP / (CFP + CFN). Expected cost uses the displayed probabilities. Observed cost uses the held-out labels.

Optimal threshold 0.5000
Expected and observed cost per 100 test cases
MethodPredicted positiveFalse positiveFalse negativeExpected cost / 100Observed cost / 100Observed delta

02 / Method

What the browser computes

The page separates probability quality from ranking quality, and exposes the choices that change its estimates.

Reliability, ECE, and MCE

Each bin compares its observed positive rate acc(Bm) with its mean probability conf(Bm). ECE = sum |B_m|/n * |acc(B_m) - conf(B_m)|. Both estimators depend on bin edges, bin count, and sample size.

Brier score and Murphy decomposition

BS = n^-1 sum (p_i - y_i)^2 = REL - RES + UNC. The browser groups identical issued probabilities so the three terms reconstruct Brier exactly within floating-point tolerance.

Temperature scaling

The browser applies sigmoid(logit(p) / T) and selects the single positive scalar T that minimizes calibration-split negative log likelihood with a bounded search over T in [0.05, 20].

Isotonic regression

PAVA sorts calibration probabilities, pools adjacent blocks whenever their fitted event rates decrease, and returns a non-decreasing step function. Its flexibility can overfit small calibration sets.

Log loss, AUC, and decisions

Log loss is mean binary negative log likelihood. AUC uses average ranks with ties. Temperature scaling preserves AUC because it is strictly monotone, while isotonic steps can create ties. The decision threshold follows the supplied false-positive and false-negative costs.

03 / Data

UCI Adult Income

Adult is a public binary-classification dataset derived from 1994 US Census records. The target is whether annual income exceeds $50K. The committed artifact contains only labels and four-decimal probabilities for the calibration and test splits. Raw demographic features are not shipped to the browser.

Four fixed-seed models provide deliberately different probability shapes: logistic regression, random forest, gradient boosting, and Gaussian naive Bayes. The source dataset is licensed CC BY 4.0. See the README for exact reproduction commands and citations.

Open the UCI dataset record

04 / Limits

What these results do not prove

  • ECE and MCE are bin-dependent estimates. A different scheme or count can change model comparisons.
  • Small bins have high variance. The histogram and table expose counts but do not provide confidence intervals.
  • Calibration learned on one population does not transfer reliably after dataset shift.
  • Isotonic regression can overfit when calibration data is scarce and can reduce ranking resolution by creating ties.
  • UCI Adult is a historical benchmark with documented social and demographic limitations. These models are not suitable for income decisions.

Read the code.

Tests, evaluation, and every decision are documented in the repository.