Calibration checks compare displayed scores with observed positive fractions inside score buckets. This lesson keeps both bucket fractions exact.
highlighted = computed this step
Bucket A
Bucket A groups rows with displayed score 3/4. It has 4 rows: 2 positives and 2 negatives. The observed positive fraction is 1/2, so it does not match the score.
score=3/4,observed=42=1/2
Bucket B
Bucket B groups rows with displayed score 1/4. It has 4 rows: 1 positive and 3 negatives. The observed positive fraction is 1/4, so this bucket matches exactly.
score=1/4,observed=41=1/4
Compare the gaps
Bucket A has gap 1/4. Bucket B has gap 0. This is one tiny held-out slice; it does not prove future calibration, training quality, or generalization.