This repository contains code to predict the Expected Goals (xG) from shots in football using various machine learning models like Logistic Regression, XGBoost, and Random Forest.
Expected Goals (xG) is a statistical metric used in football (soccer) that quantifies the probability of a shot resulting in a goal based on various features and historical data. This repository provides a predictive model to estimate xG for shots taken during a football match.
The dataset used for this project includes information about shots taken during football matches. It contains features such as:
- Shot location
- Shot angle
- Distance from goal
- Type of play leading to the shot (e.g., open play, set-piece)
- Other relevant match and player-specific information
The dataset can be downloaded from this website: https://www.kaggle.com/datasets/joopauloduartelima/football-event-data/
You can find how the models performed in terms of accuracy, precision, recall and training time in the following table:
- Simple logistic regression model trained to predict xG based on shot features.
- Gradient Boosting algorithm using the XGBoost library to predict xG. It offers improved performance over traditional boosting methods.
- Ensemble learning method using Random Forest to predict xG by aggregating multiple decision trees.
- Clone the repository:
git clone https://github.com/AnshChoudhary/xGModel.git
- Install the necessary dependencies:
pip install -r requirements.txt
- Run the notebooks or scripts associated with each model to train the models and predict xG from shots.