https://github.com/anshchoudhary/xgmodel
This repository contains code to predict the Expected Goals (xG) from shots in football using various machine learning models.
https://github.com/anshchoudhary/xgmodel
data-science football-analytics football-data machine-learning machine-learning-algorithms
Last synced: 6 months ago
JSON representation
This repository contains code to predict the Expected Goals (xG) from shots in football using various machine learning models.
- Host: GitHub
- URL: https://github.com/anshchoudhary/xgmodel
- Owner: AnshChoudhary
- Created: 2023-12-11T13:43:31.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-06-21T07:20:12.000Z (over 1 year ago)
- Last Synced: 2025-04-10T00:52:50.756Z (6 months ago)
- Topics: data-science, football-analytics, football-data, machine-learning, machine-learning-algorithms
- Language: Jupyter Notebook
- Homepage:
- Size: 840 KB
- Stars: 13
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Football Expected Goals (xG) Prediction
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.
## Overview
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.
## Dataset
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 informationThe dataset can be downloaded from this website: https://www.kaggle.com/datasets/joopauloduartelima/football-event-data/
## Results
You can find how the models performed in terms of accuracy, precision, recall and training time in the following table:
## Models Implemented
### 1. Logistic Regression
- Simple logistic regression model trained to predict xG based on shot features.### 2. XGBoost
- Gradient Boosting algorithm using the XGBoost library to predict xG. It offers improved performance over traditional boosting methods.### 3. Random Forest
- Ensemble learning method using Random Forest to predict xG by aggregating multiple decision trees.## Usage
1. Clone the repository:
```bash
git clone https://github.com/AnshChoudhary/xGModel.git
2. Install the necessary dependencies:
```bash
pip install -r requirements.txt
3. Run the notebooks or scripts associated with each model to train the models and predict xG from shots.