couto commited on
Commit
4c87f1d
Β·
verified Β·
1 Parent(s): cb42375

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +123 -13
README.md CHANGED
@@ -9,7 +9,7 @@ tags:
9
 
10
  # 12yd β€” Penalty Shootout Side Prediction
11
 
12
- Multiclass classifier (L / C / R) on 18 per-kick features; trained on 179 shootout kicks across 6 national-team tournaments (2021–2022). Frozen deployment artifact for `matheusccouto/12yd`.
13
 
14
  ## Save rate is the deployment KPI
15
 
@@ -40,10 +40,14 @@ should compare to the baselines.
40
 
41
  `random` and `last-side` baselines are deterministic and do not depend on
42
  the retrain; the v2 numbers are pinned. The `lightgbm` and `logreg` rows
43
- reflect the v3 fit on the v2 179-kick training set (the 18 formerly-skipped
44
- refs have URL rotation issues and need a separate fix β€” see `## Further
45
- Notes`); the `actual keeper` row is `null` because StatsBomb does not
46
- yet publish per-keeper dive-direction data for the in-scope tournaments.
 
 
 
 
47
 
48
  ### Statistical caveat β€” 28-row holdout
49
 
@@ -57,6 +61,85 @@ size. The headline claim "the model beats random" is a directional
57
  indicator, not a statistical proof; per-keeper data (v4 candidate)
58
  would shrink the per-kick variance and make the comparison meaningful.
59
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  ## What it predicts
61
 
62
  For any kicker, the model returns P(L), P(C), P(R). The goalkeeper
@@ -122,10 +205,19 @@ feature_columns = artifact["feature_columns"]
122
  ## Repository layout
123
 
124
  - `model/lightgbm.pkl` β€” the frozen LightGBM (LGBMClassifier inside a
125
- `LightGBMClassifierWrapper`), trained on the v2 179-kick training set
126
- (the 18 formerly-skipped refs have URL rotation issues; see
127
- `## Further Notes`).
128
- - `model/metrics.json` β€” the held-out metrics report.
 
 
 
 
 
 
 
 
 
129
  - `data/shootout_kicks.jsonl` β€” 179 target kicks across 18 shootouts in 6
130
  national-team tournaments, 2021–2022 (the v2 42-shootout scope minus
131
  24 shootouts with URL rotation issues; see `## Further Notes`).
@@ -162,13 +254,31 @@ data layer.
162
  in the A3 feature. 1080 of 1247 v2 rows with `"Unknown"` get real
163
  declared-foot values from the cached `pageProps.data.playerInformation[]`
164
  payload. The v3 `predictions.jsonl` has 0 `"Unknown"` rows.
165
- - **Retrained on the v2 179-kick training set** (the 18 formerly-skipped
166
- refs have URL rotation issues; see `## Further Notes`). The holdout
167
- (28 WC 2026 kicks, 2026-01-01+) is unchanged from v2; `n_train` is
168
- still 151.
 
 
 
169
  - **Save rate is now the headline metric** in this card; the
170
  accuracy-led v2 card is replaced. The 28-row holdout caveat
171
  applies to both metrics at this sample size.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
172
 
173
  ## Further Notes
174
 
 
9
 
10
  # 12yd β€” Penalty Shootout Side Prediction
11
 
12
+ Multiclass classifier (L / C / R) on 18 per-kick features; trained on the 151 pre-2026 shootout kicks across 6 national-team tournaments (2021–2022). Frozen deployment artifact for `matheusccouto/12yd`.
13
 
14
  ## Save rate is the deployment KPI
15
 
 
40
 
41
  `random` and `last-side` baselines are deterministic and do not depend on
42
  the retrain; the v2 numbers are pinned. The `lightgbm` and `logreg` rows
43
+ reflect the v3 fit on the 151 pre-2026 training rows (Issue #40: the
44
+ artifact and the metrics describe the same model; the previous recipe
45
+ fit the artifact on all 179 rows including the 28-row holdout, so the
46
+ deployed save rate was 0.107 β€” in-sample memorisation β€” not the 0.464
47
+ this card advertises). The 18 formerly-skipped refs have URL rotation
48
+ issues and need a separate fix β€” see `## Further Notes`. The `actual
49
+ keeper` row is `null` because StatsBomb does not yet publish
50
+ per-keeper dive-direction data for the in-scope tournaments.
51
 
52
  ### Statistical caveat β€” 28-row holdout
53
 
 
61
  indicator, not a statistical proof; per-keeper data (v4 candidate)
62
  would shrink the per-kick variance and make the comparison meaningful.
63
 
64
+ ### Calibration β€” Brier and ECE
65
+
66
+ The model is **miscalibrated** as a probabilistic classifier. Two
67
+ metrics tell the story:
68
+
69
+ - **Brier score** (multiclass; 0 = perfect, 2 = worst for 3 classes):
70
+ the mean squared error of `P(L), P(C), P(R)` against a one-hot
71
+ encoding of the truth.
72
+ - **Expected Calibration Error (ECE)** (10 equal-width confidence
73
+ bins; 0 = perfect): `sum_bin (|bin| / N) * |acc(bin) - conf(bin)|`.
74
+
75
+ | model | Brier | ECE |
76
+ | ------------------ | ------ | ------ |
77
+ | lightgbm (this) | 0.986 | 0.436 |
78
+ | logreg baseline | 0.652 | 0.063 |
79
+ | random uniform | 0.667 | 0.060 |
80
+
81
+ The lightgbm is **worse** than random on Brier (0.99 vs 0.67) because
82
+ the inverse-frequency class weights push probabilities away from
83
+ where the truth is. The logreg is well-calibrated. The card's
84
+ "the model returns P(L), P(C), P(R) β€” the probability the kicker will
85
+ aim at the left side" claim is **false** on the v3 model: the model
86
+ is miscalibrated as a probabilistic classifier.
87
+
88
+ The deployment policy `argmin(P(L), P(C), P(R))` is **invariant**
89
+ under monotone transforms of the per-row probabilities. The
90
+ miscalibration does not affect the recommended dive: the model
91
+ still picks the lowest-probability side on every row, even when the
92
+ absolute probabilities are wrong. Save rate is what the policy
93
+ achieves; Brier and ECE are honest about the calibration gap, not a
94
+ criticism of the deployment. See
95
+ [`docs/model-review.md` Β§ Topic 3](../blob/main/docs/model-review.md)
96
+ for the analysis and Issue #43 for the metrics-report change.
97
+
98
+ ### Cross-validation β€” leave-one-tournament-out
99
+
100
+ The single 28-row holdout is honest about what 28 rows can tell us
101
+ (almost nothing β€” see the statistical caveat above). To get a
102
+ tighter claim, the metrics report also includes a
103
+ leave-one-tournament-out cross-validation (Issue #45) β€” 6 folds, one
104
+ per `tournament_name`, with the 179 rows split across the folds
105
+ as the table below shows.
106
+
107
+ | fold (held-out tournament) | n_train | n_holdout | save rate | random | log loss | accuracy |
108
+ | ------------------------------------- | ------: | --------: | --------: | -----: | -------: | -------: |
109
+ | Africa Cup of Nations Final Stage | 100 | 79 | 0.380 | 0.409 | 1.312 | 0.392 |
110
+ | EURO Final Stage | 145 | 34 | 0.294 | 0.353 | 1.285 | 0.471 |
111
+ | World Cup Final Stage | 154 | 25 | 0.360 | 0.413 | 1.465 | 0.320 |
112
+ | CONCACAF Gold Cup Final Stage | 155 | 24 | 0.458 | 0.417 | 1.188 | 0.417 |
113
+ | Copa America Final Stage | 170 | 9 | 0.333 | 0.407 | 1.842 | 0.333 |
114
+ | World Cup | 171 | 8 | 0.375 | 0.417 | 1.189 | 0.375 |
115
+ | **aggregate (n=179)** | | | **0.369** | | **1.333** | **0.397** |
116
+ | aggregate SE on save rate | | | Β±0.036 | | | |
117
+
118
+ The aggregate save rate is **0.369 (SE Β±0.036)** β€” 6Γ— tighter than
119
+ the single 28-row holdout (SE Β±0.094). The model is **below** the
120
+ closed-form random baseline (0.405 on the same 179 rows) by 0.036,
121
+ i.e. **just inside one aggregate SE**. The "the model beats random"
122
+ claim is not supported by the LOTO CV: across 179 holdout kicks
123
+ across 6 tournaments, the model's aggregate save rate is
124
+ statistically indistinguishable from the uniform-random baseline.
125
+ The 28-row holdout's "0.464 vs 0.405" was a one-tournament draw from
126
+ a distribution that averages to ~0.37.
127
+
128
+ The logreg baseline's LOTO CV (computed in the same script for
129
+ context) lands at **0.380 save rate** β€” also below random, also
130
+ within one SE. The published single-fold "logreg 0.250" number
131
+ (Issue #43) is the same kind of small-sample noise: the logreg
132
+ beats the lightgbm on the WC 2026 holdout (0.250 vs 0.464) but
133
+ loses to it on the cross-tournament aggregate (0.380 vs 0.369 are
134
+ within noise of each other).
135
+
136
+ The CV reveals what the single 28-row holdout could not: **the
137
+ 18-feature model is not adding measurable value over a uniform-
138
+ random dive policy on this dataset.** This is the same conclusion
139
+ as the model review (Topic 2 + Topic 4); the LOTO CV is the
140
+ independent confirmation. v4 work (per-keeper data, anti-classifier)
141
+ is the path to a model that meaningfully beats random.
142
+
143
  ## What it predicts
144
 
145
  For any kicker, the model returns P(L), P(C), P(R). The goalkeeper
 
205
  ## Repository layout
206
 
207
  - `model/lightgbm.pkl` β€” the frozen LightGBM (LGBMClassifier inside a
208
+ `LightGBMClassifierWrapper`), trained on the 151 pre-2026 training
209
+ fold (the same model the metrics describe; Issue #40 closed the
210
+ artifact-vs-metrics data leak).
211
+ - `model/metrics.json` β€” the held-out metrics report. Includes
212
+ log loss, accuracy, save rate, the calibration block (Brier
213
+ + ECE for the model, the logreg baseline, and the uniform random
214
+ baseline; Issue #43), and the LOTO cross-validation block
215
+ (per-fold save rate / log loss / accuracy + the aggregate
216
+ summary; Issue #45).
217
+ - `data/cv_metrics.json` β€” the standalone LOTO CV artifact (the
218
+ same payload that's embedded in `model/metrics.json` under the
219
+ `cv` key, written separately so the dashboard or a future tool
220
+ can load the CV without parsing the rest of the metrics report).
221
  - `data/shootout_kicks.jsonl` β€” 179 target kicks across 18 shootouts in 6
222
  national-team tournaments, 2021–2022 (the v2 42-shootout scope minus
223
  24 shootouts with URL rotation issues; see `## Further Notes`).
 
254
  in the A3 feature. 1080 of 1247 v2 rows with `"Unknown"` get real
255
  declared-foot values from the cached `pageProps.data.playerInformation[]`
256
  payload. The v3 `predictions.jsonl` has 0 `"Unknown"` rows.
257
+ - **Retrained on the 151 pre-2026 training rows** (the same model the
258
+ metrics describe; Issue #40 closed the artifact-vs-metrics data
259
+ leak β€” the v3 release shipped a 179-row artifact with a 0.107
260
+ in-sample save rate, not the 0.464 the card advertised). The
261
+ holdout (28 WC 2026 kicks, 2026-01-01+) is unchanged from v2;
262
+ `n_train` is 151. The 18 formerly-skipped refs have URL rotation
263
+ issues; see `## Further Notes`.
264
  - **Save rate is now the headline metric** in this card; the
265
  accuracy-led v2 card is replaced. The 28-row holdout caveat
266
  applies to both metrics at this sample size.
267
+ - **Calibration block added to `model/metrics.json`** (Issue #43):
268
+ Brier score and ECE (10-bin) for the model, the logreg baseline,
269
+ and the uniform random baseline. The card has a new "Calibration"
270
+ section that documents the miscalibration story in plain English.
271
+ - **LOTO cross-validation block added to `model/metrics.json`**
272
+ (Issue #45): 6 folds (one per `tournament_name` in the 179-row
273
+ training set) with per-fold save rate, log loss, accuracy, and
274
+ the aggregate summary (weighted-mean save rate + the binomial
275
+ SE on the aggregate). The card has a new "Cross-validation"
276
+ section. The CV reveals that the 18-feature model is not
277
+ statistically distinguishable from a uniform-random dive policy
278
+ on the cross-tournament aggregate (model 0.369 vs random 0.405,
279
+ one aggregate SE), and that the single 28-row holdout's "model
280
+ beats random" claim was a small-sample draw. v4 work is the
281
+ path to a model that meaningfully beats random.
282
 
283
  ## Further Notes
284