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)|.
MCE is the largest bin gap. Both are estimators whose value depends on bin edges,
bin count, and sample size, so this lab exposes both binning schemes and the counts.
Brier Score and Murphy Decomposition
BS = n^-1 sum (p_i - y_i)^2 = REL - RES + UNC.
Reliability penalizes disagreement between issued probabilities and event rates.
Resolution rewards forecasts that separate groups with different event rates.
Uncertainty is y_bar(1 - y_bar). Distinct issued probability values are
the groups used for the exact identity.
Temperature Scaling
The browser applies sigmoid(logit(p) / T) and selects the single positive
scalar T that minimizes calibration-split negative log likelihood. A bounded
ternary search over T in [0.05, 20] replaces an optimizer dependency.
Isotonic Regression
PAVA sorts calibration probabilities, pools adjacent blocks whenever their fitted
event rates decrease, and returns a non-decreasing step function. It can repair any
monotone distortion, but its flexibility makes it easier to overfit small calibration sets.
Log Loss, AUC, and Decisions
Log loss is the mean binary negative log likelihood. AUC is computed directly from
average ranks, including ties. Temperature scaling is strictly monotone and preserves
AUC. Isotonic steps can create ties, so its AUC can move slightly. The decision threshold
follows the Bayes rule for user-supplied false-positive and false-negative costs.