Skip to content

LearnCode801/IPL-score-prediction

Repository files navigation

🏏 IPL First Innings Score Prediction

This is one of my favorite end-to-end machine learning projects where I worked on predicting the first-innings score in an IPL match. I personally handled everything – from data collection and preprocessing, to model training, evaluation, and finally deploying the solution as a Flask web application.

🔗 Demo Video: Watch here 📷 Web App Screenshot: App Screenshot 📓 Jupyter Notebook: View Here


📌 Objective

My goal was to build a model that predicts the final first-innings score of an IPL match using real-time match data such as:

  • Batting and bowling teams
  • Current runs, wickets, overs
  • Runs and wickets in the last 5 overs

🗂️ Project Workflow

This project follows a complete ML pipeline:

  1. Data Collection:

    • Collected ball-by-ball IPL data (2008–2017) from Kaggle.
  2. Data Preprocessing:

    • Cleaned dataset by removing unnecessary columns like mid, venue, batsman.
    • Filtered consistent teams and dropped overs less than 5 for meaningful stats.
    • Performed categorical encoding using get_dummies().
    • Split data into training (till 2016) and testing (2017) sets.
  3. Model Training:

    • Trained a Linear Regression model using Scikit-learn.
    • Achieved an R² score of ~82%, which accurately captures scoring trends.
  4. Model Saving:

    • Saved the trained model with Python’s pickle as lr-model.pkl.
  5. Flask Deployment:

    • Developed a user-friendly Flask web app with HTML frontend.
    • Users can select teams, overs, runs, wickets, etc., and instantly get predicted scores.

⚙️ Technologies Used

  • Python, Pandas, NumPy – Data processing
  • Matplotlib – Visualization
  • Scikit-learn – Machine Learning (Linear Regression)
  • Flask – Web deployment
  • HTML/CSS – Frontend UI

🚀 Sample Prediction

Example Input:

  • Batting team: Mumbai Indians
  • Bowling team: CSK
  • Overs completed: 12.3
  • Runs: 105
  • Wickets: 3
  • Runs in last 5 overs: 45
  • Wickets in last 5 overs: 2

Predicted Final Score: 178 Runs


🧪 Model Performance

Metric Result
Algorithm Linear Regression
Train/Test Split 80/20
Evaluation Metric R² Score
Accuracy ~82%

👨‍💻 My Role

I designed, implemented, and deployed the entire project myself — from data engineering, feature engineering, and model training, to building the Flask web app and deploying it locally for demonstration.


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages