A model should be checked on outcomes that were unavailable when its posterior and prediction rule were formed.
Held-out predictive log scores for a binary rate model
Freeze a time boundary
Fit the service-rate model on 53 cases whose seven-day outcomes have matured. The next 29 mature cases, with five escalations, form a later holdout. Do not use any of those 29 labels to choose the prior, inspect group anomalies, or tune a threshold before scoring. A frozen snapshot records the exact cutoff and exclusions. Future cases are a stronger operational test than a random split that mixes policy periods.
Predict one future binary case
A Beta(15, 78) posterior implies a next-case escalation probability of 15/93, about 16.1%, under the one-rate exchangeable model. Freeze that probability for all 29 held-out cases to make a fixed-model comparison. A baseline using the earlier prior mean predicts 10%. The observed holdout share is 5/29, about 17.2%; this does not mean the model was calibrated from one small holdout.
Score both outcomes
Binary log loss penalizes an assigned probability when its event outcome is surprising. Add the negative log probability for each held-out case and divide by 29. Lower is better. It rewards probabilities that describe both events and non-events, unlike a thresholded accuracy score that discards probability information. Clip only to guard machine arithmetic at zero or one; a clipped score should be disclosed if it affects results.
Separate fixed forecasts from updating
The fixed-score comparison does not update after each held-out label. A live sequential forecast could update its posterior as cases mature, but then it must score each case with the probability recorded before that outcome arrived. Do not calculate a posterior using all 29 holdout outcomes and call its in-sample probabilities held-out predictions. The monitoring contract prevents this look-ahead.
Inspect more than one aggregate score
Report log loss by queue and calendar period. A pooled model may score acceptably overall while assigning poor probabilities to West. Compare it with a simple baseline under the same time boundary and eligibility rule. Predictive performance does not prove causal validity or that the model’s staffing decision is cost-effective. A group discrepancy check can reveal a structural miss that one scalar score obscures.
Implementation
from math import log
def binary_log_loss(events, cases, predicted_rate):
if not 0 <= events <= cases or cases == 0:
raise ValueError("invalid held-out counts")
if not 0 < predicted_rate < 1:
raise ValueError("probability must be inside (0, 1)")
return -(events * log(predicted_rate) +
(cases - events) * log(1 - predicted_rate)) / cases
model_loss = binary_log_loss(5, 29, 15 / 93)
baseline_loss = binary_log_loss(5, 29, 0.10)
assert model_loss < baseline_lossPerformance and operating cost
For aggregated binary counts, one log-loss evaluation is O(1); per-case scoring is O(N) for N holdout cases. Training and model fitting are separate costs. A small holdout gives a noisy comparison, so report denominators and repeat over later periods.
Common Mistakes
- Do not fit or tune with holdout outcomes before scoring them.
- Do not confuse one-case predictive probability with the joint predictive distribution of 29 cases.
- Do not treat a lower aggregate log loss as proof of good subgroup performance.
