Every prediction row makes two claims. The first is about the future, and it gets graded. The second is about the past — that at 13:04 on some afternoon, with the market in the state it was actually in, this was the best answer the model could produce. The second claim is never checked, and nothing in the schema records it.
This post reconstructs that second claim for 52,747 production predictions and reports what the models were actually allowed to know. The short version: the median prediction was written against 45% of the price history that eventually existed for its match, 2.7% were written with no price at all, and the accuracy table is flat across every stratum — which is the interesting part.
The schema records when, not what
ai_predictions carries created_at, match_id, model_id, prediction_direction, confidence, fair_home/draw/away and a full_analysis blob. The price history lives in nami_europe_odds — match_id, company_id, changed_at, three prices — currently 17,440,270 rows. There is no column tying a prediction to the revision it consumed: no as-of id, no resolvable snapshot pointer. So the information set has to be reconstructed by time, which is exactly the kind of join that is correct once and silently wrong forever after.
Reconstructing the information set
For a prediction p, the information set is every price revision of the same match whose changed_at is at or before p.created_at. The n_total denominator matters: it is what a fully informed run would have seen.
-- point-in-time information set for every prediction, one pass per match create temp table pit as select p.id, p.match_id, p.created_at, p.settled, p.hit, m.match_time, coalesce(x.n_before, 0) as n_before, coalesce(x.n_total, 0) as n_total, x.last_change from ai_predictions p left join nami_matches m on m.id = p.match_id left join lateral ( select count(*) filter (where o.changed_at <= p.created_at) as n_before, count(*) as n_total, max(o.changed_at) filter (where o.changed_at <= p.created_at) as last_change from nami_europe_odds o where o.match_id = p.match_id ) x on true where p.created_at is not null; The lateral is deliberate: it turns 52,747 outer rows into 52,747 index range scans on (match_id, changed_at) instead of a 17-million-row hash join. Warm cache, the whole thing finishes in 31 seconds. Cold, about three minutes — long enough that you should run it as a job, not inside a request.
What the models actually saw
The counts are not small. The 25th percentile prediction already had 104 revisions on record, the median 319, the 75th 687, the 95th 2,627. Data volume was never the problem.
The ratio is the problem. Defining coverage as n_before / n_total over the 52,179 predictions whose match had any price at all:
| quantile | coverage |
|---|---|
| p10 | 0.129 |
| p50 | 0.453 |
| p90 | 0.897 |
| mean | 0.482 |
29,372 predictions — 56.3% — were written with less than half of the eventual price history on record. Only 5,067 (9.7%) had 90% or more, and 2,753 (5.3%) had literally all of it. That last group is not a victory; it means the prediction was written after the market had stopped moving, i.e. close to kickoff.
The freshest available quote was reasonably fresh: median age 12.1 minutes at write time, p90 167 minutes. But 2,039 rows (3.87%) used a quote older than six hours, which for a market that repriced 319 times is a very old view of the world.
The 2.7% that saw nothing
1,425 predictions (2.70%) were written when n_before = 0. Of those, 568 point at a match with no price row at all, spread over 220 fixtures. 63 of the 568 carry a match_id that has no row in nami_matches — no kickoff time, so no way to even ask whether the write preceded the match. 359 of 4,065 models produced at least one blind prediction.
The distribution by month is the tell:
| month | blind rows |
|---|---|
| 2026-09 | 362 |
| 2026-10 | 16 |
| 2026-11 | 160 |
| 2026-12 | 30 |
September's 362 blind writes were not a data outage; the price table was fully populated for that period. They were a scheduling artefact — a batch that ran before the price feed had populated the fixture.
And 815 of the 1,425 blind rows are not the first prediction on their match. Another model had already predicted that fixture. The second model was writing blind into a match that already had a claim on it.
One match, 358 different information sets
18,472 matches carry 52,747 predictions, median 1 per match, maximum 358. Among the 6,404 matches with more than one prediction, the first write averaged 0.315 coverage and the later writes averaged 0.537. Same fixture, same outcome, same leaderboard — two different information sets, pooled into one number.
This is the quiet version of the reproducibility problem. Two runs on the same match cannot agree if they were not given the same inputs, and the table cannot tell you whether they were.
The result that argues against the audit's own premise
If more price history meant better predictions, accuracy would climb with coverage. It does not:
| coverage | n | settled | hits | rate |
|---|---|---|---|---|
| no price | 568 | 473 | 249 | 52.6% |
| 0–10% | 4,148 | 4,041 | 2,294 | 56.8% |
| 10–25% | 7,211 | 7,145 | 4,026 | 56.3% |
| 25–50% | 18,013 | 17,929 | 10,098 | 56.3% |
| 50–75% | 12,493 | 12,430 | 6,920 | 55.7% |
| 75–90% | 5,247 | 5,213 | 2,933 | 56.3% |
| 90–99% | 2,314 | 2,303 | 1,217 | 52.8% |
| 100% | 2,753 | 2,735 | 1,692 | 61.9% |
Staleness behaves the same way. Rows using a quote under a minute old settle at 56.3%; rows using a quote more than a day old settle at 49.9% on 515 rows, and rows using a 6–24 hour old quote settle at 57.1%. There is no gradient to find.
I could have buried this and written a triumphant "more data helps" post. The honest reading is narrower and more useful: information volume was not the binding constraint on this system. Feeding it the other 55% of the price history would not have moved accuracy, because the model was not starved of prices — it was starved of something the price feed does not contain.
Which means the value of the receipt is not accuracy uplift. It is being able to state, per row, what the run was permitted to know.
Where the audit does earn its keep: December
The monthly aggregates show a real change that the hit-rate table cannot express:
| month | preds | blind | mean coverage | mean revisions |
|---|---|---|---|---|
| 2026-06 | 2,735 | 0 | 0.851 | 2,980 |
| 2026-07 | 2,637 | 1 | 0.804 | 2,073 |
| 2026-08 | 164 | 0 | 0.481 | 732 |
| 2026-09 | 9,757 | 680 | 0.451 | 486 |
| 2026-10 | 21,886 | 59 | 0.459 | 386 |
| 2026-11 | 14,541 | 505 | 0.425 | 331 |
| 2026-12 | 1,027 | 180 | 0.242 | 52 |
December dropped to 52 mean revisions, 24.2% coverage and 17.5% blind writes, while the median lead time to kickoff rose from ~1,080 minutes to 2,082. That is not a model regression; that is the scheduler moving 34 hours out, into a window where the feed had barely opened. You can only see that if you measure the information set.
Fixing it: write the receipt, then fail closed
A timestamp tells you when a row was written. It does not tell you what the row was written against. Add the missing three columns:
alter table ai_predictions add column if not exists price_as_of timestamptz, add column if not exists price_rows_seen integer, add column if not exists price_coverage numeric(5,4); -- backfill from the pit table built above; coverage stays NULL where no price existed update ai_predictions p set price_as_of = x.last_change, price_rows_seen = x.n_before, price_coverage = round(x.n_before::numeric / nullif(x.n_total, 0), 4) from pit x where x.id = p.id; Then compute it at write time, before the row exists, and treat zero as an alarm rather than a default:
def price_receipt(cur, match_id, as_of): """What the price feed had on record at the instant of inference.""" cur.execute( "select count(*) filter (where changed_at <= %(t)s), count(*), max(changed_at)" " from nami_europe_odds where match_id = %(m)s", {"t": as_of, "m": match_id}, ) n_before, n_total, last = cur.fetchone() coverage = round(n_before / n_total, 4) if n_total else None if n_before == 0: raise RuntimeError(f"blind write: match {match_id} has no price at {as_of}") return {"price_as_of": last, "price_rows_seen": n_before, "price_coverage": coverage} The raise is the point. 1,425 rows exist today because writing blind was cheaper than not writing. A guard converts a silent default into a queued failure you can look at — and if you genuinely want a blind prediction, it should be an explicit, logged decision, not the absence of one.
What this buys
Three things, none of them accuracy:
- Replay becomes possible. Same match, same
price_as_of, same inputs. A reproducibility check that compares two runs is meaningless if one run saw 104 revisions and the other saw 687. - "We improved" becomes testable. Compare models within a coverage stratum instead of across strata. The flat table above is the argument: without stratification, any difference you observe could be a difference in what the runs were fed.
- Blind writes become visible. 220 fixtures were predicted with no price at all. That number should be zero and should page someone when it is not.
The audit is one query and one lateral join. The discipline is the column — the part that costs a migration, a backfill and a guard, and the only part that makes the next audit cheap.
Analytics and research content. Not betting advice. 18+
本内容仅供数据分析与研究参考,不构成任何决策建议。
