Football · live repo
Live repoOpen data (StatsBomb)Contextual Football Metrics
CxG / CxA / CxT training pipeline
View the repo →What this is
A single Prefect flow under one MLflow parent run, with a model ladder from baseline through GLM to boosting and neural, and a from-scratch graph-attention encoder in plain PyTorch.
Metrics
Contextual GLM
0.8131 AUC · Brier 0.06669
vs logistic 0.7982
Validation
5-fold CV 0.8083
Honesty
Season-level CxA ranks assist-makers weakly: Spearman 0.39 vs CxG 0.69 for goals
Testing
560 tests · CI with an enforced coverage floor
Stack
What I would not claim
- catboost
- captum
- plotly
- kaleido
- pydantic
- imbalanced-learn
- DVC-tracked pipeline
- cloud/GPU training
Does the context earn its place?
Each metric against the baseline it has to beat, over identical held-out rows with a paired bootstrap. One of the three does not beat its benchmark, and the verdict says so in the repo’s own words.
NO DEMONSTRABLE LIFT over statsbomb_xg: neither log-loss nor AUC improvement has a CI excluding zero. Honest conclusion - contextual context does not yet beat off-the-shelf xG.
1,340 held-out shots · 126 goals · 2,000-sample paired bootstrap
| Model | Log loss | Brier | ROC AUC | ECE | Mean prediction |
|---|---|---|---|---|---|
| statsbomb xGbenchmark | 0.2333 | 0.0645 | 0.8295 | 0.0126 | 0.1042 |
| baseline logit | 0.2505 | 0.0694 | 0.7985 | 0.0210 | 0.1070 |
| GLM contextualthis model | 0.2413 | 0.0667 | 0.8131 | 0.0171 | 0.1049 |
Change vs baseline, with 95% bootstrap interval
The dashed cyan line is zero. An interval that straddles it does not support a claim, however good the point estimate looks.
Log loss vs statsbomb xG
CI crosses zeroΔ 0.0080 [-0.0039, 0.0197]lower is better
ROC AUC vs statsbomb xG
CI crosses zeroΔ -0.0164 [-0.0431, 0.0094]higher is better
Log loss vs baseline logit
CI excludes zeroΔ -0.0093 [-0.0172, -0.0018]lower is better
ROC AUC vs baseline logit
CI crosses zeroΔ 0.0149 [-0.0030, 0.0329]higher is better
External validity
player-level, pooled over all ingested matches; metrics scored by the production model, goals/assists from raw events
CxG vs actual goals
0.689 Spearman
n = 300 players
CxG ranks players by goals reliably (Spearman 0.69): usable to shortlist goals on expected rather than realised output.
CxA vs actual assists
0.388 Spearman
n = 1,113 players
CxA does not rank assists well (Spearman 0.39): treat as weak external validity; do not scout on it alone.
Open StatsBomb data. Verdict and decision strings are quoted verbatim from the committed reports, including where the conclusion is negative.
Data provenance. Committed reports from contextual-football-metrics (incremental_lift_cx{g,a,t}.json, external_validity.json), generated into data/contextual-lift.json. Open StatsBomb data.