Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

21 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

here is an image of the product and the link is in the discription!

Alt text

🏏 Cricket Win Predictor

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

✨ What this repository provides

  • 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.pkl is not available

πŸ—‚οΈ Project structure

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

πŸ“Š Dataset guide

1) Match-level data

  • data/matches.csv
  • Key fields include: match_id, season, city, venue, team1, team2, toss_winner, winner, team1_score, team2_score

2) Ball-by-ball data

  • data/deliveries.csv
  • Key fields include: match_id, inning, over, ball, batsman, bowler, runs_scored, extras, wicket

3) Player profile data

  • data/players.csv, data/player_stats.csv
  • Includes role, batting/bowling style, team, experience, and lifetime indicators

4) Player performance data

  • data/batting_stats.csv
  • data/bowling_stats.csv
  • Includes strike-rate/economy and phase-relevant metrics

5) Team & venue context

  • data/venues.csv
  • data/head_to_head.csv
  • data/team_form.csv
  • data/team_strength_metrics.csv
  • data/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

🧠 Modeling blueprint (recommended)

  1. Start with raw_data.csv / deliveries.csv.
  2. Build ball-by-ball chase-state features.
  3. Use final_df.csv as a baseline schema.
  4. Join context data (venue/team form/head-to-head/player strength).
  5. Split train/test by match or season (avoid leakage).
  6. Train baseline Logistic Regression and tree models (Random Forest / XGBoost).
  7. Save the best pipeline to models/pipe.pkl.

πŸš€ Run the app

python scripts/train_model.py

App capabilities

  • 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

If models/pipe.pkl does not exist, the app still predicts using a built-in heuristic fallback.

App capabilities

  • 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

βœ… Next steps

  • 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.

πŸ“¦ Core dependencies

  • streamlit
  • pandas
  • numpy
  • scikit-learn
  • xgboost
  • jupyter

πŸ“ License

This project uses the repository's LICENSE file.

About

πŸ“Œ Project Overview This project is a Machine Learning-based Web Application designed to predict the winning probability of the chasing team in a T20 cricket match (specifically IPL).The streamlit web link is given below ---->

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages