# A 37.5% forecast was right overall and wrong for both queues

Will a customer support request need another reply? In a made-up example, a program gives every request in two equally long queues a 37.5% chance of the event. When we put the queues together, exactly 37.5% of requests have that outcome. The overall rate matches the forecast perfectly.

Now imagine you’re responsible for just one queue. The event happened in only 12.5% of cases in the first and 62.5% in the second. The same forecast overshot in one queue and fell short in the other. Neither queue’s experience was visible in the overall number. To see the gap, the people running each queue need their own rate.

Checking how closely forecast probabilities match the rates you actually observe is called checking calibration. We used invented cases and known outcomes to try three different comparisons. First we kept the forecasts identical and looked at the two queues. Then we varied the probability ranges used in the report. Finally we changed how much weight each queue carried in a different scoring rule.

**What happened inside each queue?** The 37.5% forecast was 25 percentage points above the rate in the first queue and 25 points below the rate in the second. Each error was 25 percentage points in size, or 0.250 on a zero-to-one scale. Averaging their sizes with weight proportional to each queue’s case count still gave 0.250. Combining the queues before measuring the error gave zero.

Would finer probability ranges help? All the forecasts were identical. They fell in one range whether we divided the scale into two ranges or four. To show what happened in each queue, report its case count, average forecast and observed rate.

**What if the forecasts in a range are different?** Expected calibration error (ECE) groups forecasts into probability ranges called bins. Within a bin it compares the average forecast with the observed event rate and takes the size of the difference. It then averages those gaps, giving more weight to bins with more cases.

In a separate test with two equal-width bins dividing the scale at 50%, forecast system A had an ECE of 0.000 and B had 0.050. With four bins, A rose to 0.250 while B stayed at 0.050. Zero ECE meant the average gap in those two bins was zero. Some of A’s forecasts were high and others low. The wider bins let their errors cancel before the gap was measured. Use the same bin boundaries for both systems and show the case count, mean forecast and observed rate in each bin. [scikit-learn calibration curve](https://scikit-learn.org/1.7/modules/generated/sklearn.calibration.calibration_curve.html)

**Which queue supplies most of the work?** Our third example used binary Brier loss. This scores a probability against the outcome of an individual case: 1 if the event happened, 0 otherwise. Subtract the outcome from the forecast, square the difference, then average those squared differences. Lower loss means the individual forecasts were closer to what happened. That measures more than agreement between average forecasts and event rates.

In this test, half the cases in each queue had the event. When the first queue supplied 75% of the weight and the second 25%, A had the lower loss, 0.109375 compared with B’s 0.203125. With equal weights they tied. Reversing the weights put B ahead. A did better in the first queue, B in the second. With the event equally common in both queues, changing how much each queue counted was enough to reverse the ranking. [scikit-learn binary Brier loss](https://scikit-learn.org/1.7/modules/generated/sklearn.metrics.brier_score_loss.html)

To check an overall forecast score later, keep the event definition, intended cases, forecasts, outcomes and which queue each case belonged to. Report each queue’s loss as well as the share you used to combine the queues. If the shares stand for a future workload, say how you estimated them and how closely your test cases represent the work in each queue.

## Related research

- [The program with a perfect record on its own cases came second overall](https://sapien1.com/research/evaluate-systems-that-decline-cases)
- [Two perfect rankings can put the wrong cases at the front of one queue](https://sapien1.com/research/compare-average-precision)

[Interpreting test scores](https://sapien1.com/research#scores)
