File size: 3,482 Bytes
cd884e8 42507d4 cd884e8 42507d4 | 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 | # Soccer Feature Engineering Hackathon — 33 Match-Level Features
This repository contains a complete, reproducible feature engineering pipeline for the **Kaggle Soccer Feature Engineering Hackathon**, built from SkillCorner Open Data.
## Output
- **`features.csv`** — 18 rows (9 matches × 2 teams), 35 columns:
- `match_id`, `team_id`
- **33 engineered features** across 5 behavioral dimensions
All values are raw aggregated counts or cumulative distances — no percentages, no ratios.
## Feature Architecture
| Dimension | Features | Description |
|-----------|----------|-------------|
| **Attacking Structure** | `att1`–`att5` | Passes/carries into final third, opponents bypassed, last-line breaks, advanced possession |
| **Build-Up Profile** | `att6`–`att10` | Phase-type volume vector (build_up, direct, set_play, quick_break, transition) |
| **Possession Quality** | `att11`–`att20` | Tempo, threat creation, defensive-line displacement (metres), passing options |
| **Pressing & Defensive Shape** | `def1`–`def7` | Pressing volume, counter-press, recovery press, chain architecture, danger stopped |
| **Off-Ball Movement Intelligence** | `run1`–`run5` + `att_give_and_go_initiated` | Line-breaking, line-pushing, behind, overlap, attacking-third runs, give-and-go |
## How to Run
```bash
git clone https://github.com/SkillCorner/opendata.git
pip install pandas numpy
python soccer_feature_engineering.py
```
The script dynamically discovers all `*_dynamic_events.csv` files via `glob` — no hardcoded match IDs required.
## Extended Analysis
`soccer_feature_engineering_extended.py` adds:
| Output | Description |
|--------|-------------|
| `features_first_half.csv` | All 33 features computed on 1st-half events only |
| `features_second_half.csv` | All 33 features computed on 2nd-half events only |
| `features_halves_diff.csv` | 2nd half minus 1st half — reveals tactical fatigue & in-game adjustments |
| `behavioral_fingerprint.csv` | 16-dim fingerprint per team-match (phase profile + pressing + runs + structure) |
| `cluster_labels.csv` | KMeans cluster assignments (k=4) on standardized fingerprint |
| `archetype_profiles.csv` | Centroid profiles for each discovered tactical archetype |
| `similarity_matrix.csv` | Pairwise cosine similarity between all 18 team-match fingerprints |
| `analysis.png` | Radar chart grid of the 4 archetypes |
## Tactical Archetypes Discovered (k=4)
| Cluster | Signature | Characteristics |
|---------|-----------|-----------------|
| **0** — "Resilient Block" | Low build-up (71.6), modest pressing, balanced all-around | Conservative teams that stay compact; low risk, low reward |
| **1** — "Aggressive Dominator" | High build-up (85.0), massive pressing chains (231.7), elite off-ball runs (115.7) | High-press, high-tempo teams that generate territory and options |
| **2** — "Transition Specialist" | Low build-up (45.3), high quick_breaks (10.3), low runs (8.3) | Relies on direct play and transitions; minimal patient possession |
| **3** — "Organized Builder" | Highest build-up (90.3), balanced pressing, disciplined runs | Patient positional play with systematic defensive line pressure |
## Data Source
[SkillCorner Open Data](https://github.com/SkillCorner/opendata) — 9 matches of Australian A-League 2024/2025, MIT License.
## Requirements
- Python 3.8+
- pandas, numpy
- scikit-learn (for extended clustering)
- matplotlib, seaborn (for extended visualizations) |