Quality and calibration monitoring
Quick answer
Quality monitoring compares stored predictions with mature ground truth. Classification accuracy checks decisions; the Brier score measures squared probability error, while calibration curves compare predicted probability with observed event frequency. Examples use Python, SciPy 1.17.0 and scikit-learn 1.8.0 with small synthetic inputs. ByteMind execution is unverified.
Probability scoring
from sklearn.metrics import brier_score_lossprint(round(brier_score_loss([0,1],[.2,.8]),3))Expected output (locally tested): 0.04. Both predictions have squared error 0.04.
How it works
For binary y and probability p, Brier score is mean((p-y)^2); smaller is better. The score reflects calibration, discrimination and outcome uncertainty, so it is not a pure calibration measure. For a reliability diagram, choose fixed probability bins and report mean prediction, observed positive fraction and count in each populated bin. Sparse bins give uncertain estimates; empty bins should be omitted or marked unavailable. Track accuracy at a frozen threshold, confusion counts, class prevalence, and slices alongside score metrics. Comparing Brier across changed prevalence or populations requires context. Use a mature outcome cohort and matched reference; do not tune thresholds on the monitoring report. Define investigation thresholds before examining current outcomes and require adequate coverage. A calibration change can occur while hard decisions stay identical.
Calibration bin counts
p=[.2,.4,.8,.9]; y=[0,1,1,1]for lo,hi in [(0,.5),(.5,1.01)]: a=[(v,t) for v,t in zip(p,y) if lo<=v<hi] print(len(a),round(sum(v for v,t in a)/len(a),2),sum(t for v,t in a)/len(a))Expected output (locally tested): 2 0.3 0.5 2 0.85 1.0. A reliability table reports counts as well as the two rates.
Common mistakes
Do not interpret Brier alone as calibration error. Do not present partial-label accuracy as final or change the classification threshold merely to improve a dashboard.
Practice and next steps
For predictions [0.6,0.9] and two positive outcomes, compute Brier score. Compare with [0.9,0.9] and discuss why accuracy does not change.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Quality and calibration monitoring — knowledge check
Apply quality and calibration monitoring to small examples and debugging scenarios.
What is binary Brier score?
Does Brier isolate calibration?
What should reliability bins include?
Can accuracy remain fixed as Brier changes?
When is final cohort quality assessed?