Datasets:
File size: 5,722 Bytes
506f2f3 170f269 506f2f3 | 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 | ---
language: [en]
license: cc-by-4.0
task_categories:
- tabular-classification
tags:
- sports-analytics
- soccer
- football
- expected-goals
- freeze-frames
- statsbomb
- deep-sets
size_categories:
- 10M<n<100M
configs:
- config_name: default
data_files:
- split: train
path: "data/**/*.parquet"
---
# xG Freeze-Frame Data — StatsBomb 360
**~15.58M freeze-frame rows** from 323 StatsBomb 360 matches, capturing player positions at the moment of each shot. Each row represents one visible player in one shot event.
Part of the (Right! Luxury!) Lakehouse soccer analytics platform.
## Quick Start
```python
from datasets import load_dataset
ds = load_dataset("luxury-lakehouse/xg-freeze-frame-data")
df = ds["train"].to_pandas()
# Average number of visible players per shot
df.groupby("event_id").size().describe()
```
> **Explore interactively:** [Soccer Analytics App](https://huggingface.co/spaces/luxury-lakehouse/soccer-analytics-app)
## What Is This Dataset?
StatsBomb 360 data includes inline freeze frames for each event — a snapshot of every visible player's position at the instant of the event. This dataset extracts freeze-frame rows specifically for shot events, providing the spatial context that the [xG v2 set encoder](https://huggingface.co/luxury-lakehouse/xg-v2-model-set-encoder) uses to condition expected goals predictions on defensive positioning.
Each row represents one player visible in one shot. A single shot typically has 10–22 freeze-frame rows (one per visible player). The set encoder aggregates these into a fixed-length context vector using permutation-invariant sum pooling.
## Schema
| Column | Type | Description |
|--------|------|-------------|
| `event_id` | `string` | Shot event ID (FK to xG Shot Data) |
| `match_id` | `bigint` | Match identifier |
| `competition_id` | `bigint` | Competition identifier |
| `season_id` | `bigint` | Season identifier |
| `player_x_norm` | `double` | Player x position normalized to [0, 1] from StatsBomb 120-yard pitch |
| `player_y_norm` | `double` | Player y position normalized to [0, 1] from StatsBomb 80-yard pitch |
| `is_keeper` | `boolean` | Whether the player is the goalkeeper |
| `is_teammate` | `boolean` | Whether the player is on the shooting team |
### Coordinate System
Raw positions are in the **StatsBomb coordinate system** (120 × 80 yards, origin at bottom-left, attacking direction left to right). The `player_x_norm` and `player_y_norm` columns are normalized:
```
x_norm = location_x / 120.0
y_norm = location_y / 80.0
```
## Data Sources
| Source | Coverage | License |
|--------|----------|---------|
| [StatsBomb Open Data](https://github.com/statsbomb/open-data) (360 subset) | ~323 matches with inline freeze frames | CC-BY 4.0 |
Only StatsBomb 360 matches include freeze-frame data. Non-360 StatsBomb matches and all Wyscout matches do not contribute to this dataset. The xG v2 model handles missing freeze frames by falling back to a zero context vector.
## Companion Resources
| Resource | Type | Description |
|----------|------|-------------|
| [xG v2 Set Encoder](https://huggingface.co/luxury-lakehouse/xg-v2-model-set-encoder) | Model | Deep Sets encoder + MLP that consumes this dataset as spatial context |
| [xG Shot Data](https://huggingface.co/datasets/luxury-lakehouse/xg-shot-data) | Dataset | Tabular shot features (joins on `event_id`) |
| [xG Model v1](https://huggingface.co/luxury-lakehouse/xg-model-statsbomb-wyscout) | Model | Tabular-only XGBoost baseline (no freeze-frame context) |
## Limitations
- **Partial visibility**: StatsBomb 360 captures only *visible* players. Players behind the camera or in crowded areas may be absent. The set encoder handles this gracefully (fewer rows per shot), but predictions may underestimate defensive pressure when defenders are occluded.
- **StatsBomb 360 only**: Covers ~323 of ~3,000 StatsBomb matches. The majority of shots in the xG Shot Data dataset do not have corresponding freeze-frame rows.
- **Shot events only**: This dataset extracts freeze frames for shots specifically. Freeze frames for other event types (passes, tackles) are not included.
- **No player identity**: The dataset includes spatial position and role flags only. Player name, jersey number, height, and other attributes are not captured.
## Citation
If you use this dataset, please cite StatsBomb and the Deep Sets architecture:
```bibtex
@misc{statsbomb2024opendata,
title={StatsBomb Open Data},
author={{StatsBomb}},
year={2024},
url={https://github.com/statsbomb/open-data},
note={CC-BY 4.0}
}
```
```bibtex
@inproceedings{zaheer2017deep,
title={Deep Sets},
author={Zaheer, Manzil and Kottur, Satwik and Ravanbakhsh, Siamak
and P{\'o}czos, Barnab{\'a}s and Salakhutdinov, Ruslan
and Smola, Alexander J.},
booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
volume={30},
year={2017}
}
```
## More Information
- **License**: [CC-BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **Publishing script**: `scripts/publish_xg_shots_hf.py`
- **Platform**: [Luxury Lakehouse Soccer Analytics](https://github.com/karsten-s-nielsen/luxury-lakehouse)
## PR 7 changelog (2026-04-27)
The lineage mart `fct_shots` now carries Kimball surrogate FKs (`team_key`, `player_key`) alongside the existing `match_key` (PR 3) and the legacy `team_id`/`player_id` INT columns during the 2026-07-22 dual-column window per ADR-011. The freeze-frame payload itself is unchanged at this grain; the keys flow through `fct_xg_predictions_v2` (the v2 set-encoder mart) via INNER JOIN to `fct_shots`. PR 8 will sunset legacy IDs post-2026-07-22.
|