It is 8 April 2026, and the IPL match at the Arun Jaitley Stadium in Delhi has just ended. Kavya Subramanian is at her desk at The Long Room, the small digital outlet where she makes the graphics, with the scorecard on one screen and a blank post on...
In This Chapter
- 37.1 Data is not a story
- 37.2 The win-probability worm as a broadcast graphic
- 37.3 Which model is on screen?
- 37.4 The par-score bar: "is 210 enough?"
- 37.5 The matchup card
- 37.6 The wagon wheel and the field: what we can and cannot show
- 37.7 Auto-generated match notes
- 37.8 Commentary stat packs, and the leak nobody notices
- 37.9 Social-first design, and measuring what works
- 37.10 Building a cricket content portfolio
- Spaced Review
- Project Checkpoint: storytelling.py
- Chapter Summary
- What's Next
Chapter 37 — Broadcasting and Media Analytics: Telling Stories with Cricket Data — Visualizations, Commentary, and Engagement
It is 8 April 2026, and the IPL match at the Arun Jaitley Stadium in Delhi has just ended. Kavya Subramanian is at her desk at The Long Room, the small digital outlet where she makes the graphics, with the scorecard on one screen and a blank post on the other. Her editor wants a graphic and five lines of notes before the highlights clip goes up. She has fifteen minutes.
The scorecard is a wall of numbers. Gujarat Titans made 210/4: Shubman Gill 70 off 45, Jos Buttler 52 off 27, Washington Sundar 55 off 32. Delhi Capitals replied with 209/8. KL Rahul made 92 off 52 and David Miller 41 not out off 20. Gujarat won by one run. Between them the two sides scored 419 runs off 240 legal balls, which is 10.47 an over across the whole evening.
Kavya stops on one line of the bowling card. Rashid Khan: 4–0–17–3. Ten of his 24 balls were dots. The other 216 legal balls of the match went for 11.17 an over. Nobody else came close: the next-cheapest bowler was Lungi Ngidi at 6.00, and five bowlers went at 13 an over or worse.
Then there is the last over, which she watches again ball by ball. Delhi needed 13 off 6 with four wickets left, and Prasidh Krishna had the ball. Vipraj Nigam hit the first ball for four, then was caught off the second. Kuldeep Yadav took a single. Miller hit the fourth ball for six. That left 2 needed off 2. The fifth ball was a dot. Off the last ball Kuldeep was run out, and Delhi finished one run short.
She has three candidate stories, and the clock is running. One is Rashid Khan's spell. One is the last over. The third is Rahul's 92, a big innings in a losing cause. She could post the scorecard with an exclamation mark, but she won't. Her rule is that a number is not a story until you say what it is being compared with. "4–0–17–3" is data. "4.25 an over in a game that went at 11.17" is the start of a story. "In the IPL data before this match, about 1 spell in 94 was that far below the rest of its game" is the version she can defend if a reader pushes back.
This chapter covers what Kavya does in those fifteen minutes, and the code that lets her do it in five. Every graphic and every sentence comes from the same Cricsheet ball-by-ball data you have used since Chapter 2. The only exception is a wagon wheel and its fielders. Public data does not record where the ball went, so that graphic is built on the book's labelled simulation layer.
🏏 Fan Track: Read §37.1, §37.2, §37.5 and §37.7. You will learn to read a broadcast graphic critically: what model is behind the win-probability line, how big the sample behind a "head-to-head" is, and why the most dramatic note is not always the most remarkable one.
📊 Analyst Track: Everything, with the code. The two pieces that carry the most weight are the notability score in §37.7 and as-of filtering in §37.8. Together they keep automated content honest.
🧑💼 Franchise Track: Franchises run media and content teams too. Read §37.3 (which model goes on screen), §37.8 (stat packs without leakage) and §37.9 (testing content properly instead of guessing).
37.1 Data is not a story
What makes a cricket graphic worth looking at? The question is worth taking seriously, because most cricket graphics on television and social media are tables of numbers with a team badge on top. This book's ideas came from the analyst's side of the game. Here they turn into something a fan sees for five seconds while a bowler walks back to his mark.
Start with a classic example. A commentator says "Kohli has scored 65% of his runs through the off side today." That is data: a number with no context. Now imagine a wagon wheel on screen, with scoring shots concentrated through cover and the field placements overlaid, showing the batter hitting into the gaps the captain left. That is a story. It answers so what? without the viewer doing any work. Before going further, two cautions about that example. First, the 65% is an illustration, not a real statistic about anyone. Second, the book's data cannot produce it. Cricsheet records how many runs came off each ball, but not where the ball went and not where the fielders stood. We return to this honestly in §37.6.
A useful working definition:
📐 Definition — story graphic: A graphic built around one claim, with one comparison that makes the claim mean something, and one line of context that tells the viewer how unusual it is. The claim is the headline. The comparison is the chart. The context is the caption. If you cannot write the headline in under twelve words, the graphic is not ready.
Apply it to Rashid Khan's evening. Script 01_match_story.py computes the pieces from the ball-by-ball data:
mb = charts.match_balls(balls, MATCH) # Chapter 7: one match, running score
mb["rc"] = runs_conceded(mb) # runs charged to the bowler
bw = mb.groupby("bowler").agg(team=("bowling_team", "first"), legal=("is_legal", "sum"),
runs=("rc", "sum"))
bw["econ"] = 6 * bw["runs"] / bw["legal"]
tot_runs, tot_legal = int(mb["runs_total"].sum()), int(mb["is_legal"].sum())
r = bw.loc["Rashid Khan"]
rest_rr = 6 * (tot_runs - r["runs"]) / (tot_legal - r["legal"])
Gujarat Titans v Delhi Capitals, Arun Jaitley Stadium, 08 April 2026
Toss: Delhi Capitals chose to field; winner Gujarat Titans by 1 run; player of the match Rashid Khan
Phase split (runs incl. extras):
runs wkts legal rpo
innings phase
1 powerplay 68 1 36 11.33
middle 93 1 54 10.33
death 49 2 30 9.80
2 powerplay 63 0 36 10.50
middle 79 4 54 8.78
death 67 4 30 13.40
Match: 419 runs off 240 legal balls (10.47 an over, all runs)
Rashid Khan: 17 off 24 balls, economy 4.25; the other 216 balls went at 11.17 an over
Rashid Khan dot balls: 10 of 24
Earlier completed IPL matches (no D/L) in the data: 1,151
Wins by exactly 1 run: 15 of 523 wins by runs
Match aggregates of 419+ before this game: 64 of 1,151; max 549
Chasing sides that made 209+ and still lost, before this game: 18

📊 Figure (described): The same match drawn two ways. On the left, a standard Manhattan (Chapter 7) shows runs per over for both innings, with wickets marked. It is accurate and complete, and it asks the viewer to find the story. On the right, one comparison makes one claim: Rashid Khan conceded 4.25 an over while the other 216 legal balls went at 11.17. The left chart belongs in an analyst's notebook. The right one belongs on a broadcast or a feed.
The left panel is not wrong. It is the right chart for a different audience. A team analyst reviewing the match wants every over. A viewer scrolling a feed gives a graphic about as long as it takes a bowler to walk back. The craft of broadcast analytics is subtraction. You compute everything, then show only the comparison that carries the claim.
Look at what had to be decided before the right-hand chart existed. Economy of whom against whom? Rashid against his own team's other bowlers? Against the whole match? Against his own career? Each is a different claim. "Everyone else in the match" is the fairest comparison here, because it holds the pitch, the boundaries and the batting line-ups constant. That is the same reasoning as the "par" comparisons from Chapter 8, now done inside a single game. All runs or bowler's runs? There were no byes or leg-byes in this match, so it makes no difference today. On another day it would, and the caption should say which.
⚠️ Common pitfall: the everything chart. Producers under time pressure tend to put everything on screen: both teams' run rates, required rate, partnership, last-five-overs comparison, projected score, win probability. A graphic with seven numbers makes no claim, so the viewer remembers none of them. Fix: write the headline first, in words. Then delete every element that does not support it. If two claims both deserve air time, make two graphics.
Three questions before any graphic
Kavya's newsroom uses three questions, and they work for a commentary note, a tweet-length caption and a full feature alike:
- What happened? The fact, stated plainly with its unit: "4 overs, 17 runs, 3 wickets".
- Compared with what? The baseline: "while the rest of the match went at 11.17 an over".
- How unusual is that? The denominator: "about 1 spell in 94 in the IPL data was that far below its match".
Most broadcast statistics stop at question 1. Good ones reach question 2. Question 3 is where this book's tools help most, and it is the subject of §37.7.
🔄 Check your understanding 1. Rewrite "Buttler 52 off 27" so that it answers all three questions, using only numbers from the output above or the scorecard. 2. Why is "the rest of this match" a fairer comparison for Rashid Khan's economy than "his IPL career economy"?
Answer
- For example: "Buttler made 52 off 27 balls (SR 192.6), the fastest fifty-plus innings in a 419-run match. In the IPL data before this game, about 1 fifty-plus innings in 5 was as quick." The last clause comes from §37.7's run: 374 of 1,939. Notice how unremarkable that turns out to be.
- The match baseline holds the conditions constant: the same pitch, ground, ball, opposition batters and dew. A career baseline mixes 2017 and 2026, slow pitches and flat ones. A great spell on a flat night can look merely "good" against a career number, and an ordinary spell on a slow pitch can look great.
37.2 The win-probability worm as a broadcast graphic
Which balls actually decided this match? Ask a room of fans and you will hear "Miller's six", "the run-out", "Rashid's double-wicket over". A win-probability graphic settles the argument with a number, and it has become the signature graphic of modern cricket coverage. Chapter 9 built the book's first model, WP v0. It is an empirical, smoothed lookup table of chase outcomes by runs needed, balls left and wickets in hand, plus a first-innings par proxy. The fuller model, with logistic and gradient-boosted versions and a proper calibration check, arrives in Chapter 20. Chapter 20 is not written into the project yet; project/crease/winprob.py does not exist at this point in the build. So we use crease.impact and say so on the graphic. Every function below takes the model as an argument, so the swap later is one line.
📐 Definition — WP swing of a delivery: The change in the win probability of the side batting first across one delivery: WP after the ball minus WP before it. After the final ball, "after" is the result (1, 0 or ½ for a tie). A swing in percentage points (pts) is 100 × that change. The swing belongs to the delivery, not to a player. Chapter 9's WPA credits it to players under stated conventions.
The new piece in this chapter's module is turning a WP curve into a labelled graphic. A worm with no labels makes the viewer hunt for the moments. A worm labelled at every wicket clutters the chart. storytelling.top_swings picks the biggest swings greedily. It also de-clusters them: after a ball is chosen, any ball within min_sep_balls legal balls of it is skipped, so one chaotic over cannot take every label.
from crease import impact, storytelling as st
balls, games = impact.load_t20(impact.MEN_T20)
s1 = impact.innings_states(balls, games, innings=1)
s2 = impact.innings_states(balls, games, innings=2)
era2 = (s2["match_id"] != MATCH) & (s2["competition"] == "ipl") & (s2["year"] >= 2023)
era1 = (s1["match_id"] != MATCH) & (s1["competition"] == "ipl") & (s1["year"] >= 2023)
wp, par = impact.WPTable().fit(s2[era2]), impact.ParTable().fit(s1[era1])
m = impact.match_wp(balls, games, MATCH, wp, par) # both innings, ball by ball
st.annotated_wp_worm(m, n_labels=4, min_sep_balls=4, force=((2, "19.6"),),
title="GT 210/4 beat DC 209/8 by one run — how the match swung")
The model here is fitted on IPL chases from 2023 to 2026 only, with this match left out. §37.3 explains why that choice matters. Here are the key moments (full script: code/02_wp_worm.py):
WP of Gujarat Titans (side batting first) before the next ball:
moment POOL ERA
Start of match 0.471 0.435
GT 68/1 after 6 0.684 0.567
GT 161/2 after 15 0.863 0.716
Innings break (GT 210/4) 0.863 0.600
DC 63/0 after 6 0.615 0.343
DC 97/1 after 9 0.564 0.322
DC 101/3 after 10 0.819 0.644
DC 158/4 after 16 0.771 0.644
DC 166/6 after 17 0.927 0.854
DC 198/6 after 19 (13 off 6) 0.653 0.539
The last over, ball by ball (GT's WP before -> after, ERA | POOL):
19.1 need 13 off 6: V Nigam four off M Prasidh Krishna 53.9 -> 30.7 | 65.3 -> 44.2
19.2 need 9 off 5: V Nigam caught off M Prasidh Krishna 30.7 -> 63.3 | 44.2 -> 70.0
19.3 need 9 off 4: 1 run, M Prasidh Krishna to Kuldeep Yadav 63.3 -> 80.5 | 70.0 -> 77.0
19.4 need 8 off 3: DA Miller six off M Prasidh Krishna 80.5 -> 7.7 | 77.0 -> 17.4
19.5 need 2 off 2: dot ball, M Prasidh Krishna to DA Miller 7.7 -> 44.4 | 17.4 -> 52.2
19.6 need 2 off 1: Kuldeep Yadav run out 44.4 -> 100.0 | 52.2 -> 100.0

📊 Figure (described): Gujarat's win probability through the match under WP v0 fitted on IPL 2023–26 chases (this match left out). Gujarat led for the whole first innings and most of the chase. Delhi became favourites in overs 6–10 of their reply (orange). The labels show the four largest de-clustered swings plus the final ball, which was added by hand. The largest single swing, 73 points, was Miller's six off the fourth ball of the last over. It took Gujarat from 80.5% to 7.7%. Two balls later the run-out took them to 100%.
What the labelling algorithm got wrong, and why you must check it
Here is what happened the first time this chapter's script ran. Asked for the five biggest swings with min_sep_balls=4, the algorithm chose 8.1, 9.5, 13.6, 18.3 and 19.4. It left out the final ball: the run-out that decided the match, worth 56 points. The run-out came two legal balls after Miller's six, inside the de-clustering window, so the greedy picker skipped it. With min_sep_balls=2 the opposite happened. All five labels landed in the last two overs (18.3, 18.5, 19.2, 19.4, 19.6), and the first innings and Rashid Khan's spell disappeared from the story.
Neither setting is wrong in general. The issue is that WP swings are concentrated at the end of close chases. That is when each ball's leverage is highest, a fact Chapter 9 already established. An automatic labeller will always be pulled toward the last over of a tight game. The fix is the one broadcast producers use: the algorithm proposes, the producer disposes. top_swings(..., force=((2, "19.6"),)) keeps the four de-clustered picks and adds the deciding ball by hand. The figure says so in its subtitle. An automated graphic with an editor's override is still honest if it tells the viewer what was chosen and how.
⚠️ Common pitfall: false precision on screen. WP v0 says Gujarat's chance before the final ball was 44.4%. Under the pooled table it was 52.2%. Showing "44.4%" on a broadcast graphic implies a precision of one-tenth of a point that no cricket model has. Fix: round WP to whole percentages on screen, never decimals. Above 95% or below 5%, consider words ("near-certain") rather than digits. Keep the decimals in the analyst's notes.
Who gets the credit?
The WPA tables from Chapter 9 apply directly. Under this model:
Batting WPA (ERA model), top and bottom three:
batting_team batter runs balls wpa
Delhi Capitals DA Miller 41.0 20.0 0.639
Delhi Capitals KL Rahul 92.0 52.0 0.270
Delhi Capitals extras 0.0 0.0 0.131
Delhi Capitals T Stubbs 7.0 6.0 -0.171
Delhi Capitals N Rana 5.0 6.0 -0.180
Delhi Capitals Kuldeep Yadav 1.0 1.0 -0.728
Bowling WPA (ERA model), top three:
batting_team bowler balls runs wpa
Delhi Capitals Rashid Khan 24 17 0.570
Delhi Capitals M Prasidh Krishna 24 52 0.350
Delhi Capitals K Rabada 24 32 0.108
Rashid Khan bowling WPA (ERA): +0.570; POOL: +0.431
Rashid Khan's +0.570 is the largest WPA of anyone in the match, for either side. The award agrees with the arithmetic this time. Notice the brutal number at the bottom: Kuldeep Yadav, −0.728. That comes from Chapter 9's v0 convention, under which a dismissed non-striker is charged with the swing of his own run-out. It is a convention, not a verdict on Kuldeep. If you show WPA on screen, a viewer will read "−0.728" as blame. A producer who puts that number up without explaining the convention is telling a story the data does not support.
🏏 Eye test: Wendell Baptiste watched the last ball on Kavya's second screen and shook his head. "Your model says the run-out swung it fifty-six points. Fine. But I want to know why there was a run at all. Two to win off one, the keeper standing back, the batters had to run whatever happened. Your model can't see the field, can't see whether the keeper had a glove off, can't see the throw." He's right on every count. WP knows the state before and after the ball. It cannot see the decisions inside the ball: where the ball went, who was where, whether the running was sensible. On a broadcast that is the commentator's job, and the graphic should leave room for it rather than pretend to cover it.
🔄 Check your understanding 1. Why do WP swings cluster in the final overs of a close chase? 2. The labeller skipped the final ball at
min_sep_balls=4. Name two different ways to make sure a deciding ball is always labelled, and one cost of each.
Answer
- Leverage. With 13 needed off 6, one six or one wicket changes the result probability enormously. With 150 needed off 100, a single ball barely moves it. The same runs are worth far more WP late in a tight game (Chapter 9).
- (a) Force-label the final ball of any match decided in the last over. The cost: in a one-sided finish it wastes a label on a 1-point swing. (b) Lower
min_sep_ballsin the final over only. The cost: the late labels crowd out earlier turning points, such as Rashid Khan's wickets. Either way, say on the graphic how labels were chosen.
37.3 Which model is on screen?
Here is a question few viewers ask and every producer should. Whose win probability is that? Figure 2 used a table fitted on IPL chases from 2023 to 2026 only. The same Chapter 9 machinery fitted on all 8,938 men's T20 chases in the data tells a different story about the same balls.

📊 Figure (described): The same match under two versions of WP v0. The dashed line (all men's T20 chases) has Gujarat at 86% at the innings break and never below 54% until the final over. The solid line (IPL 2023–26 only) has Gujarat at 60% at the break and has Delhi as favourites for a long stretch of the chase. The mean gap over the match is 15.8 points and the largest is 27.3. A viewer would have seen two different matches depending on which model the broadcaster used.
The output above gives the starkest moment. At the innings break, with 210 on the board, the pooled table gives Gujarat 86.3%. The era table gives 60.0%. After six overs of Delhi's reply, at 63/0, the pooled table still has Gujarat at 61.5%. The era table has Delhi at 65.7% (1 − 0.343). These are not small disagreements. One graphic says "Gujarat cruising", the other "Delhi on top".
Which is right? Chapter 9 answered this with an out-of-time test. Trained before 2023 and tested on 2023–26, the pooled table underrated IPL chasers by 13.4 points. That fits with the Impact Player era's scoring surge: IPL average first-innings scores were 183.0, 189.6, 190.9 and 195.7 for 2023–2026. A 210 in the 2026 IPL is a good score, not a near-certain one. The era table is better matched to the competition being broadcast, but it is fitted on only 280 chases, so it is noisier. Its cells are thinner, and its swings can be jumpier than the true probabilities.
🔍 Why this works: A win-probability model is a summary of what usually happens next from this state, so it is only as relevant as the matches it summarises. Pooling all men's T20 cricket buys sample size, but it averages in eras and leagues where 210 was a fortress. Restricting to the current IPL era buys relevance at the cost of noise. The trade-off is the bias–variance trade-off from Chapter 6, and it has an editorial consequence. The broadcaster should choose the model before the season, test it out of sample, and disclose it. They should not switch to whichever curve tells the better story on the night.
Three practical rules follow for anyone putting WP on screen:
- Name the model in small print. "Win probability: IPL 2023–26 model" costs eight words and buys credibility.
- Validate on the competition you broadcast. A model that is well calibrated on the pooled men's T20 set can still be badly miscalibrated for one league in one era. Chapter 20 makes calibration a threshold concept. For now, Chapter 9's 13.4-point IPL gap is the warning.
- Don't let the graphic outrun the model. WP v0 knows runs, balls and wickets. It does not know the venue, the pitch, who is still to bat, or that Rashid Khan has an over left. When a commentator says "the model doesn't rate Delhi, but Rashid's done", that is not a contradiction. It is the eye test supplying what the model lacks.
⚠️ Common pitfall: picking the model after the match. It is tempting, especially on social media, to show whichever curve makes the night look most dramatic. Here the era table makes Miller's six look like a cliff (80.5% to 7.7%, 73 points), while the pooled table makes it a large step (77.0% to 17.4%, 60 points) in a match Gujarat "controlled" from the innings break. Choose after the fact and you are choosing the story, not the model. Fix: fix the model per competition before the season. Publish its name and its out-of-sample error. Use the same model for every match.
🔄 Check your understanding 1. At the innings break the two models disagree by 26 points. Which single fact about the 2023–26 IPL, established in earlier chapters, explains most of the gap? 2. The era table is fitted on 280 chases. Name one symptom you would expect to see in its curve that the pooled curve would not show.
Answer
- The scoring surge of the Impact Player era. Average first-innings totals of 183–196 and chasers winning far more often than the pre-2023 table expects (Chapter 9's 13.4-point under-rating) mean a 210 is defended much less often than in the pooled history.
- Jumpier steps, because thin cells mean a single delivery can cross into a cell with a different, noisily estimated value. You can see this in Figure 3: the solid line moves in sharper jumps than the dashed one, for example around over 8 of the chase. Monotone shaping and smoothing (Chapter 9) limit the effect but cannot remove it.
37.4 The par-score bar: "is 210 enough?"
Every T20 broadcast answers one question at the innings break, and often well before it: is this a good score? The usual answer is a single "par score", often an average total at the ground, put up in a box. This section builds a better version, the par-score bar. It shows where the innings is heading with a range, against a par that has been honestly adjusted for the venue. Both halves use only what was known before the toss.
🧩 Productive struggle: Before reading on, decide how you would answer "Is 210 above par at the Arun Jaitley Stadium in April 2026?" using the data. You will need a baseline total, a venue adjustment and an era. Write down the three choices, and what could go wrong with each, before you look at the code.
Here are the three choices this chapter makes, with the reason for each.
- Era. The IPL scoring surge since 2023 is real (§37.3), so par uses the IPL first-innings totals from 2023 up to the day before the match: 222 completed, full-length innings with no rain rule.
- Venue. Raw ground averages are noisy. Chapter 22 built
venue_toss.venue_effects, which expresses each match relative to its season's average and shrinks each ground's effect toward zero by how much evidence it has. We use the shrunk effect, never the raw average. - Projection. Chapter 9's
ParTablegives the whole distribution of runs still to come from any (legal balls bowled, wickets lost) state. We fit it on the same as-of IPL 2023–26 first innings and report the median with an 80% range.
hb, hg = st.as_of(balls, DAY), st.as_of(games, DAY) # nothing after 7 April 2026
tot = venue_toss.first_innings_totals(hb, hg)
era = tot[tot["year"] >= 2023]
eff, info = venue_toss.venue_effects(tot) # season-adjusted, shrunk
par = era["inn1"].mean() + eff.loc["Arun Jaitley Stadium", "shrunk"]
b26, g26 = impact.load_t20(["ipl"], since="2023-01-01", until=str(DAY.date()))
pt = impact.ParTable().fit(impact.innings_states(b26, g26, innings=1))
band = st.projection_band(pt, score=101, legal_before=60, wkts_before=2) # 101/2 after 10
IPL first-innings totals before 08 Apr 2026 (full-length, no DLS): 1,143; 2023-26 so far: 222 (mean 188.4, median 188)
by season: {2023: {'size': 71, 'mean': 183.0}, 2024: {'size': 70, 'mean': 190.1}, 2025: {'size': 70, 'mean': 192.4}, 2026: {'size': 11, 'mean': 187.6}}
Venue shrinkage: k = 54.8 matches, sigma = 30.3 runs, tau = 4.1 runs, 30 venues with 5+ matches
Arun Jaitley Stadium: 94 matches 2008-2026; raw effect +4.9, shrunk +3.1 (reliability 0.63)
Arun Jaitley Stadium, IPL 2023-26 so far: 20 first innings, mean 199.5 (totals: [127, 162, 162, 162, 167, 172, 181, 187, 188, 197, 199, 204, 205, 208, 221, 223, 224, 257, 266, 278])
PAR for GT v DC = era mean 188.4 + shrunk venue effect +3.1 = 191.5
ParTable fitted on 224 IPL first innings (2023 to 7 April 2026)
after 6 overs: 68/1 -> projected mean 205.7, median 206, 80% range 167-241 | par 192 | gap to par (median) +14
after 10 overs: 101/2 -> projected mean 205.9, median 204, 80% range 180-234 | par 192 | gap to par (median) +12
after 15 overs: 161/2 -> projected mean 225.2, median 225, 80% range 206-245 | par 192 | gap to par (median) +33
after 20 overs: 210/4 -> projected mean 210.0, median 210, 80% range 210-210 | par 192 | gap to par (median) +18
pooled men's T20 table, after 6: median 188 (153-222)
pooled men's T20 table, after 10: median 192 (164-221)
pooled men's T20 table, after 15: median 215 (197-235)
(The 2026 season figure in that output is the first 11 games only, as of the morning of 8 April.)

📊 Figure (described): Gujarat's innings against par at four checkpoints. After 6 overs the projection (median 206, 80% range 167–241) already straddles par (192) with most of its weight above. After 15 overs, at 161/2, the median projection reaches 225 and the whole 80% band (206–245) is above par. Gujarat then added 49 in the last five overs and finished on 210: 18 above par, but 15 below where they had been heading.
Look at what the par bar does that the usual "par score" box does not.
It shows a range, not a point. "Projected 204" after ten overs sounds precise. "Projected 204, 80% range 180–234" tells the viewer that a T20 innings still has a lot of variance with ten overs to go. That is Theme 3, small samples and honest intervals, in one band of light colour.
It refuses to overreact to the ground. The Arun Jaitley Stadium's twenty first innings since 2023 averaged 199.5, eleven runs above the era. Hidden in that average are totals of 257, 266 and 278 alongside 127 and three 162s. Over 94 IPL matches since 2008, its season-adjusted effect is +4.9 runs. Shrinkage pulls that to +3.1, because the spread of true venue effects across the IPL (τ = 4.1 runs) is small compared with the match-to-match noise (σ = 30.3 runs). A producer who put "par at this ground: 200" on screen would be quoting a noisy twenty-match average as if it were a fact about the pitch.
It tells a different story from the WP worm, and that is fine. By the par bar, Gujarat's 210 was 18 runs above par: a good score. By the era WP model in §37.2, it made Gujarat only 60% favourites at the break. These are not contradictions. "Above the average first-innings total" and "likely to be defended" are different claims. In the 2023–26 IPL, chasing sides won often enough that an above-average total was still far from safe. Earlier chapters showed teams batting first with 200+ won only 20 of 37 such games in IPL 2026, against 75.9% across 2008–2026. A good broadcast uses both graphics and lets each answer its own question.
🔍 Why this works: The par bar combines two estimates that fail in different ways. The par line is an average, stable but blind to the state of this innings. The projection is state-aware but has to extrapolate from limited cells (224 innings). Showing both, and showing the projection as a range, lets the viewer see the uncertainty instead of reading a single number as a promise.
📋 Try it — Analyze this match: The same as-of
ParTablegives a median projection for any state. Rerun03_par_bar.pywith checkpoints at 8 and 12 overs (checkpoints = [6, 8, 12, 15, 20]). Over 12 went for 23 runs (V Nigam's only over). Predict before you run: how far does the median projection move between 10 and 12 overs?
Worked answer
From the over table in §37.1's scorecard, Gujarat were 101/2 after 10 and 133/2 after 12. The script's output gives the exact projections. The shape is predictable: with no wickets lost and 32 runs in two overs, the median moves up by roughly the extra runs scored above the usual rate for those overs, and the 80% band narrows because there are fewer balls left to vary. The lesson for a producer is to update the par bar at the end of overs, not after every ball. Otherwise one big over makes the projection lurch, and viewers learn to ignore it.
🔄 Check your understanding 1. Why does the chapter's par use the shrunk venue effect (+3.1) rather than the ground's 2023–26 average (199.5)? 2. Gujarat finished 18 above par but were only 60% to win under the era model. Give one sentence a commentator could say that is true to both numbers.
Answer
- Twenty innings is a small sample with a huge spread (127 to 278). The season-adjusted, shrunk effect uses all 94 matches at the ground, removes era drift, and discounts the ground's apparent effect by its reliability (0.63), because true venue differences in the IPL are small relative to match-to-match noise.
- For example: "210 is about 18 above an average first-innings score here, but in this era chasing sides have hauled down totals like this often enough that Gujarat are favourites, not certainties."
37.5 The matchup card
Ten balls into Delhi's chase, Rashid Khan comes on to bowl. The director cuts to a graphic: KL Rahul v Rashid Khan. What should it say?
Kavya's newsroom has a rule for matchup cards, and it is the most important rule in this chapter: the headline number is the one you trust most, never the most dramatic one. A head-to-head between one batter and one bowler is the smallest sample in cricket. Chapter 11 built crease.matchups to handle that. It uses a three-level estimate (league, batter skill, matchup), with the batter's record against a type of bowling shrunk toward what the league would expect from that batter on exactly those balls.
The card must also be as of the morning of the match. A matchup card that quietly includes the batter's next three weeks of cricket is a leak (§37.8).
raw = st.as_of(load_many(MEN_T20), DAY) # men's T20, before 8 April 2026
balls = attach_styles(raw, load_styles(gender="male"))
faced = prepare(balls) # 2015 onwards, wides removed
h = head_to_head(faced, "KL Rahul", "Rashid Khan") # pinned by registry id
table = expected_matchups(faced)
k = fit_matchup_k(table, faced)
shr = shrink_matchups(table, k["k_sr"], k["k_dr"], sigma2=k["sigma2"])
Raw head-to-heads (2015 to 7 April 2026, all men's T20 in the data; dis = bowler-credited dismissals):
KL Rahul v Rashid Khan 61 balls 59 runs 3 dis SR 96.7
DA Miller v Rashid Khan 76 balls 90 runs 4 dis SR 118.4
P Nissanka v Rashid Khan 7 balls 14 runs 0 dis SR 200.0
KL Rahul v Mohammed Siraj 79 balls 135 runs 1 dis SR 170.9
KL Rahul v M Prasidh Krishna 52 balls 72 runs 3 dis SR 138.5
JC Buttler v Kuldeep Yadav 75 balls 99 runs 3 dis SR 132.0
Shubman Gill v Kuldeep Yadav 31 balls 51 runs 0 dis SR 164.5
Shrinkage weights fitted on this pool: k_sr = 302 balls, k_dr = 1733 balls
KL Rahul v leg-spin: 718 balls, SR obs 124.5, expected 138.2, shrunk 128.6 (90% 120-137); dismissals 22, balls/dismissal obs 32.6, shrunk dr 0.0336 (1 in 30)
JC Buttler v left-arm wrist-spin: 111 balls, SR obs 148.6, expected 150.3, shrunk 149.8 (90% 136-163); dismissals 4, balls/dismissal obs 27.8, shrunk dr 0.0411 (1 in 24)
On 8 April: KL Rahul v Rashid Khan: 9 balls, 6 runs, not dismissed
On 8 April: JC Buttler v Kuldeep Yadav: 2 balls, 1 runs, dismissed

📊 Figure (described): Two pre-match matchup cards built as of the morning of 8 April 2026. Each headline is the batter's shrunk strike rate against the bowler's type, not the raw head-to-head. Rahul against leg-spin: 128.6, about ten points below what the league would expect from him on those balls (138.2). Buttler against left-arm wrist-spin: 149.8, almost exactly as expected. The head-to-head appears as a supporting row, explicitly labelled as too small to headline.
Look at the temptation the left card resists. "KL Rahul v Rashid Khan: SR 96.7, out 3 times" is a dramatic graphic. It suggests Rashid has Rahul's number. It rests on 61 balls spread over a decade of franchise cricket. Afghanistan's internationals are not in the data, so every Rashid Khan number here comes from the leagues. The shrinkage weight for strike rate, fitted by Chapter 11's method on this as-of pool, is k = 302 balls. A 61-ball record gets weight 61 / (61 + 302) ≈ 0.17. In other words, the data says to believe about a sixth of the raw gap. The type-level record, 718 balls against leg-spin, has real evidence behind it. It does point the same way: Rahul scores more slowly against leg-spin than the league would expect from a batter of his skill. That is the defensible headline.
Then the match happened. Rahul faced 9 balls from Rashid and scored 6 without being dismissed, a strike rate of 66.7 in a match that went at over ten an over. Buttler, whose card said nothing alarming about left-arm wrist-spin, was bowled by Kuldeep Yadav in his second ball from him. Neither outcome makes the cards wrong. A matchup card is a prior, a statement about tendencies, not a prediction of the next ball. A broadcaster who shows a card and then crows "told you so" or "the stats were wrong" has misunderstood the card.
🏏 Eye test: "Nine balls, six runs," said Wendell, "and your card said he scores slow against leggies. So the card was right?" Kavya shook her head. "Nine balls can't confirm anything, any more than sixty-one could. What I can say is that Rahul played Rashid like a man who respected him. He took no risks against him and went after everyone else. The card gives you the tendency. The commentator tells you what the batter is choosing to do about it." Wendell, a seamer by trade, nodded at that. "Batters don't score slowly against good spinners by accident. They decide to."
What goes on a matchup card
| Row | What | Why it earns its place |
|---|---|---|
| Headline | Shrunk SR (or balls per dismissal) against the bowler's type | Most evidence; already adjusted for the batter's general skill |
| Context | League-expected value for the same balls | Tells the viewer whether the headline is good or bad |
| Raw type record | Runs off balls, dismissals | Transparency: the numbers behind the shrinkage |
| Head-to-head | Runs off balls, dismissals, plus a sample-size warning | Fans want it; show it, but never as the headline |
| Footnote | Data window, as-of date, method | Lets anyone check it |
⚠️ Common pitfall: the cherry-picked head-to-head. Producers can search hundreds of batter–bowler pairs before a match and put up the most dramatic one. With hundreds of small samples, some will look extreme by chance. That is the multiple-comparisons trap from Chapter 6. Fix: decide the matchups that matter before looking at the numbers (the opening bowler against the opening batters, the main spinner against the middle order), then show whatever those cards say, including the dull ones.
🔄 Check your understanding 1. With k = 302 balls, how much weight does a 61-ball head-to-head get against its expectation? How much does Rahul's 718-ball record against leg-spin get? 2. Buttler was bowled by Kuldeep in his second ball against him. Should the next card for Buttler against Kuldeep change? By roughly how much?
Answer
- 61 / (61 + 302) ≈ 0.17 for the head-to-head; 718 / (718 + 302) ≈ 0.70 for the type record. That is why the type record carries the headline.
- A little. The dismissal adds 2 balls and 1 dismissal to a 111-ball type record with 4 dismissals. Dismissal-rate shrinkage uses an even larger prior weight (k_dr = 1,733 balls in this pool), so the shrunk balls-per-dismissal barely moves. One vivid dismissal is exactly what memory overweights and shrinkage does not.
37.6 The wagon wheel and the field: what we can and cannot show
The classic way to frame this chapter is one image: a wagon wheel of a batter's scoring shots, with the field overlaid, showing how the batter worked the gaps. It is the most compelling graphic in cricket broadcasting, and the hardest to make honestly with public data. Cricsheet has no shot directions and no fielding positions (see Chapter 2). So what can a reader with a laptop do?
The book's answer since Chapter 7 and Chapter 15 has been to learn the method on a labelled simulation, then say exactly what a broadcaster with real tracking would see differently.
🧪 Simulated data: In this section, shot angles and distances come from
toolkit/tracking_sim.py. That tool attaches simulated locations to real deliveries: the runs off each ball are real, and where the ball went is simulated, conditioned on the real outcome. Following the house rule, we calladd_trackingon all IPL deliveries, then filter to KL Rahul's innings. Nothing in this section is a fact about where KL Rahul actually hit the ball.
The field is also not real. storytelling.FIELDS holds two teaching fields, a middle-overs field and a death-overs field for a right-hander (five fielders outside the circle, the post-powerplay maximum in the IPL). They are drawn in the same coordinates as Chapter 7's wagon wheel. Gujarat's actual field placements are not in any public dataset.
for seed in (2026, 7):
tr = add_tracking(ipl, seed=seed) # whole competition, then filter
inn = tr[(tr["match_id"] == MATCH) & (tr["batter"] == "KL Rahul")]
gaps = st.nearest_fielder_gap(inn, st.FIELDS["t20_death_rhb"], hand="R")
...
charts.wagon_wheel(inn, ax=ax, hand="R")
st.draw_field(ax, st.FIELDS["t20_death_rhb"], hand="R")
REAL (Cricsheet): KL Rahul 92 off 52 balls, 11 fours, 4 sixes, 14 dots, scoring shots 38
SIMULATED (tracking_sim) — the same real outcomes, two seeds:
seed 2026: off-side share of runs 16.3% (IPL 2023-26 simulated career 36.6%); median gap to nearest fielder: fours 12.9 m, other ground shots 12.3 m
runs by simulated zone: {'third_man': 2, 'point': 5, 'cover': 2, 'long_off': 6, 'long_on': 7, 'midwicket': 29, 'square_leg': 25, 'fine_leg': 16}
seed 7: off-side share of runs 34.8% (IPL 2023-26 simulated career 42.3%); median gap to nearest fielder: fours 13.7 m, other ground shots 15.9 m
runs by simulated zone: {'third_man': 3, 'point': 12, 'cover': 11, 'long_off': 6, 'long_on': 17, 'midwicket': 13, 'square_leg': 14, 'fine_leg': 16}

📊 Figure (described): The same real innings (92 off 52; 11 fours, 4 sixes, 23 scoring shots of one to three runs) drawn on the simulated tracking layer with two different random seeds, with an illustrative field overlaid. Under one seed, Rahul looks like a leg-side player who scored 16% of his runs through the off side. Under the other, the off side carries 35%. The real outcomes did not change; only the simulated directions did. The figure is a lesson in method and a warning, not a picture of the innings.
Two numbers in that output make the point better than any warning box. First, the "story" changes with the seed. The off-side share of runs goes from 16.3% to 34.8% when nothing real has changed. A producer who put "Rahul scored only 16% through the off side today" on a graphic built from simulated data would be broadcasting a random number. Second, the gap measure is uninformative here. The median distance to the nearest fielder is about the same for fours and for other ground shots (12.9 m against 12.3 m under one seed). On real data you would expect boundaries to beat the field by more than singles do. The simulator does not know where the fielders stood, so it cannot reproduce that. It is a property of the simulation, not of batting.
What would a broadcaster with the real feed see? Ball-tracking and shot-tracking systems record where each ball pitched and where it was hit to. Broadcast production teams can log the field set before each delivery. With those, the "manipulating the field" story becomes measurable. You can compute the share of scoring shots that land in gaps of a given width, how that share changes when the captain moves a fielder, and whether a batter's scoring zones shift between the powerplay and the death. nearest_fielder_gap is already the right function. It needs real angles and a real field.
🏏 Eye test: Kavya puts it to Nusrat this way: "The wagon wheel is the one graphic where the eye test is still ahead of the public data. The commentator can see the batter stepping across to work the ball into the leg side. We can count the runs but not where they went." That is not a failure of analytics. It is the honest boundary of what free data can say, and Theme 5 in action.
🔄 Check your understanding 1. Why must
add_trackingbe called on the whole IPL table rather than on one match? 2. A colleague says: "The simulated career off-side share (36.6% or 42.3%) is a large sample, so at least that tells us something about Rahul." Is that right?
Answer
- The simulator's random draws depend on the exact set of rows passed in. The book's house rule (call it on a whole competition, then filter) makes every chapter's simulated values agree for the same seed.
- No. A large sample of simulated values is still simulated. The batter's "zone preference" in
tracking_simcomes from a hash of the name, not from his batting. Even the career share moves by about six points between seeds. Sample size cannot turn invented locations into evidence.
37.7 Auto-generated match notes
Back to Kavya's fifteen minutes. The graphics are rendering. Now she needs five lines of notes: the short, factual sentences that go under a highlights clip, into a live blog, or onto a commentator's screen. Many outlets now draft these automatically from ball-by-ball data. Most generators are templates: "X scored Y off Z balls." Here is what such a generator writes for this match:
NAIVE TEMPLATE (what a generator without a notability filter writes):
Shubman Gill scored 70 off 45 balls.
Washington Sundar scored 55 off 32 balls.
JC Buttler scored 52 off 27 balls.
GD Phillips scored 14 off 9 balls.
B Sai Sudharsan scored 12 off 7 balls.
R Tewatia scored 1 off 1 balls.
KL Rahul scored 92 off 52 balls.
...
Every sentence is true, and none of them is worth reading. ("1 off 1 balls" is also a giveaway that a machine wrote it.) The generator has no idea what is remarkable. To give it one, we need a definition.
📐 Definition — notability: For a candidate fact, take a comparison pool of earlier events of the same kind, for example every earlier IPL win by runs. Let k be the number at least as extreme as this one and n the pool size. Then notability = −log₁₀(k / n), with k floored at 1. A notability of 1 means "about 1 in 10". 2 means "about 1 in 100". 0.7 means "about 1 in 5". Every fact carries its k, n and pool, so anyone can check it, and so the sentence can say it.
Why a logarithm? Because surprise is multiplicative. "1 in 100" is as much more surprising than "1 in 10" as "1 in 10" is than "a coin flip". The log puts facts from completely different families (margins, spells, aggregates) on one ranking scale. It is the same move information theory makes when it measures surprise in bits.
storytelling.match_facts builds the candidates for a T20 match. They are: the margin, the match aggregate, the spell that was furthest below the rest of its match, the losing side's top score, the fastest fifty-plus innings, the last-over equation, and two model-based facts (the winner's lowest win probability and the biggest one-ball swing). Each is compared with a pool of earlier matches. career_milestones adds any IPL career landmarks passed during the game, with players pinned by registry id. The comparison pool is every completed IPL match before this one, cut with as_of. The WP facts are compared with every IPL chase from 2023 to the day before, judged by the same model.
hist_b, hist_g = st.as_of(ipl_b, DAY), st.as_of(ipl_g, DAY)
pool = impact.chase_wp(s2[pd.to_datetime(s2["start_date"]) < DAY], wp) # earlier chases, same model
facts = st.match_facts(ipl_b, ipl_g, MATCH, hist_b, hist_g, match_states=ms,
label="IPL", chase_pool=pool)
facts += st.career_milestones(hist_b, match_b, run_step=1000, wicket_step=50)
print(st.match_notes(sorted(facts, key=lambda f: -f.score), n=7, min_score=0.7))
The candidates, ranked (the full sentences and evidence lines are in code/06_output.txt):
| Fact | Notability | Evidence (k of n, pool) |
|---|---|---|
| Rashid Khan's economy against the rest of the match | 1.97 | 111 of 10,408 IPL spells of 18+ legal balls |
| Biggest one-ball WP swing (Miller's six, 19.4) | 1.74 | 4 of 220 IPL chases 2023–26 (WP v0) |
| 1-run margin | 1.54 | 15 of 523 IPL wins by runs |
| KL Rahul's 92 as the losing side's top score | 1.36 | 50 of 1,136 IPL defeats |
| 419-run aggregate | 1.25 | 64 of 1,151 IPL matches |
| Gujarat's lowest WP (8%) | 1.17 | 15 of 220 IPL chases 2023–26 (WP v0) |
| Buttler's 52 off 27, fastest fifty-plus | 0.71 | 374 of 1,939 IPL 50+ innings |
| Player of the match | 0.50 | fixed score (match record) |
| 13 needed off the last over, defended | 0.21 | 51 of 82 IPL chases needing 11–15 off 6 |
No IPL career milestone (a multiple of 1,000 runs or 50 wickets) was passed during the match. And the notes the generator writes:
THE NOTES (top 7 above notability 0.7, i.e. rarer than about 1 in 5):
1. Gujarat Titans 210/4 beat Delhi Capitals 209/8 by 1 run.
2. Rashid Khan took 3 for 17 in 4 overs (economy 4.25) while the rest of the match went at 11.17 an over. Only
111 of 10,408 earlier IPL spells of 3+ overs were as far below the rest of their match (0.38 times its
rate).
3. The biggest single swing: 19.4 DA Miller six off M Prasidh Krishna (73 percentage points); 4 of 220 earlier
chases in the comparison set had a ball that big.
4. A 1-run margin: 15 of 523 earlier IPL wins by runs in the data were by 1 run or fewer.
5. KL Rahul's 92 off 52 was the top score for Delhi Capitals; the losing side's best innings reached 92 in
only 50 of 1,136 earlier IPL defeats.
6. 419 runs in the match; 64 of 1,151 earlier completed IPL matches produced as many.
7. Gujarat Titans' win probability bottomed out at 8%, after 19.4 of innings 2 (DA Miller six off M Prasidh
Krishna). Only 15 of 220 earlier chases in the comparison set had a winner who fell that low during the
chase.

📊 Figure (described): Every candidate fact the generator found, ranked by notability. Bars in blue cleared the cut-off of 0.7 (about 1 in 5) and became notes. Grey bars did not. Rashid Khan's spell is the most remarkable fact of the night by this measure: only about 1 in 94 earlier IPL spells were that far below the rest of their match. The last-over defence of 13 runs, the most dramatic moment, is one of the least remarkable: earlier IPL chases needing 11–15 off the final over were won only 31 times in 82, so defending was the usual outcome.
The ranking contains this chapter's most useful lesson about media analytics. Drama and rarity are different things. The last over had a four, a wicket, a six, a dot and a run-out. On television it was the match. But "Delhi needed 13 off the last over and didn't get them" happens most of the time. In the IPL data before this match, the bowling side won 51 of 82 such equations. What was rare was a spinner conceding 17 runs in a 419-run match, and a one-run margin. A generator built on drama would lead with the last over. A generator built on notability leads with Rashid Khan, and so did the player-of-the-match award.
Notice, too, what notability does to the "record" reflex. Nothing in these notes says "record" or "first time ever". The aggregate of 419 is notable (1 in 18) but nowhere near the highest; the most before this game was 549. Claims like "highest ever" need a denominator that covers the whole record book. Cricsheet's IPL coverage is complete from 2008, but its international coverage begins at different dates for different formats, and it can differ by a run from official records for older matches. The phrase "in the data" in every note is not decoration. It is the claim's boundary.
⚠️ Common pitfall: the denominator that changes the verdict. Case Study 2 runs the same generator on a women's T20 World Cup 2026 match, Pakistan v South Africa at Edgbaston. It compares the facts against two pools: all women's T20Is in the data (2,037 earlier matches) and only matches between full members (667). Fatima Sana's 55 off 38, the losing side's top score, scores notability 1.11 against the first pool and 0.80 against the second. Associate matches lower the typical top score in a defeat. Neither pool is wrong, but they make different claims. Fix: choose the pool that matches the claim ("among Test-playing nations…"), name it in the sentence, and keep it fixed across a tournament.
The same case study found the night's real headline, and it is one the IPL generator could not produce. That match had no fact type for partnerships. Pakistan were 50/8; Fatima Sana and Tuba Hassan then added 71 off 54 balls for the ninth wicket. No earlier ninth-wicket stand in the data had reached 71, in 372 full-member innings with a ninth-wicket stand or in 1,370 across all women's T20Is. A generator is only as good as its list of fact types. Every new competition will teach you one you were missing.
Where the generator still fails
The project checkpoint (below) runs the same code on another close 2026 IPL game: Mumbai Indians v Royal Challengers Bengaluru at Raipur on 10 May, which RCB won off the final ball. The generator's "spell" note goes to Jasprit Bumrah, 0 for 20 in four overs, because his economy was furthest below the rest of the match. It does not mention Bhuvneshwar Kumar's 4 for 23, or his 7 not out off 2 balls including a six in the last over. Bhuvneshwar was player of the match. The fact families measure economy against the match and batting only above fifty. A four-wicket haul and a two-ball cameo fall between them.
The fix is not to trust the machine less. It is to treat the generator as a first draft for a human editor, and to keep adding fact families: wicket hauls relative to the match, cameo strike rates at the death, partnerships, milestones. Each new family needs its own comparison pool and its own k and n.
📋 Try it — Build this metric: Add a
"haul"fact tomatch_facts. For the bowler with the most wickets in the match, count earlier spells (18+ legal balls) in the comparison pool with at least as many wickets and economy no worse. Run it on the Raipur match (id1529297, history = IPL before 10 May 2026).
Worked answer
A minimal version, inside
match_factsafter the spell block:
python top = sp.sort_values(["wkts", "econ"], ascending=[False, True]).iloc[0] k = int(((hsp["wkts"] >= top["wkts"]) & (hsp["econ"] <= top["econ"])).sum()) facts.append(Fact("haul", f"{top['bowler']} took {int(top['wkts'])} for {int(top['runs'])} ...", notability(k, len(hsp)), k, len(hsp), f"{label} spells, wickets and economy"))On the Raipur match this surfaces Bhuvneshwar Kumar's 4 for 23. Run it to get k and n from your copy of the data. Note the design choice: "at least as many wickets and no more expensive" is stricter than wickets alone, so it rewards a haul that was also cheap. Write that choice into the fact's
pooltext, so the reader knows what "as good" meant.🔄 Check your understanding 1. Two facts: "a 1-run margin (15 of 523)" and "a fifty at SR 192.6 (374 of 1,939)". Compute each notability and say which leads. 2. Why is "the last over was defended" low in notability even though it decided the match? 3. Why does the generator floor k at 1?
Answer
- −log₁₀(15/523) = 1.54; −log₁₀(374/1,939) = 0.71. The margin leads.
- Notability measures rarity given the situation, not importance to the result. From 11–15 needed off the last over, the bowling side won 51 of 82 earlier IPL chases, so defending was the expected outcome. The importance of the last over is what the WP swing facts capture.
- Without it, an unprecedented event (k = 0) would score infinity. Flooring at 1 (and adding 1 to n) turns "never before in n" into "about 1 in n+1", a finite score that still ranks such events highest.
37.8 Commentary stat packs, and the leak nobody notices
Before every match, commentators get a stat pack: venue records, player form, milestones within reach, the head-to-heads (§37.5). It is the least glamorous product in cricket media and the one most likely to contain an error. This section builds a pack for GT v DC and shows the error most packs contain without anyone noticing.
The rule is simple: a pre-match pack may only use data dated before the match. storytelling.as_of(df, date) keeps rows with start_date strictly before the date. Every number below went through it.
VENUE — Arun Jaitley Stadium, IPL 2023 to 7 Apr 2026: chasing side won 8 of 19 (42%, 95% interval 23-64%); all IPL grounds 112 of 223 (50%, 44-57%)
PLAYERS — SR+ by phase (100 = IPL par for the same season and phase), IPL 2023 to 7 Apr 2026:
balls strike_rate sr_plus
phase powerplay middle death powerplay middle death powerplay middle death
batter
DA Miller 16.0 207.0 232.0 68.8 132.8 153.9 47.9 95.0 91.8
JC Buttler 358.0 420.0 136.0 131.0 150.0 186.8 90.6 105.8 109.8
KL Rahul 453.0 437.0 98.0 130.2 138.0 143.9 88.9 97.9 85.1
Shubman Gill 597.0 582.0 118.0 144.0 158.2 189.8 99.3 113.6 113.2
RASHID KHAN — IPL career by phase to 7 Apr 2026 (franchise data only; Afghanistan internationals are not in the data):
balls runs wickets economy dot_pct
bowler phase
Rashid Khan middle 2319 2584 104 6.69 37.13
death 576 812 41 8.46 36.46
powerplay 342 438 15 7.68 41.52
MILESTONE WATCH (IPL, 23 players who appeared in the match):
player stat now next needed
AR Patel runs 1916 2000 84
B Sai Sudharsan runs 1879 2000 121
N Rana runs 2868 3000 132
Shubman Gill runs 3905 4000 95
Each line of that pack is already a commentary note. Three things to notice:
The venue line carries its interval. "Chasing sides have won 8 of the last 19 here" invites the commentator to say "it's a ground for batting first". The Wilson interval, 23–64%, comfortably contains the league-wide 50%. Nineteen matches cannot tell a batting-first ground from a coin. The pack should say so, or the commentator will over-read it.
SR+ beats raw strike rate for context. Chapter 8 defined SR+ as strike rate relative to the league's par for the same seasons and phases (100 = par). Miller's death-overs strike rate of 153.9 looks punchy. As SR+ it is 91.8: below the IPL par for death overs in his seasons. In the 2023–26 IPL, 153.9 at the death is ordinary. Rahul's powerplay SR+ of 88.9 says the same thing about him at the top of the innings. A raw strike rate on screen without the par is the "traditional stats are broken" problem (Theme 1) in a new form.
Rashid Khan's line needs a caveat in the caption. The data has his IPL and other franchise-league cricket, but none of his internationals for Afghanistan, which Cricsheet withholds. "Rashid Khan, IPL career" is a correct label. "Rashid Khan, T20 career" from this data would be wrong.

📊 Figure (described): The context strip, a graphic made for the commentary box rather than the viewer. Each grey dot is one regular IPL batter's SR+ in a phase (2023 to the day before the match, 150+ balls). The four highlighted batters sit within the crowd: Gill well above par in the middle overs (113.6), Rahul and Buttler below par in the powerplay (88.9 and 90.6), Miller below par at the death (91.8). Rahul, Gill and Buttler have fewer than 150 death-overs balls in the window, so they are not drawn in that row. An absent dot is better than a dot built on 98 balls.
The leak
Now the error. A stat pack, a fantasy preview or a betting model is easy to build with "2026 season" numbers taken from a table that was updated after the match. Nobody notices, because the numbers look plausible. Here is the size of that leak for four players in this match:
LEAKAGE TEST — '2026 so far' as of the morning of 8 April vs computed with the whole season (2026):
KL Rahul: as of 8 Apr 1 runs in 2 innings (SR 25.0) | whole season 593 runs in 14 innings (SR 174.4)
Shubman Gill: as of 8 Apr 39 runs in 1 innings (SR 144.4) | whole season 732 runs in 16 innings (SR 163.0)
Rashid Khan: as of 8 Apr 2 wkts, economy 8.50 (48 balls) | whole season 21 wkts, economy 9.08 (341 balls)
Kuldeep Yadav: as of 8 Apr 2 wkts, economy 8.86 (42 balls) | whole season 10 wkts, economy 10.30 (222 balls)
KL Rahul walked out on 8 April with 1 run from 2 innings in the 2026 season. A pack with the whole-season line would have said "593 runs at a strike rate of 174" and called him in form. A pack with the honest line says "1 run in two innings". That was true, and it was also meaningless as a prediction. Rahul then made 92 off 52. The as-of line was correct, and it was a two-innings sample (Theme 3). A good commentator uses it the way Chapter 6 taught: as a reason to mention the career numbers, not as evidence of a slump.
⚠️ Common pitfall: the time-travelling stat. If a pre-match number was computed on a table that includes the match itself, or anything after it, the pack is leaking the future. In a stat pack this is embarrassing. In a betting or fantasy model (Chapter 35, Chapter 36) it produces backtests that look brilliant and fail live. Fix: every function that builds pre-match content takes an
as_ofdate and filters onstart_date < date. Write a test that rebuilds one pack with a later snapshot and checks the numbers do not change.🔷 R corner (not run in this book's build): the same as-of discipline in dplyr, assuming a data frame
ballswith Cricsheet-style columns.
r library(dplyr) as_of <- function(df, date) filter(df, start_date < as.Date(date)) as_of(balls, "2026-04-08") |> filter(wides == 0, batter == "KL Rahul", format(start_date, "%Y") == "2026") |> summarise(runs = sum(runs_batter), balls = n(), sr = 100 * runs / balls)🔄 Check your understanding 1. The venue line says chasing sides won 8 of 19. Why does the pack also print the all-grounds figure? 2. Miller's death-overs SR is 153.9 but his SR+ is 91.8. Explain both numbers to a viewer in one sentence. 3. Name a pre-match product besides a stat pack where a time-travelling statistic would do real damage.
Answer
- The baseline. 8 of 19 (42%) means little until you see that chasers won 112 of 223 (50%) everywhere, and that the venue's interval (23–64%) contains 50%.
- "Miller strikes at over 150 at the death, which sounds fast, but in this IPL era the average death-overs batter scores faster than that, so he's slightly below par."
- A betting model's backtest or a fantasy projection (Chapters 35–36). Leaked features make the model look profitable on history and lose money live.
37.9 Social-first design, and measuring what works
Most people who see a cricket graphic today see it on a phone, in a feed, for a second or two. Three design facts follow, and one measurement discipline.
Shape first. A broadcast graphic is 16:9 landscape. A feed post is square (1:1) or slightly tall (4:5). A story or short-video frame is 9:16 portrait. These are not the same graphic resized. Each shape changes the layout. Horizontal bars suit a wide screen; vertical bars suit a tall one. Headlines need to wrap on a narrow canvas.
Type scales with the canvas, not with the data. A phone shows a 1080-pixel-wide post about 6–7 cm across, so text needs to be roughly twice the size it would be on a TV graphic of the same nominal width. storytelling.type_scale encodes that rule of thumb:
Type scale (points) for an 8-inch-wide canvas of each format:
broadcast (16, 9): {'headline': 16.0, 'body': 10.5, 'caption': 8.0}
square (1, 1): {'headline': 24.8, 'body': 16.3, 'caption': 12.4}
portrait (4, 5): {'headline': 25.6, 'body': 16.8, 'caption': 12.8}
story (9, 16): {'headline': 30.4, 'body': 19.9, 'caption': 15.2}
broadcast: headline 16.0 pt -> 30 px on a 1080-px export -> about 1.8 mm on a 65-mm-wide phone view
square: headline 24.8 pt -> 46 px on a 1080-px export -> about 2.8 mm on a 65-mm-wide phone view
story: headline 30.4 pt -> 57 px on a 1080-px export -> about 3.4 mm on a 65-mm-wide phone view
One message survives the scroll. The story graphic from §37.1, Rashid Khan's 4.25 against 11.17, works on every canvas because it has one claim. A WP worm with five labels does not fit a 9:16 frame. Its social version is a single label: "Miller's six took Gujarat from 81% to 8%. Two balls later they won."

📊 Figure (described): One message on three true-shaped canvases, displayed at the same width as a phone shows them. The 16:9 broadcast graphic becomes a thin strip with tiny type, perfectly readable on a television and hard to read in a feed. The square and vertical versions give the same two bars more height and the headline far more size. The data is identical in all three; only the design changed.
Engagement: what can we actually measure?
Every media team wants to know what cricket data content performs best on social platforms. The book's data snapshot contains no social-media data. It has no impressions, shares, saves or watch time. So this chapter will not quote a single engagement figure. Any number here would be invented, and this book’s promise — every number traceable to data you can download — forbids that. What we can do is teach the method, which is the part that transfers.
The method is the A/B test. Publish two versions of a graphic to randomly split audiences (most platforms' advertising and creator tools support some form of this). Measure one pre-chosen outcome, such as share rate or save rate. Compare. Before you run it, decide how many viewers you need, because engagement rates are small and differences between versions smaller still.
📐 Definition — A/B sample size (two proportions): To detect a relative lift L on a baseline rate p with significance α (two-sided) and power 1 − β, each version needs about n = [z₁₋α/₂ √(2 p̄(1 − p̄)) + z₁₋β √(p₁(1 − p₁) + p₂(1 − p₂))]² / (p₂ − p₁)², where p₁ = p, p₂ = p(1 + L) and p̄ is their mean.
storytelling.ab_sample_size(p, L)computes it.ab_mde(p, n)inverts it.
A/B PLANNING TABLE — viewers needed PER VERSION (two-sided alpha 0.05, power 0.8).
Baseline rates are hypothetical inputs, not measurements; the snapshot has no social data.
baseline +10% lift +20% lift +50% lift
0.5% 327922 85862 15599
1.0% 163095 42693 7750
2.0% 80682 21109 3826
5.0% 31234 8158 1471
10.0% 14751 3841 686
Smallest detectable relative lift with 20,000 viewers per version:
baseline 0.5%: 44%
baseline 1.0%: 30%
baseline 2.0%: 21%
baseline 5.0%: 13%
baseline 10.0%: 9%

📊 Figure (described): How many viewers each version of a post needs before an A/B test can detect a difference, as a function of the baseline rate of the action being measured. The baselines on the x-axis are inputs from your own analytics, not measurements from this book. The lesson is the slope: rare actions and small improvements need enormous audiences. A small account testing two chart styles on a few thousand viewers can detect only very large differences.
Four rules make engagement testing honest:
- Choose the outcome before you post. Impressions, likes, shares, saves, completion rate and replies measure different things. Pick one primary outcome; checking five and reporting the best is the multiple-comparisons trap again.
- Randomise or don't claim causation. Comparing last Tuesday's post with this Tuesday's confounds the design with the match, the time and the news cycle. A post about a one-run finish will outperform a post about a 90-run thrashing regardless of its colour scheme.
- Watch for novelty. A new style may win its first test because it is new. Re-test it after a month.
- Respect the audience. Engagement is not the only goal. A misleading graphic can out-perform an honest one. A betting-adjacent post can out-perform both. The constraints of Chapter 35 apply to media as much as to models.
📋 Try it — Optimize this strategy: Your outlet's analytics say your square graphics are shared by about 2% of viewers (your number, not this book's). You want to test whether adding a one-line "compared with what?" caption raises the share rate by 20%. You can show each version to about 15,000 people. Is the test worth running?
Worked answer
From the table, a 20% lift at a 2% baseline needs about 21,109 viewers per version for 80% power. With 15,000 per version you are under-powered. Running
st.ab_mde(0.02, 15_000)gives the smallest lift you could reliably detect; it will be above 20%. Options: run the test across several posts and pool them (same caption rule, many matches), lengthen it, or test a bolder change whose expected effect is larger. Running it anyway and declaring "no difference" when you could not have detected one is the classic error.🔄 Check your understanding 1. Why does a 16:9 broadcast graphic usually fail as a phone post, even though the data is the same? 2. Why will this chapter not tell you which kind of cricket chart gets the most shares?
Answer
- At phone width its text renders at roughly 2 mm tall (see the type-scale output), and a wide layout wastes most of a tall screen. The shape and type must change with the canvas.
- The book's data snapshot contains no social-media data, and every number in the book must come from data the reader can download. The A/B method lets you find the answer for your audience with your data.
37.10 Building a cricket content portfolio
Nusrat had been reading over Kavya's shoulder on a video call from Dhaka, eight hours of slow internet away. "How do you get the job where you get to do this?"
"You do it first, in public, for free," said Kavya. "Then you show people."
Kavya's portfolio advice covers what this chapter has built; Chapter 38 covers careers in full. A cricket media portfolio that gets read has four kinds of piece:
- Match pieces within hours. One story graphic and five checked notes, published on the night: the GT v DC pipeline in this chapter, run on a match you care about. Speed matters in media, and a reproducible pipeline is how you get it.
- One explainer. Take one idea from this book and explain it to fans with real numbers. For example: "Why a 210 in the 2026 IPL wasn't safe", or "What a matchup card isn't telling you".
- One long-form analysis. Something no broadcast has time for, such as a season-long look at a phase, a player or a women's competition. Women's cricket remains under-covered analytically. The Pakistan–South Africa ninth-wicket record in Case Study 2 is exactly the kind of story that goes unnoticed without someone running the numbers.
- The code. A public repository with your Crease modules shows an editor that your numbers can be checked. That counts for more in data journalism than any single chart.
Two practical points. Credit your data. Cricsheet's ball-by-ball data is free to use; check its website for the current licence terms and credit it on every graphic. Never use broadcast footage or logos you do not have rights to. Build graphics from data, which you can share, not from screenshots of someone else's broadcast. Do not imitate a broadcaster's or franchise's branding. A portfolio piece that looks like a fake official graphic will hurt you, not help.
🏏 Eye test: Wendell, asked what makes a cricket graphic good, didn't hesitate. "When I've played or coached that situation, I look at your graphic and think yes, that's what it felt like. When it tells me something I didn't feel, I want to know why. And when it tells me something that's plain wrong — like a bowler 'conceding only 4.25' on a pitch where he was bowling at the tail — I stop trusting the next one." That last clause is worth pausing on. Rashid Khan's four overs here were not at the tail: his three wickets were Nitish Rana, Sameer Rizvi and Axar Patel, in overs 10 and 14. The graphic survives Wendell's test because the data says it should.
Spaced Review
Before reading the answers, try to answer each from memory.
- From Chapter 6: Shrinkage appeared three times in this chapter: the venue par (§37.4), the matchup card (§37.5) and, implicitly, the WP table's smoothing (§37.2). What single principle connects them?
- From Chapter 9: WP v0 is a smoothed lookup table. What was the out-of-time finding about the IPL since 2023, and how did it change the model used on screen in §37.3?
- From Chapter 7: Which colour conventions did this chapter's graphics inherit, and why do the comparison charts vary line style as well as colour?
Answers
- An estimate from a small sample should be pulled toward a broader baseline in proportion to how little evidence it has. Twenty venue matches, 61 head-to-head balls and a sparse WP cell are all small samples. Shrinkage (or smoothing) weights them by their reliability instead of believing them outright.
- Fitted on chases before 2023 and tested on 2023–26, the pooled table underrated IPL chasers by about 13.4 points. §37.3 therefore used a table fitted on IPL 2023–26 chases, accepting more noise for relevance, and argued that a broadcaster should fix that choice before the season and disclose it.
- Batting-first side blue, batting-second side orange, wickets red with an X. Comparisons use the Okabe–Ito palette (
charts.COMPARE) plus varying line styles and markers, so no series is identified by colour alone and the charts survive colour-vision deficiency.
Project Checkpoint: storytelling.py
Nusrat's Crease project now gets its media layer. The module project/crease/storytelling.py turns everything earlier chapters computed into things people read and watch. It depends only on the toolkit, on crease.charts (Chapter 7) for its palette, and on any WP model with Chapter 9's predict(runs_needed, balls_left, wkts_in_hand) interface. When Chapter 20's winprob.py lands, every function here accepts it unchanged.
What it provides (22 public functions):
- Canvases:
canvas(aspect, width_in),type_scale(aspect, width_in)for 16:9, 1:1, 4:5 and 9:16. - Leak-proofing:
as_of(df, date). - WP storytelling:
over_ball,describe_delivery,top_swings(match_states, n, min_sep_balls, force),annotated_wp_worm(...). - Broadcast primitives:
projection_band(par, score, legal_before, wkts_before),par_bar(...),matchup_card(...),FIELDS,draw_field(...),nearest_fielder_gap(...)(simulated input → simulated output). - Notes:
Fact,notability(k, n),match_facts(...),career_milestones(...),match_notes(facts, n, min_score),possessive. - Stat packs and Tests:
player_ids,milestone_watch(balls_asof, players, ...),lead_series(match_balls)(the Test lead tracker from Case Study 1). - Experiments:
ab_sample_size(p, lift),ab_mde(p, n).
The checkpoint script runs the whole pipeline on a match the chapter has not used, Mumbai Indians v Royal Challengers Bengaluru at Raipur on 10 May 2026:
ms = impact.match_wp(tb, tg, MATCH, wp, par)
st.top_swings(ms, n=4, min_sep_balls=4, force=((2, "19.6"),))
facts = st.match_facts(ipl_b, ipl_g, MATCH, st.as_of(ipl_b, DAY), st.as_of(ipl_g, DAY),
match_states=ms, label="IPL", chase_pool=pool)
st.milestone_watch(st.as_of(ipl_b, DAY), players, near_runs=100, near_wkts=5)
[1] four biggest swings (+ forced final ball):
inns 2 2.6 D Padikkal caught off DL Chahar +17.8 pts (side batting first)
inns 2 5.1 RM Patidar caught off C Bosch +17.7 pts (side batting first)
inns 2 17.3 KH Pandya six off AM Ghazanfar -18.6 pts (side batting first)
inns 2 19.4 B Kumar six off RA Bawa -62.3 pts (side batting first)
inns 2 19.6 2 runs, RA Bawa to Rasikh Salam -55.0 pts (side batting first)
[2] notes:
1. Royal Challengers Bengaluru 167/8 beat Mumbai Indians 166/7 by 2 wickets off the final ball.
2. Royal Challengers Bengaluru's win probability bottomed out at 4%, after 19.3 of innings 2 (R
Shepherd caught off RA Bawa). Only 6 of 257 earlier chases in the comparison set had a winner who
fell that low during the chase.
3. The biggest single swing: 19.4 B Kumar six off RA Bawa (62 percentage points); 8 of 257 earlier
chases in the comparison set had a ball that big.
4. JJ Bumrah took 0 for 20 in 4 overs (economy 5.00) while the rest of the match went at 8.69 an
over. Only 872 of 10,746 earlier IPL spells of 3+ overs were as far below the rest of their match
(0.58 times its rate).
[3] milestone watch (IPL, before the toss):
none within range
[4] facts without a stated pool: none
The output has two features worth noticing. First, the generator found the story of the finish on its own: RCB at 4% after Romario Shepherd's dismissal, then a Bhuvneshwar Kumar six worth 62 points. Second, as §37.7 showed, it did not find Bhuvneshwar's 4 for 23. That is the gap the 📋 exercise asks you to close. Line [4] is the module's self-test: every fact must name its comparison pool. A fact without a denominator is never allowed into the notes.
How it plugs in later. Chapter 39 builds the Streamlit dashboard. Its Match Centre page calls annotated_wp_worm and match_notes for any match a user selects, and its pre-match view calls milestone_watch and the matchup card with as_of set to the match date. Chapter 27's live projections can feed projection_band ball by ball, and Chapter 20's calibrated model replaces WP v0 behind every curve.
Chapter Summary
The broadcast graphics, and the rule each must follow
| Graphic / product | Built from | The honesty rule |
|---|---|---|
| Story graphic (§37.1) | One comparison inside the match | One claim, one comparison, one line of context; headline in under 12 words |
| Annotated WP worm (§37.2) | WP v0 (crease.impact), top_swings |
De-cluster labels; force-label the deciding ball; round to whole % |
| Model disclosure (§37.3) | Same WP, two training pools | Fix the model per competition before the season; name it on screen |
| Par-score bar (§37.4) | ParTable + shrunk venue effect, as-of |
Show a range, not a point; never a raw 20-match venue average |
| Matchup card (§37.5) | crease.matchups shrinkage, as-of |
Headline = most evidence (type record), not the dramatic head-to-head |
| Wagon wheel + field (§37.6) | 🧪 tracking_sim + teaching field |
Label as simulated; never quote a sim_ number as fact |
| Match notes (§37.7) | match_facts + notability |
Every fact carries k, n, pool; "in the data", never unqualified "record" |
| Stat pack (§37.8) | as_of + SR+ + Wilson intervals |
Nothing dated on or after the match; intervals on small records |
| Social versions (§37.9) | canvas, type_scale |
One message per post; shape changes the layout, not just the size |
| Engagement tests (§37.9) | ab_sample_size, ab_mde |
Pre-register one outcome; randomise; no invented rates |
Key numbers from this chapter (all from the book's data snapshot)
- GT 210/4 beat DC 209/8 by 1 run (Delhi, 8 April 2026); 419 runs at 10.47 an over. Rashid Khan 4–0–17–3 (10 dots) while the other 216 balls went at 11.17. About 1 IPL spell in 94 was that far below its match.
- 15 of 523 earlier IPL wins by runs were by 1 run. 64 of 1,151 earlier completed IPL matches had 419+ runs.
- WP v0 at the innings break: Gujarat 60% (IPL 2023–26 table) against 86% (all men's T20 chases); mean gap over the match 15.8 points. Miller's six at 19.4: −73 points for Gujarat (80.5% → 7.7%).
- Par for the match 191.5 (era mean 188.4 + shrunk venue effect +3.1; raw effect +4.9, reliability 0.63). Gujarat finished 18 above par.
- KL Rahul v leg-spin (to 7 April 2026): shrunk SR 128.6 against an expected 138.2 (718 balls). Head-to-head v Rashid Khan: 59 off 61 balls, too small to headline.
- Leakage: KL Rahul's 2026 line as of the morning of the match was 1 run in 2 innings; computed with the whole season it would have read 593 runs in 14 innings.
Decision checklist before anything goes to air or online
- Can I state the claim in one sentence with a comparison?
- Is every number as of the right date, from data I can name?
- Does every "rare" claim carry its k of n and its pool?
- Is the model named, fixed in advance and validated on this competition?
- Is any simulated layer labelled as simulated?
- Would this survive Wendell? Does it match what someone who played the situation would feel, and if not, can I explain why?
What's Next
Everything in this chapter is also a portfolio piece. A reproducible pipeline that turns a match into checked graphics and notes in minutes is precisely the kind of evidence an employer wants to see. Chapter 38 turns from making cricket analytics to making a career of it. It covers the roles across franchises, media, betting, technology and governing bodies, the skills each values, and how to present the Crease project as your portfolio.