Inspiration
In T20 cricket, the scorecard often hides who actually won the game. A batter who scores 40 when the match is already decided looks the same as one who scores 40 off 20 balls with 60 needed from 30. As an IPL fan, I wanted to measure impact, not just output: how likely a chase is to succeed at any moment, and which players move that number when it matters most.
What it does
How we built it
Data: ball-by-ball JSON for 1,243 IPL matches (295,557 deliveries) from Cricsheet, parsed into a single table with Python and pandas. The parser handles wides, no-balls, rain-adjusted (DLS) targets and super overs. Machine learning: each ball of every second innings becomes a training example with four features (runs needed, balls left, wickets left and required run rate), labelled by whether the chasing team won. I trained a gradient-boosted decision tree classifier (scikit-learn’s HistGradientBoostingClassifier) with monotonic constraints, so the model always follows cricket logic. For example, more wickets in hand can never lower a team’s chances. Validation: a time-based split, training on 2008–2024 and testing on the unseen 2025–2026 seasons. The model reaches 80% accuracy and a Brier score of 0.139, against 0.248 for a baseline, which is about a 44% reduction in error. Analytics: Win Probability Added, calculated by crediting each ball’s probability change to the batter and bowler involved. App: Streamlit and Plotly for the interactive dashboard, deployed on Streamlit Community Cloud.
Challenges we ran into
Messy cricket data: wides and no-balls don’t count as legal deliveries, rain-shortened matches have revised targets, and super overs had to be excluded so they didn’t distort the chases. Avoiding data leakage: a random train/test split would let the model learn from balls in the same match it’s tested on. Splitting by season gives an honest score. Keeping the model sensible: without constraints, a tree model can learn odd rules from noisy data, such as having more wickets left looking worse. Monotonic constraints fixed this. Environment issues: a mismatch between Python versions stopped the trained model from loading in the app until I ran everything inside one virtual environment
Accomplishments that we're proud of
A model that’s 80% accurate on seasons it never saw, built on nearly 300,000 real deliveries. Turning a prediction model into an analytics tool: WPA ranks players by impact rather than by raw runs and wickets. A complete, deployed app that a fan, analyst or captain can use without writing any code.
What we learned
How to frame a sports question as a machine learning problem: choosing features, labels and an honest validation method. Why probability quality (the Brier score) matters as much as accuracy for a win-probability model. How much context changes the value of a run, and that the same stat can mean very different things depending on the match situation.
What's next for IPL's IQ
First-innings model: predict win probability from ball one, not just during the chase. More context features: venue, pitch conditions, team strength and the batters at the crease. Smoother predictions: calibrate the model so every single ball registers a change in win probability. More leagues: extend it to international T20s, the Big Bash and the PSL, all of which are available from Cricsheet. Live mode: connect to a live score feed for real-time win probability during matches.
Log in or sign up for Devpost to join the conversation.