ClementeH commited on
Commit
d6e8b2d
·
verified ·
1 Parent(s): e8a95d2

Upload README.md with huggingface_hub

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