https://github.com/oguzhansarigol/expected-goals-xg-data-analysis
We will analyze in our code the expected goal locations of football players based on which areas of the field, at what times, with which feet, using which parts of their bodies, and from which angles and distances they are most likely to score.
https://github.com/oguzhansarigol/expected-goals-xg-data-analysis
data-analysis-python expected-goals numpy pandas-python python
Last synced: about 2 months ago
JSON representation
We will analyze in our code the expected goal locations of football players based on which areas of the field, at what times, with which feet, using which parts of their bodies, and from which angles and distances they are most likely to score.
- Host: GitHub
- URL: https://github.com/oguzhansarigol/expected-goals-xg-data-analysis
- Owner: oguzhansarigol
- Created: 2024-07-08T21:22:45.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-12-08T19:58:02.000Z (5 months ago)
- Last Synced: 2025-04-06T02:44:58.165Z (about 2 months ago)
- Topics: data-analysis-python, expected-goals, numpy, pandas-python, python
- Language: HTML
- Homepage:
- Size: 1.48 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Expected Goals (xG) Analysis
This project analyzes the expected goal locations of football players based on various factors such as field areas, times, feet used, body parts used, angles, and distances. The analysis is performed using a dataset containing shot events from football matches.
## Table of Contents
- [Introduction](#introduction)
- [Dataset](#dataset)
- [Installation](#installation)
- [Usage](#usage)
- [Analysis](#analysis)
- [Visualizations](#visualizations)
- [Conclusion](#conclusion)## Introduction
Expected Goals (xG) is a metric used to measure the likelihood of a shot resulting in a goal. This project aims to analyze the xG values based on various factors and visualize the results using different plots and graphs.
## Dataset
The dataset used in this project contains the following columns:
1. **playerId**: Unique identifier for each player.
2. **id**: Unique identifier for each shot event.
3. **x_coordinates**: X coordinate of the shot on the field.
4. **y_coordinates**: Y coordinate of the shot on the field.
5. **goal**: Binary indicator whether the shot resulted in a goal (1 for yes, 0 for no).
6. **time**: Time of the shot event in the game.
7. **foot**: Indicator of which foot was used for the shot (1 for right foot, 0 for left foot).
8. **bodypart**: Indicator of which part of the body was used for the shot (1 for foot, 2 for head, 3 for other).
9. **preference**: Binary indicator whether the shot was taken with the player's preferred foot (1 for yes, 0 for no).
10. **angles**: Angle at which the shot was taken relative to the goal.
11. **distance**: Distance from which the shot was taken to the goal.
12. **xG**: Expected goals value, a measure of the likelihood that a shot results in a goal.## Installation
To run this project, you need to have the following libraries installed:
- pandas
- seaborn
- matplotlib
- numpy
- google.colab (if using Google Colab)You can install the required libraries using pip:
```markdown
```bash
pip install pandas seaborn matplotlib numpy google-colab