Chapter 20 Notes — Win Probability Models

Chapter link: Chapter 20

Overview and learning objectives

Chapter 20 gives Crease its main engine. The hook is Rinku Singh's five sixes at Ahmedabad on 9 April 2023. A model fitted only on matches before 2023 gave Kolkata 0.0017 at 177 for 7 needing 28 off five balls, and the chapter asks whether the model was wrong. Its threshold concept, calibration, answers that a probability is a promise about frequencies and can only be checked by pooling many forecasts.

The chapter builds WP v1 on 8,939 men's T20 chases from 9,117 matches in twelve competitions and scores everything out of time (fit before 2023, test 2023–26). Along the way it shows that:

  • a random split of balls leaks (0.0185 against 0.1933 for the same model split by match);
  • context features (target, past-only scoring environment, Elo gap), not the model family, beat Chapter 9's WP v0 (Brier 0.1252 → 0.1143), and logistic regression beats boosting because trees can't extrapolate;
  • WP v1 roughly halves the IPL miss (13.4 → 7.7 points); an era-only refit cuts it to 1.3 in 2025–26.

It then prices the first innings, redraws the Newlands anchor match, builds an IPL 2026 WPA leaderboard and shows that a men's model can't be trusted with women's chases. The module is winprob.py.

By the end of the chapter students should be able to:

  1. Explain why a single match cannot show a probability forecast to be wrong, and describe the comeback test that can.
  2. Identify leakage in a ball-by-ball model and choose between random, by-match and by-time splits.
  3. Compute and interpret the Brier score and log loss, and state why both are proper scoring rules.
  4. Read a reliability diagram and a Brier decomposition, telling calibration apart from resolution, and check calibration by league with intervals from resampled matches.
  5. Explain why the scoring environment beats an era flag, and why trees fail to extrapolate where a logistic model does not.
  6. Compute first-innings WP from a projected total and a defend curve, and interpret a break-even total.
  7. Use WPA to describe a match or season, and state why it should not be used to judge a player's ability.

Where students struggle

  • "The model said 0.2% and it happened, so it's broken." Most students fall into the hook's trap. Don't resolve it early; return to it with Case Study 2's comeback test (4.0% of chases whose WP v1 ever fell to 5% or below were won).
  • Random-ball splits. Students from machine-learning courses default to a random 80/20 row split. Use the matches_in_both column (5,272 under the random split, 0 under the others) to make the fingerprint idea concrete: target, environment and Elo gap are constant within a match.
  • Comparing Brier scores across test sets. A Brier score means something only against another model on the same test set, because the mix of early and late states drives it.
  • States are not independent. The 70% test had 24,178 states but only 1,765 chases. Intervals must resample matches, as the IPL gap interval (+0.045 to +0.110, 281 chases) does.
  • Calibration v resolution. Tom Ashworth's line helps: say 52.4% before every ball and you are calibrated for ever, and useless. Most of WP v1's gain over WP v0 is resolution (0.1328 v 0.1222), not reliability.
  • The environment effect has two signs. It raises start-of-chase WP (chasing 200: 0.176 at environment 150, 0.352 at 190). At a fixed target in mid-chase, though, it slightly lowers WP: 80 off 36 with 7 in hand, target 190, is 0.131 at 188.7 and 0.146 at 160. Students find this counter-intuitive. The explanation is "slow relative to the league".
  • Reading WPA as skill. Kuldeep Yadav's −0.98 batting WPA in IPL 2026 comes mostly from one last-ball non-striker run-out. Season WPA describes; it doesn't judge.

Pacing

50-minute session. - 0–7: The hook. Show the Rinku over table and take a vote: "Was the model wrong?" - 7–17: §20.2–20.3. The pool, the scoring environment, and the leakage table. - 17–27: §20.4–20.5. Brier and log loss; the out-of-time comparison table, read row by row. - 27–40: §20.6. The threshold concept: reliability diagram, decomposition, the 70% test, calibration by league. - 40–50: §20.9. The Newlands curve with WP v1 against WP v0.

75-minute session. As above, plus 10 minutes on §20.7 (era flag against environment against era-only fit) and 15 minutes on §20.10–20.11 (the IPL 2026 leaderboard and the women's check). Lab time: 45–60 minutes. 01_data_and_leakage.py takes about 35 seconds and 02_logit_vs_gbm.py about 55 seconds; the rest take under a minute. ch20_common.py holds shared constants and is not run.

Lecture outline

  1. Hook: 0.0017, five sixes, and "a probability is a promise about frequencies".
  2. What WP is for: a match's story, WPA, forecasting. WP v0's 13.4-point IPL miss.
  3. The pool (9,117 matches); the past-only scoring environment (IPL 164.4 in 2022 → 188.7 in 2026); the walk-forward Elo gap.
  4. Leakage: random balls 0.0185, by match 0.1933, by time 0.2036 for the flexible boosted model.
  5. Scoring rules: Brier and log loss; a coin flip scores 0.25 and 0.693.
  6. The comparison table: state-only logistic (0.1249) equals WP v0 (0.1252); context takes it to 0.1143. Boosting is worse in every row, because only 1% of pre-2023 chases had an environment above 172.7.
  7. Calibration (threshold concept): reliability bins, every 2023–26 gap positive; the decomposition; Tom's 70% test; by league (IPL +0.134 → +0.077); the last ball.
  8. The era test: environment does most of the work; era-only WP v1 is best in the IPL (0.1146) but worse in the Blast. Pooled for history, era-only for the current season.
  9. First innings via par: break-even 163 (environment 160) and 183 (190); the direct model scores better (0.1952 v 0.1994) but doesn't join the chase curve as cleanly.
  10. Newlands, IPL 2026 WPA, and the women's check (0.0916 for women's own WP v1 against 0.1111).

Live coding demo

Scripts: code/01_data_and_leakage.py, then code/project_checkpoint.py run interactively (python -i code/project_checkpoint.py from the chapter directory).

  1. Run 01_data_and_leakage.py. Expected: the leakage table with flexible GBM test Brier 0.0185 (random balls), 0.1933 (by match), 0.2036 (by time), and logistic 0.1274 / 0.1301 / 0.1211. Point at matches_in_both before saying anything about the scores.
  2. Run the checkpoint. Expected: "WP v1 fitted on 5,209 chases (590,291 states); 25 features; ER par 158.6", then Mumbai Indians' chase against Delhi (IPL 2023) at 0.477 to start, 0.724 after 15 overs and 0.850 after 16. The top turning point is Tim David's two off the last ball (0.671 → 1.000). The plug-in check reports a maximum difference of 0.00e+00 from impact.chase_wp.
  3. Live change 1: at the prompt, call model.predict(54, 30, 8, target=170, env_par=150, elo_diff=0) and again with env_par=190. The chapter reports 0.559 and 0.528. Ask the class to predict the direction first.
  4. Live change 2: the §20.5 Try-it, model.predict(80, 36, 7, target=190, env_par=188.7, elo_diff=0) and then with env_par=160. The chapter prints 0.131 and 0.146. This is the moment to explain "slow relative to the league".

If a student's numbers differ in the third decimal place, check that they fitted on year < 2023.

In-class activity: "Price the last ball"

Groups of three or four. Hand out the six situations from §20.6's last-ball table: needing 1, 2, 3, 4, 5 or 6 off the final ball of a men's T20 chase (2023–26). Each group writes its probability for each before seeing anything. Then reveal three rows:

Runs needed 1 2 3 4 5 6
Observed 0.922 0.769 0.422 0.340 0.167 0.167
WP v0 0.843 0.431 0.191 0.150 0.117 0.104
WP v1 0.836 0.508 0.235 0.078 0.027 0.011

Tasks:

  • (a) Which group beat WP v1 on these six cells?
  • (b) Why do both models under-rate the batter? Hint: no smooth function of "runs per ball" knows that 4 off 1 is a single swing for a boundary.

Close with the chapter's honest limitation: the EndGame fix got the last ball closer but under-forecast chasers by about 5 points in the middle bands (0.686 against an observed 0.744).

Answers and teaching notes for key exercises

  • B1. Brier 0.18; log loss 0.511. The 0.30 forecast that won dominates both (91% of the Brier total, 79% of the log-loss total). Use the "0.01 that wins" example (0.98 against 4.6) to show which rule punishes overconfidence hardest.
  • B3. 0.0006 − 0.1328 + 0.2499 = 0.1177, not exactly 0.1143, because the decomposition bins the forecasts. Removing all calibration error saves only about 0.0006. The improvement over WP v0 came from resolution. A good exam item.
  • B6. v1 −0.312 and v0 −0.403 over Tahir's over. Over overs 15–16 combined, v1 has −0.489 and v0 −0.510. Both models say the two overs cost about half a win; they split it differently. Turning points depend on the model as well as the match.
  • B11. WP v1 about 3.1–4.9%; WP v0 about 3.7–5.7%. Neither fails, because a calibrated model should sit at most about 5%. Make sure students understand why "at most" applies: WP jumps past the threshold rather than touching it.
  • D3 (Wendell's depth hypothesis). Strong answers compare WP v1's residuals by wickets in hand for IPL 2023–26 against other leagues over the same seasons. Support for Wendell would be chasers with many wickets lost beating the model more in the IPL than elsewhere. Students must also say what Cricsheet cannot show: there are no batting-position or Impact Player substitution labels in the delivery table.
  • D4 (drop Pooran?). The reply should quote Pooran's −1.00 WPA (196 runs at 122.50) and the chapter's warning that WPA reflects leverage and team context and does not repeat well. It should then point the coach to rate metrics with shrinkage (Chapters 8, 13 and 19).

Assessment ideas

  • Problem set: given ten forecasts and outcomes, compute Brier, log loss and a three-bin reliability table, and write two sentences on calibration against resolution.
  • Code task (C4): refit WP v1 on 2023–25 chases, produce start-of-chase WP for every IPL 2026 match, and draw a five-bin reliability diagram with match-bootstrap intervals. Grade on the honest treatment of 72 matches.
  • Short essay (D6): argue against putting the men's WP v1 on a women's World Cup broadcast, using §20.11's numbers (men's v1 with women's context over-rates women's chasers by 9.4 points; recalibration intercept −0.99).
  • Quiz item: a "94% accurate" ball-by-ball model; what are your first two questions?

Format, gender and region diversity notes

  • Format: the models are T20 only. §20.12 explains why ODIs (costlier wickets, rain, fewer matches) and Tests (three outcomes) need their own.
  • Women's cricket (§20.11): 2,594 decided women's chases (T20Is 2,035, WBBL 471, WPL 88). The spot check is a strong board example: "54 off 30, 8 in hand, target 130, environment 150" is 0.437 on the men's WP v1 and 0.286 on the women's. The men's model fails worst on associate women's T20Is; in the WBBL it does better than the women's own model (0.1126 v 0.1257). Exercise E1 builds a WPL leaderboard.
  • Region and league: the calibration-by-league table is a tour of the world game. It covers the PSL (+0.084 under WP v1), the BBL, the BPL (+0.054, useful for Bangladeshi students), the CPL, the SA20 (−0.001, essentially calibrated) and associate men's T20Is, where chasers did worse than forecast (−0.031). The anchor match is South Africa v Sri Lanka at Newlands.

Connections