SoccerDream AI 首页  ›  GEO 内容中心  ›  近期更新(自动生成)

One row, four directions: the label-provenance problem in 50,200 predictions

Two months ago I opened a row and read this sentence twice.

本页内容由人工智能生成,仅供参考

Two months ago I opened a row and read this sentence twice.

The stored direction column said home/draw. The summary column said the home side would not lose. Eight hundred characters deeper, inside the serialized analysis, the reasoning string said the away side would not lose. Same fixture, same model, same row, same second. One of those sentences was written by a copy step, and nobody marked which.

That is the whole problem in one example: a prediction is not one claim, it is a claim plus every copy of itself, and the copies drift.

Production context: ai_predictions, 50,200 rows, 2026-06-21 to 2026-11-27, 4,020 distinct models, 49,686 settled, 28,352 correct (57.06%).

SELECT count(*)                          AS rows,
       count(*) FILTER (WHERE settled)   AS settled,
       count(*) FILTER (WHERE hit)       AS correct,
       round(100.0*count(*) FILTER (WHERE hit)/nullif(count(*) FILTER (WHERE settled),0),2) AS pct,
       count(DISTINCT model_id)          AS models
FROM   ai_predictions;
 rows  | settled | correct | pct  | models
-------+---------+---------+------+--------
 50200 |   49686 |   28352 | 57.06|   4020

Where a direction can live

prediction_direction is a varchar(100) with exactly six values in production: home 20,619, away/draw 11,625, away 11,189, home/draw 6,413, draw 347, none 7. Clean alphabet, one column, easy to GROUP BY.

The analysis blob does not respect that. It is text, and it holds a JSON document on 46,935 rows, a bracketed prose block on 48, plain prose on 3,112, an unparseable fragment on 8, and nothing at all on 105. Inside the JSON, the label has four possible homes:

SELECT key, count(*) FROM (
  SELECT jsonb_object_keys(full_analysis::jsonb) AS key
  FROM   ai_predictions
  WHERE  left(btrim(full_analysis),1) = '{'
    AND  full_analysis ~ '^\s*\{.*\}\s*$'
) k GROUP BY 1 ORDER BY 2 DESC LIMIT 6;
 key             | count
-----------------+-------
 asian_handicap  | 45928
 goal_line       | 43599
 confidence      | 25682
 direction       | 25664
 prediction      | 22044
 _dir_source     |  6482

direction appears 25,664 times at top level. prediction — itself an object — appears 22,044 times, and on 21,237 of those rows it carries its own direction. _dir_source appears 6,482 times and records three candidate readings plus which one was used. _dir_text_sync appears 3,338 times and records a rewrite. Four places, one claim.

Normalize before you count, or you will overcount by 5 points

The naive comparison is a string equality between the column and full_analysis->>'direction'. On 25,664 rows that reports 7,567 mismatches — 29.48%. Most of that 5-point gap is spelling, not disagreement: some models wrote 胜/负/平 instead of home/away/draw, and some wrote draw/home where the column says home/draw.

ZH = {"胜":"home","主胜":"home","负":"away","客胜":"away","平":"draw","平局":"draw"}

def norm(v):
    if v is None: return None
    v = str(v).strip()
    if v in ZH: return ZH[v]
    if v in ("none",""): return ""
    s = {x for x in v.split("/") if x in ("home","draw","away")}
    return "/".join(sorted(s)) if s else None   # order-independent pair

After that normalizer the same comparison gives 25,208 paired rows and 6,183 mismatches — 24.53%. Five percentage points of the naive number were a vocabulary problem. This is the cheapest lesson in the whole audit: before you measure disagreement, define the alphabet, or you will spend a week chasing models that only had a different accent.

The disagreements are persistent, not a bad month

SELECT to_char(created_at,'YYYY-MM') AS m,
       count(*) FILTER (WHERE left(btrim(full_analysis),1)='{') AS json_rows
FROM ai_predictions GROUP BY 1 ORDER BY 1;
 month   | rows  | paired | disagree | rate
---------+-------+--------+----------+------
 2026-06 |  2735 |   1861 |      933 | 50.1%
 2026-07 |  2637 |      8 |        1 | 12.5%
 2026-08 |   164 |      1 |        0 |  0.0%
 2026-09 |  9757 |   1937 |      652 | 33.7%
 2026-10 | 21886 |  13672 |     3286 | 24.0%
 2026-11 | 13021 |   7729 |     1311 | 17.0%

Two things stand out. First, the rate improves but never reaches zero: 17% of November rows still carry two different answers. Second, look at the paired column: in July only 8 of 2,637 rows have a top-level direction at all. The label moved house that month — it lived inside prediction.direction instead — and moved back in September. A pipeline that reads one location would have reported "no narrative label" for 2,629 rows and silently dropped them from the audit.

When both labels exist, they disagree 94% of the time

There are 762 rows where the blob carries a top-level direction and a nested prediction.direction. On 709 of them the two values differ — 93.0%. Of the 754 that are settled, here is the accuracy each reading would earn:

 reading                  | n   | correct | rate
--------------------------+-----+---------+-------
 prediction_direction     | 754 |     377 | 50.0%
 top-level direction      | 754 |     334 | 44.3%
 prediction.direction     | 754 |     393 | 52.1%

Three numbers from one row. None of them is a lie; each is a faithful reading of a different field. That is exactly why "the model is 52% accurate" is not a statement about the model until you name the field.

Only one of them is graded

The settled flag and the hit flag are written by the settlement job, not by the narrative. Recomputing the outcome from prediction_direction plus direction_arity — exact match for single, either side for double — reproduces the stored hit on 48,911 of 49,453 rows (98.90%).

SELECT count(*) AS n,
       count(*) FILTER (
         WHERE  (actual_result = ANY (string_to_array(prediction_direction,'/'))) = hit
       ) AS matches
FROM ai_predictions
WHERE settled AND actual_result IS NOT NULL AND hit IS NOT NULL
  AND prediction_direction IN ('home','away','draw','home/draw','away/draw');

So the column is the graded object, and the narrative is decoration from the grader's point of view. Which is fine — until someone quotes the narrative. On the 6,153 settled rows where the two readings differ, accuracy under the column is 52.46% and under the narrative reading 48.09%. Same rows, 4.4 points apart. If your public number is built from a text scrape instead of the column, you are publishing a different product.

The rewrite ledger covers 7% of the disagreements

The _dir_text_sync object is the honest part of this system. All 3,338 instances carry a note tagged as a platform rewrite, with from and to. It first appears in September (2 rows), then 1,521 in October and 1,815 in November.

What the rewrite did to the label's cardinality explains most of the movement:

 kind   | rows | acc of "from" | acc of "to"
--------+------+---------------+-------------
 widen  |  394 |        32.74% |      55.33%
 narrow | 2454 |        74.53% |      50.29%
 shift  |  397 |        70.03% |      54.66%

Those gaps are arithmetic, not skill. Widening a single pick to a pair adds an outcome that occurs roughly a quarter of the time, so accuracy jumps ~23 points for free; narrowing a pair to a single removes the same quarter, so accuracy falls ~24 points. A 23-point swing in a published metric is available to anyone who can edit which of two strings is called "the direction".

And the ledger does not fully reconcile either. Of the 3,320 rewrites with both fields readable, the from value differs from the stored column on 2,934 rows (88.4%) — expected. But the to value also differs from the stored column on 766 rows (23.1%), and 115 rewrites move the pick to the opposite side of the fixture entirely. That means at least two rewrite steps happened and only the last was persisted.

Here is the part that should worry you: of the 6,183 disagreements, only 435 have a ledger entry. The other 5,748 — 92.9% — are silent. A reader cannot tell whether those rows were rewritten, whether the column was written from a different source, or whether the narrative was generated before the column was corrected.

The fix is a write-time invariant, not a cleanup script

You cannot repair this after the fact; the information needed to decide which copy was right is not in the row. What you can do is make the next write refuse to create a second truth.

-- one direction per row, stored once, referenced everywhere else
ALTER TABLE ai_predictions
  ADD CONSTRAINT direction_alphabet
  CHECK (prediction_direction IN ('home','draw','away','home/draw','away/draw','none'));

-- every rewrite becomes an append-only row, never an edit in place
CREATE TABLE direction_rewrite_ledger (
  prediction_id bigint NOT NULL REFERENCES ai_predictions(id),
  seq           int    NOT NULL,
  from_label    text   NOT NULL,
  to_label      text   NOT NULL,
  rule_id       text   NOT NULL,
  decided_at    timestamptz NOT NULL DEFAULT now(),
  PRIMARY KEY (prediction_id, seq)
);

Two cheap guards close most of the gap. The first is an assertion at write time: if the analysis text contains a label, it must equal the column, or the insert fails and the row goes to a review queue instead of production. The second is a daily count of rows where a label exists and disagrees without a ledger entry — the number above, 5,748, is the backlog that guard would have surfaced on day one instead of month five.

-- the one query I would put on a dashboard
SELECT count(*) FILTER (WHERE has_label)          AS labeled,
       count(*) FILTER (WHERE has_label AND NOT has_ledger) AS silent
FROM (
  SELECT (full_analysis::jsonb ? 'direction') AS has_label,
         (full_analysis::jsonb ? '_dir_text_sync') AS has_ledger
  FROM ai_predictions
  WHERE settled AND left(btrim(full_analysis),1) = '{'
) t;

What this changes about "accuracy"

I used to think a prediction row was a claim and a result. It is a claim, three to five copies of the claim, a ledger of who edited which copy, and a graded column that follows only one of them. When the copies agree, 75% of the time, none of this matters. When they disagree — one row in four — the number you publish depends on which copy you happened to read, and the difference between the readings is larger than most of the model improvements I have measured this year.

The discipline is boring and it is the only one that works: name the field in every accuracy claim, grade exactly one of them, and make every rewrite leave a row behind. If a rewrite cannot leave a row, it should not be allowed to happen.

Analytics and research content. Not betting advice. 18+

本内容仅供数据分析与操作参考,不构成任何决策建议。

风险提示:足球比赛结果具有内在不确定性,任何数据分析工具都无法消除这种随机性。本页内容仅供数据操作与参考,不构成任何决策建议或收益承诺。请理性看待体育赛事,远离任何形式的非法决策活动。
看完方法论,直接看它怎么用在今天的比赛上

SoccerDream AI 每场给出胜平负概率分布、总进球区间与置信度, 赛后自动复盘、命中记录公开可查。注册后可查看全部 AI 模型推演与已结算战绩。

无需付费即可查看每日推演 · 全部内容为数据分析操作对象
合规切割声明:本平台为体育赛事数据分析与操作工具,不涉及任何彩票销售、代购或资金交易,不涉及任何资金交易行为,亦不涉及任何资金收付,为独立的第三方数据分析服务。全部内容仅供操作与参考。请遵守所在地法律法规,理性对待。
AI 生成内容标识:本页的分析结论与文字内容由 SoccerDream AI 大语言模型自动生成,依据《人工智能生成合成内容标识办法》予以标注;赛事数据、赛果与市场数值来自公开数据源,并经系统规则校验。内容仅供操作参考,不构成任何建议。