This Project implements a simple IPL win prediction model using machine learning. It analyzes historical match data, cleans the dataset, and trains a logistic regression model.
This Streamlit web application predicts the probability of winning an IPL match based on various input parameters such as the batting team, bowling team, host city, target score, current score, overs completed, and wickets out.
- Python 3
- Streamlit library
- Pickle library
- pandas
- scikit-learn
- Reads match and delivery data from CSV files.
- Filters relevant columns and creates a DataFrame for total scores.
- Handles team name inconsistencies and selects specific teams.
- Eliminates matches with DL applied.
- Creates a new DataFrame with essential columns for analysis.
- Calculates cumulative scores, runs, and wickets for each ball.
- Computes current run rate (CRR) and required run rate (RRR).
- Defines a function to determine the match result.
- Prepares the dataset for training and splits it into training and testing sets.
- Uses one-hot encoding for categorical variables.
- Constructs a logistic regression pipeline.
- Fits the model and evaluates accuracy.
- Saves the trained model using pickle.
- Implements a Streamlit web app for real-time predictions.
- Allows user input for batting team, bowling team, city, target, current score, overs, and wickets.
- Displays the win probability for both teams dynamically, with color-coded results.
-
Clone the repository:
git clone https://github.com/Surajkumar4-source/ipl-win-prediction-streamlit.git
-
Install the required libraries:
pip install streamlit pandas scikit-learn
-
Run the Streamlit app:
streamlit run app.py
-
Select Teams and City:
- Choose the batting team, bowling team, and host city from the dropdown menus.
-
Enter Match Details:
- Enter the target score, current score, overs completed, and wickets out.
-
Predict the Outcome:
- Click the "Predict Probability" button to get the win probability.
Enjoy predicting IPL match outcomes! 🍀