A practical IPL/T20 prediction starter project with:
- Data foundation (match, player, venue, team-form, and ball-by-ball CSVs)
- Feature-ready training frame for chase prediction
- Streamlit web app to explore datasets and predict outcomes
- Sample IPL datasets across multiple granularities (match-level, player-level, and delivery-level)
- Starter chase-state training data (
final_df.csv) - Streamlit app with:
- Predict Winner workflow
- Data Explorer workflow for all CSVs in
data/ - Heuristic fallback prediction if
models/pipe.pklis not available
CRICKET_PREDICTOR/
β
βββ app/
β βββ app.py
βββ data/
β βββ raw_data.csv
β βββ final_df.csv
β βββ player_stats.csv
β βββ matches.csv
β βββ deliveries.csv
β βββ players.csv
β βββ batting_stats.csv
β βββ bowling_stats.csv
β βββ venues.csv
β βββ head_to_head.csv
β βββ team_form.csv
β βββ team_strength_metrics.csv
β βββ match_conditions.csv
βββ notebooks/
β βββ data_cleaning.ipynb
βββ models/
β βββ pipe.pkl # optional (trained model)
βββ requirements.txt
βββ README.md
data/matches.csv- Key fields include:
match_id,season,city,venue,team1,team2,toss_winner,winner,team1_score,team2_score
data/deliveries.csv- Key fields include:
match_id,inning,over,ball,batsman,bowler,runs_scored,extras,wicket
data/players.csv,data/player_stats.csv- Includes role, batting/bowling style, team, experience, and lifetime indicators
data/batting_stats.csvdata/bowling_stats.csv- Includes strike-rate/economy and phase-relevant metrics
data/venues.csvdata/head_to_head.csvdata/team_form.csvdata/team_strength_metrics.csvdata/match_conditions.csv
These are useful for engineered features like:
- toss impact
- venue advantage
- recent form difference
- head-to-head ratio
- batting vs bowling strength gap
- Start with
raw_data.csv/deliveries.csv. - Build ball-by-ball chase-state features.
- Use
final_df.csvas a baseline schema. - Join context data (venue/team form/head-to-head/player strength).
- Split train/test by match or season (avoid leakage).
- Train baseline Logistic Regression and tree models (Random Forest / XGBoost).
- Save the best pipeline to
models/pipe.pkl.
python scripts/train_model.py-
Predict Winner tab
- Enter batting team, bowling team, city, target, score, overs, wickets
- See win probability for both teams
- View derived match-state features + engineered context features
-
Data Explorer tab
- Browse all
data/*.csv - Inspect rows/columns in-app
- Download selected CSV directly
- Browse all
If
models/pipe.pkldoes not exist, the app still predicts using a built-in heuristic fallback.
- Predict Winner tab
- Enter batting team, bowling team, city, target, score, overs, wickets
- See win probability for both teams
- View derived match-state features + engineered context features
- Replace sample CSVs with full historical IPL datasets.
- Add training scripts (
scripts/feature_engineering.py,scripts/train_model.py). - Evaluate with season-wise validation.
- Persist the best model to
models/pipe.pkl.
- streamlit
- pandas
- numpy
- scikit-learn
- xgboost
- jupyter
This project uses the repository's LICENSE file.
