Datasets:
File size: 7,153 Bytes
16ce2fe | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 | ---
license: cc-by-sa-4.0
task_categories:
- tabular-classification
- tabular-regression
language:
- en
tags:
- football
- soccer
- xG
- expected-goals
- sports-analytics
- statsbomb
- messi
- analytics
pretty_name: StatsBomb Open Data — Football Shots (xG)
size_categories:
- 10K<n<100K
dataset_info:
features:
- name: match_id
dtype: int64
- name: competition_name
dtype: string
- name: season_name
dtype: string
- name: match_date
dtype: string
- name: team
dtype: string
- name: player
dtype: string
- name: x
dtype: float64
- name: y
dtype: float64
- name: distance_to_goal
dtype: float64
- name: angle_to_goal
dtype: float64
- name: under_pressure
dtype: bool
- name: shot_outcome_name
dtype: string
- name: shot_body_part_name
dtype: string
- name: shot_technique_name
dtype: string
- name: shot_type_name
dtype: string
- name: play_pattern_name
dtype: string
- name: xg_statsbomb
dtype: float64
- name: is_goal
dtype: int64
splits:
- name: train
num_examples: 70418
- name: validation
num_examples: 8802
- name: test
num_examples: 8803
---
# StatsBomb Open Data — Football Shots (xG)
**88,023 shot-level football records** extracted from [StatsBomb Open Data](https://github.com/statsbomb/open-data),
spanning **67 years of football** (1958–2025) across **21 competitions**, **48 seasons**, **308 teams**, and **6,147 players**.
Includes StatsBomb's own xG values as labels, making this the most complete open football shot dataset
available on HuggingFace for training Expected Goals models.
## Highlights
- 🏆 **Lionel Messi** — 2,670 shots, the most of any player in the dataset (18 La Liga seasons at Barcelona)
- 🌍 **Historical depth** — FIFA World Cup data from 1958 to 2022
- ⚽ **Both genders** — FA Women's Super League, Women's World Cup, UEFA Women's Euro included
- 📊 **StatsBomb xG labels** — use as regression target or benchmark for your own model
- 🎯 **Benchmark** — A GradientBoosting model trained on this dataset achieves ROC-AUC 0.8047, reaching 98% of StatsBomb's professional xG model performance (ROC-AUC 0.8198) using only 9 features
## Dataset Statistics
| Metric | Value |
|--------|-------|
| Total shots | 88,023 |
| Goals | 9,790 (11.1%) |
| Unique players | 6,147 |
| Unique teams | 308 |
| Competitions | 21 |
| Seasons | 48 |
| Date range | 1958-06-24 → 2025-07-27 |
| Mean xG per shot | 0.107 |
## Coverage by Competition
| Competition | Shots | Goals | Players | Seasons |
|-------------|-------|-------|---------|---------|
| La Liga | 21,210 | 2,658 | 1,312 | 18 |
| Premier League | 10,837 | 1,082 | 641 | 2 |
| Ligue 1 | 10,346 | 1,105 | 739 | 3 |
| Serie A | 10,033 | 955 | 475 | 2 |
| 1. Bundesliga | 8,747 | 947 | 560 | 2 |
| FA Women's Super League | 8,321 | 962 | 330 | 3 |
| FIFA World Cup | 3,904 | 443 | 890 | 8 |
| Women's World Cup | 2,994 | 327 | 576 | 2 |
| UEFA Euro | 2,629 | 281 | 547 | 2 |
| Champions League | 594 | 74 | 193 | 18 |
| *+ 11 more competitions* | | | | |
## Splits
| Split | Shots | Goals |
|-------|-------|-------|
| train | 70,418 | 7,825 (11.1%) |
| validation | 8,802 | 979 (11.1%) |
| test | 8,803 | 986 (11.2%) |
Stratified by `is_goal` to preserve goal rate across splits.
## Features
| Column | Type | Description |
|--------|------|-------------|
| `x` | float | Shot x-coordinate (StatsBomb pitch: 0–120, attacking direction) |
| `y` | float | Shot y-coordinate (StatsBomb pitch: 0–80) |
| `distance_to_goal` | float | Euclidean distance to goal center (120, 40) |
| `angle_to_goal` | float | Angle to goal in degrees |
| `under_pressure` | bool | Shooter was under defensive pressure |
| `shot_body_part_name` | string | `Right Foot` / `Left Foot` / `Head` / `Other` |
| `shot_technique_name` | string | `Normal` / `Volley` / `Half Volley` / `Lob` / `Overhead Kick` / `Backheel` |
| `shot_type_name` | string | `Open Play` / `Free Kick` / `Corner` / `Penalty` |
| `play_pattern_name` | string | `Regular Play` / `From Corner` / `From Free Kick` / etc. |
| `shot_outcome_name` | string | `Goal` / `Saved` / `Blocked` / `Off T` / `Wayward` / `Post` |
| `xg_statsbomb` | float | StatsBomb's official xG value — use as regression label or benchmark |
| `is_goal` | int | 1 if goal, 0 otherwise — binary classification label |
| `player` | string | Player full name |
| `team` | string | Team name |
| `competition_name` | string | Competition name |
| `season_name` | string | Season (e.g. `2019/2020`) |
| `match_date` | string | Match date (YYYY-MM-DD) |
| `match_id` | int | StatsBomb match identifier |
## Pitch Coordinates
StatsBomb uses a 120×80 coordinate system:
- `x=0` is the defensive goal line, `x=120` is the attacking goal line
- `y=0` is the left touchline, `y=80` is the right touchline
- Goal center is at `(120, 40)`
## Quick Start
```python
from datasets import load_dataset
ds = load_dataset("ClementeH/statsbomb-open-data-shots")
df = ds["train"].to_pandas()
# All Messi shots
messi = df[df["player"] == "Lionel Andrés Messi Cuccittini"]
print(f"Messi: {len(messi)} shots, {messi['is_goal'].sum()} goals, mean xG {messi['xg_statsbomb'].mean():.3f}")
# Train a simple xG model
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.preprocessing import LabelEncoder
features = ["x", "y", "distance_to_goal", "angle_to_goal", "under_pressure"]
X = df[features].astype(float)
y = df["is_goal"]
model = GradientBoostingClassifier(n_estimators=200, max_depth=4)
model.fit(X, y)
```
## Benchmark: xG Model Performance
A GradientBoosting model trained on this dataset (9 features) vs StatsBomb's professional xG:
| Model | Brier Score ↓ | ROC-AUC ↑ |
|-------|-------------|----------|
| Logistic Regression (baseline) | 0.0858 | 0.7706 |
| GradientBoosting (this dataset) | 0.0803 | **0.8047** |
| StatsBomb xG (professional) | 0.0770 | 0.8198 |
The open model reaches **98% of professional xG performance** using only position, body part, technique, shot type, and pressure.
See [`ClementeH/football-xg`](https://huggingface.co/ClementeH/football-xg) for the trained model *(coming soon)*.
## Attribution
> **Data provided by StatsBomb via [StatsBomb Open Data](https://github.com/statsbomb/open-data).**
> Licensed under [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/).
>
> You are free to share and adapt this data for any purpose, provided you give appropriate credit
> to StatsBomb and distribute your contributions under the same license.
>
> This dataset was processed and packaged for HuggingFace by [ClementeH](https://huggingface.co/ClementeH).
## Related Resources
- [statsbomb/open-data](https://github.com/statsbomb/open-data) — original raw JSON data
- [statsbombpy](https://github.com/statsbomb/statsbombpy) — official Python library
- [`ClementeH/football-xg`](https://huggingface.co/ClementeH/football-xg) — xG model trained on this dataset *(coming soon)*
- [`ClementeH/football-xg-analyzer`](https://huggingface.co/spaces/ClementeH/football-xg-analyzer) — interactive Space *(coming soon)*
|