An end-to-end data science project analyzing 17 years of IPL cricket data (2008–2024) to uncover team and player performance patterns, and to predict match outcomes using machine learning.
- Source: IPL Complete Dataset (2008–2024) by patrickb1912 on Kaggle
- Files used:
matches.csv(1,095 matches) anddeliveries.csv(260,920 ball-by-ball records) - Not included in this repo due to size — download from the Kaggle link above and place both CSVs in a
data/folder before running.
- Handled missing values contextually (e.g., no-result matches filled with
"No Result", missing D/L method filled with"Standard") - Standardized historically renamed team names (e.g., Delhi Daredevils → Delhi Capitals, Kings XI Punjab → Punjab Kings) across both datasets
- Verified data integrity with automated tests (
tests.py)
Performed using Pandas, NumPy, Matplotlib, and Seaborn to uncover:
- Season-wise match trends
- Toss impact on match outcomes
- Top run-scorers and wicket-takers
- Orange Cap and Purple Cap winners by season
- Super Over match history
- High-scoring match trends
- Umpire officiating frequency
- Target: Whether
team1wins the match (binary classification) - Features: Season, team1, team2, venue, toss winner, toss decision
- Models compared: Logistic Regression and Random Forest Classifier
- Encoding: Label Encoding for categorical features
- Split: 80/20 train-test split
| Model | Accuracy |
|---|---|
| Logistic Regression | 54.6% |
| Random Forest | 48.6% |
Cricket match outcomes are inherently unpredictable (weather, form, toss luck), so accuracy in the 50-55% range is realistic and consistent with published cricket prediction research.
- Toss impact is minimal: Winning the toss barely correlates with winning the match — nearly a 50/50 split in the data.
- High-scoring matches are rising sharply: 200+ run totals were rare before 2022 but have surged in recent seasons, reflecting rule changes (Impact Player) and flatter pitches.
- Top run-scorer (all-time): V Kohli, ~8,000 runs
- Top wicket-taker (all-time): YS Chahal
- Most experienced umpires: S Ravi and AK Chaudhary, both officiating 100+ matches
IPL-Cricket-Analysis/ ├── data/ # Kaggle CSVs (not included, see Dataset section) ├── outputs/ # Generated plots ├── preprocessing.py # Data loading and cleaning ├── eda.py # Exploratory data analysis and visualizations ├── modeling.py # Feature engineering and prediction models ├── tests.py # Automated sanity checks ├── main.py # Pipeline orchestrator └── README.md
- Clone this repository
- Download the dataset from Kaggle and place
matches.csvanddeliveries.csvin adata/folder - Install dependencies: pip install pandas numpy matplotlib seaborn scikit-learn
- Run the full pipeline: python main.py
This will clean the data, generate all EDA plots into outputs/, and train/evaluate both prediction models.
Laksha Ram