Part VIII — Synthesis
This book began with an argument at a tea stall in Mirpur. Kohli can't finish, someone said; Suryakumar goes at 190-plus at the death. It sounded settled because it came with numbers. Then we computed them. Kohli's career IPL strike rate in the death overs was 188.38, Suryakumar's 178.21, and the real gap between them was in the middle overs, where it ran the other way (125.80 against 144.14). The story everyone told was backwards.
Thirty-eight chapters later, that has become a habit. You loaded 6,420,141 deliveries from 17,186 matches on an ordinary laptop. You found that Rohit Sharma's ODI average of 58.46 in wins and 36.01 in defeats says more about how matches are selected than about his temperament. You watched Imran Tahir's two-run, two-wicket sixteenth over at Newlands drop Sri Lanka's chance of winning from about a half to under a fifth, and then watched Seekkuge Prasanna win the match anyway. You shrank Quinton de Kock's weakness against off-spin to a strike rate of 115.5 against an expected 125.8, and kept it, because 1,226 balls is enough to believe. You found a ₹30 lakh batter who out-batted a ₹27 crore one in the middle overs of IPL 2025, and then reported, in the same breath, that it didn't last. And you learned that in the IPL from 2023 to 2026 the favourite won only 47.6% of matches out of time, in a league where about nine-tenths of the spread in the table is luck.
Every one of those findings left something behind in project/crease/: a module, a function, a
test. Part VIII is where you count them, wire them together, and ask the two questions every
finished piece of work should face. Can anyone trust what this produces? And what comes next?
What this part argues
Part VIII has two chapters and one argument: a platform is only as good as its honesty about where it fails, and the game will keep moving under it.
- The parts add up to a real system. At the end of the book Crease holds 36 modules and 617 public functions and classes (588 functions plus 29 classes), 99.2% of them documented, in just under 15,000 lines of code. Its import graph only points backwards in time, from later chapters to earlier ones, so it can be tested and explained from the bottom up.
- A number on a screen needs a card behind it. Every predictive model gets a model card: what it is for, what it was trained on, how it did out of time against a naive baseline, and where it breaks. A card with only the good half is an advertisement.
- Frozen models tell the truth. Every model on the dashboard is fitted only on matches before the one it shows. Chapter 39 then freezes each model before the 2026 season and scores it on all of 2026. Four of five beat their baselines. One doesn't, and the chapter says so.
- Trend lines break. A straight line through fifteen IPL seasons missed every one of the four Impact Player seasons, each outside its own 90% interval. The future of cricket analytics has to be forecast with the same discipline as a chase: a range, a stated method and a note about what the data can't see.
- The record is uneven, and that is an ethical problem as well as a statistical one. Women's, associate and domestic cricket are measured less, so they are studied less and valued less. Richer data about players' bodies, and faster data about matches, bring new harms with them.
The questions it answers
- Does everything you built actually work together, and how would you know if it stopped working?
- Who really won the IPL 2026 final for Bengaluru: the player of the match, or the bowlers?
- Why can two honest models from the same package disagree about the same match, and which do you show a coach?
- Which of your models beat a simple baseline on a season they had never seen, and which didn't?
- What can ball-tracking, wearables, computer vision and language models add, and what will stay hard?
- Whose cricket is missing from the public record, and what would you build next to fix it?
How the chapters build
Chapter 39 — Capstone: Your Cricket Analytics
Platform. Nusrat types streamlit run project/app.py on her old laptop in Dhaka, and the IPL 2026
final fills the screen: Gujarat Titans 155 for 8, Royal Challengers Bengaluru 161 for 5 in 18
overs. The chapter first measures what you built, then wires it into a seven-page Streamlit
dashboard (Match Centre, Player Explorer, Matchups, Auction Board, Match Predictor, Tournament Sim
and Live Projection) in one file with three strict layers: cached data and model functions, figure
builders, and page layouts that hold no analysis at all.
Then it runs that one real final through six stages, each a call into a module you wrote. The win-probability model, fitted only on 2023–25 chases, puts Bengaluru at 86.5% at the innings break. The largest single swing is Sai Sudharsan caught off Bhuvneshwar Kumar in the fourth over. Virat Kohli made 75 not out off 42 and was player of the match, but Rasikh Salam's 3 for 27 added the most win probability of anyone (+0.112), because the final was won while Gujarat batted. The pre-match model, frozen the morning before, made Gujarat slight favourites (0.571 with the announced team sheets and home advantage) while the win-probability model made Bengaluru favourites at the first ball, and the chapter shows exactly why the two disagree. After ten overs Gujarat were 63 for 3, and the live simulator said about 164, with an 80% range of 135 to 195. The scoreboard's run rate said 126. The real total was 155.
Then come the model cards, seven of them, and the smoke tests: 37 tests that run in about three seconds, plus ten headless page runs and reproduction tests that check the assembled platform still produces the numbers earlier chapters published. Case Study 1 runs the WPL 2026 final through the same pipeline and shows what happens when a men's model is quietly used for a women's match: Bengaluru's chance at the innings break falls from 0.302 to 0.198. Smriti Mandhana's 87 off 41 is worth +0.659 of a win on the right model. Case Study 2 puts the Tournament Sim on trial for giving Punjab Kings a 95.6% chance of the top four halfway through IPL 2026. They finished fifth.
Chapter 40 — The Future of Cricket Analytics. Chapter 1 opened with "the numbers everyone quotes". This chapter opens with the forecasts everyone makes. A line through IPL first-innings averages from 2008 to 2022 forecast the next four seasons and missed all four, by up to 22.6 runs in 2026. So the chapter forecasts with prediction intervals and scenarios: three futures for the IPL in 2030 (193.2, 211.5 and 189.8, each with an interval 24 to 29 runs wide), six-hitting rising everywhere (women's full-member T20Is from 0.68 to 2.27 sixes per 100 balls since 2015), and spin's share of the bowling with no reliable trend in five of six groups.
It then asks what new data could add. Real ball-tracking and player tracking would answer questions
the public record can't. A match-only workload measure makes 56.6% of fast bowlers' weeks look
like dangerous "spikes", which says more about the gaps in the record than about anyone's body. An
audit of fifteen core questions finds that six need little or nothing beyond outcome data. And the
record is uneven: the bowler's type is known for 97.7% of IPL balls but 24.2% of men's
associate T20I balls. The chapter closes on ethics (player health data, fast data and match
integrity, who gets counted), on project/ROADMAP.md, thirteen extensions you could start next week,
and on Wendell Baptiste's last word.
The platform's report card
Chapter 39 freezes each model before the 2026 season and asks it to forecast the whole season, then compares it with the simple method anyone could use instead. Lower is better on every metric.
| Model | Scored on 2026 | Naive baseline | Verdict |
|---|---|---|---|
| Win probability (WP v1), ball by ball | Brier 0.1062 on 879 men's T20 chases | 0.2500 (the season base rate) | 57.5% better; calibration slope 0.99 |
| Pre-match model, IPL | Brier 0.2516 on 72 decided matches | 0.2500 (a coin flip) | 0.7% worse than a coin |
| Live projection after 10 overs, IPL | Mean miss 16.7 runs on 71 first innings | 24.0 runs (run rate × 20) | 30.3% better |
| Player projection (SR+) | RMSE 13.93 on 81 regulars | 20.19 (same as last season) | 31.0% better |
| Tournament simulator, IPL title | Gave the real champion 15.4%, the highest of the ten teams | One in ten | 18.6% better on log score |
Read the second row carefully, because it is the most important line in the table. The pre-match model didn't fail through carelessness. Chapter 24 showed that a model knowing every team's true strength would call only about 54% of IPL matches, so no model can do much better than a coin in the IPL. The honest response is to print that on the model card and on the page, not to tune the model until 2026 looks good. The other rows have their own warnings too: in the IPL alone, win probability under-rated chasers again in 2026, and the live projection's 80% ranges held only 69% of totals after fifteen overs. A platform that tells you where it is weak is more useful than one that only tells you where it is strong.
What you build
| Chapter | Deliverable | What it gives you |
|---|---|---|
| 39 | project/app.py |
The seven-page dashboard: cached layer-1 functions such as wp_model, match_centre_data, predictor, ipl_season_sim and live_path; fig_* figure builders; page_* layouts |
| 39 | project/tests/test_smoke.py |
One smoke test per Crease module plus an import-everything test; runs under plain Python or pytest |
| 39 | project/README.md |
Install and run instructions, the architecture, a page table, a module table and short model cards |
| 40 | project/ROADMAP.md |
Thirteen extensions in three groups (keep it honest, widen what it sees, turn models into decisions), each with the modules it builds on, the data it needs, a first step and a test for "done", plus an ethics checklist |
Neither chapter adds a module to project/crease/. Part VIII is the first time the package is used
as a whole, and the last time this book adds to it. After this, you do.
Learning paths through Part VIII
🏏 Fan Track: Read the hooks of both chapters. In Chapter 39, read §39.3 to §39.7, the IPL 2026 final told ball by ball and model by model, and §39.8 for the honest limits of each model; the prose carries the argument without the code. In Chapter 40, read §40.1 (a one-page summary of what the whole book found), §40.3 on how tactics have really changed, §40.7 on ethics, and "Close of play".
📊 Analyst Track: Everything, in order, with the code running. Chapter 39's architecture (§39.1–39.2), model cards (§39.8) and testing (§39.9) are what turn a set of notebooks into a portfolio piece. In Chapter 40, §40.2 (prediction intervals and broken trends) and §40.5 (why a workload proxy misleads) are the methods to take away. Then pick an item from the roadmap.
🎰 Betting Track: Read Chapter 39 §39.6 and Card 2 in §39.8. The pre-match model's 2026 card says plainly that it shouldn't be used for IPL betting, and the reason is a lesson in itself. Case Study 2 shows a confident 95.6% coming undone. In Chapter 40, read the section on fast data and match integrity in §40.7.
🏆 Fantasy Track: Chapter 39's Player Explorer (§39.10) shows a next-season projection with an honest range: Kohli's 2027 SR+ of 102.1 comes with an 80% range of 89.2 to 115.0. The WPA discussion in §39.5 is a sharper way to think about who actually won a match than any points table. In Chapter 40, §40.2 shows why last season's scoring levels won't hold.
🧑💼 Franchise Track: Chapter 39 §39.6, §39.8 and the Auction Board and Matchups pages in §39.10, then the roadmap in §39.11. Model cards are the document a head coach should ask for before trusting any number. In Chapter 40, read §40.2, §40.4–40.6 before buying tracking or wearable data, and §40.7 on player privacy. Chapter 40's Case Study 1 is a drift alarm you could run in-season.
Before you begin
- [ ] Install Streamlit, the one library only Chapter 39 needs:
pip install streamlit. Everything else inapp.pyimports and runs without it, so the chapter's scripts work even if the install fails. - [ ] Run the smoke tests from the book's root folder:
python project/tests/test_smoke.py. Every module should printPASS. If one printsFAIL, fix it before you start: Chapter 39 calls fifteen Crease modules directly and leans on the rest through them. - [ ] Check that the modules the dashboard leans on hardest run:
winprob.py(Chapter 20),match_model.py(Chapter 24),projection.py(Chapter 25),live.py(Chapter 27),tournament.py(Chapter 28),matchups.py(Chapter 11),valuation_batting.py(Chapter 13) andcharts.py(Chapter 7). - [ ] Budget time. The first visit to each dashboard page fits its models and takes 5 to 20 seconds;
after that it is instant. Chapter 39's model-card script takes about a minute, and its
checkpoint about two minutes from cold. On Windows, set
PYTHONIOENCODING=utf-8before running Chapter 40's scripts. - [ ] Have
project/PORTFOLIO.mdfrom Chapter 38 open. Its model-card slots are the ones Chapter 39 fills in. - [ ] Re-read the calibration section of Chapter 20. Brier score, calibration slope and "out of time" are the vocabulary of every model card. Keep Appendix D to hand.