{"benchmark":"football-pilot/epl-three-outcome-calibration-v1","datasetVerification":{"actualSchema":"Each top-level JSON object had name and matches. Every used match had round, date, time, team1, team2, score.ft; ft was a two-element non-negative-integer array.","completeness":"380/380 records in each of the four consecutive season files met the required schema; no records were excluded.","duplicateCheck":"Within each season, duplicate key=(date,time,team1,team2) count was zero: {\"2021-22\": 0, \"2022-23\": 0, \"2023-24\": 0, \"2024-25\": 0}.","outcomeConvention":"H if home full-time goals > away; D if equal; A otherwise. Only score.ft was used."},"datasets":[{"datasetName":"English Premier League 2021/22","dateRange":["2021-08-13","2022-05-22"],"matches":380,"season":"2021-22","sha256":"fbdfd426fa18fa2f8630b77de87c082734da495ac4668d6d72f29f76b73b9564","url":"https://raw.githubusercontent.com/openfootball/football.json/master/2021-22/en.1.json"},{"datasetName":"English Premier League 2022/23","dateRange":["2022-08-05","2023-05-28"],"matches":380,"season":"2022-23","sha256":"8d09f0f9846981626cdfec48903e1f21e7c79aabe6f92535c9e092e8e79b808b","url":"https://raw.githubusercontent.com/openfootball/football.json/master/2022-23/en.1.json"},{"datasetName":"English Premier League 2023/24","dateRange":["2023-08-11","2024-05-19"],"matches":380,"season":"2023-24","sha256":"03e13eafbf78dfe00d7e89dd3bf6643986eb6e8fd86c7664aeb8c5bc0bed88d0","url":"https://raw.githubusercontent.com/openfootball/football.json/master/2023-24/en.1.json"},{"datasetName":"English Premier League 2024/25","dateRange":["2024-08-16","2025-05-25"],"matches":380,"season":"2024-25","sha256":"c3d18f552d83382cd4b6b21127adbbfe38e7f8618ddc979fb5404f2df07d0a75","url":"https://raw.githubusercontent.com/openfootball/football.json/master/2024-25/en.1.json"}],"execution":{"dataRetrieval":"All four specified raw season files fetched successfully and passed the SHA-256 checks below.","failures":[],"runtime":"CPython 3.12.3; Python standard library only","status":"completed"},"leakageAudit":{"baselineIsolation":"Frequency probabilities derive exclusively from training counts.","chronology":"Predictions are generated before updates; equal listed kickoff times are grouped to prohibit their mutual leakage.","dataFields":"Only pre-match identity/date/time plus past full-time outcomes drive features. score.ft supplies labels and post-match rating updates.","manualReview":"Schema, full-time-score presence, season counts, SHA-256, and duplicate keys were checked by the included script.","seasonIsolation":"The 2024-25 file was not used in model-parameter, grid, or temperature selection. It is read only for final sequential predictions and scoring."},"limitations":["Kickoff time is a source-supplied HH:MM string with no timezone/offset or seconds. The ordering is therefore source-local and simultaneous groups may include games whose actual start times differ; no finer timing claim is made.","This is four historical EPL seasons only, with 380 test matches. Team observations are correlated; bootstrap intervals are descriptive and not independent-match confidence guarantees.","No injuries, lineups, weather, tactics, quality-of-opposition covariates, timestamped odds, prices, stakes, or returns were supplied or used. Therefore this reports no betting profitability, edge, ROI, or wagering recommendation.","The raw master URLs are mutable. Reproduction is pinned by the recorded SHA-256; stop if a re-fetch differs rather than silently using altered data.","Source licence statements are publisher assertions, not legal advice. Competition naming and underlying-source rights may require separate review.","A simple outcomes-only rating model does not establish calibration or performance for football generally, much less the other five sports."],"methodAndParameters":{"calibration":{"fit":"T grid 0.50,0.51,...,3.00; select minimum calibration-season clipped log loss, lower T on a tie.","freeze":"T=0.96 was selected using only 2023-24 predictions/outcomes and then frozen before the 2024-25 evaluation.","method":"Single multiclass temperature T: q_i=p_i^(1/T)/sum_j p_j^(1/T).","selectedT":0.96},"featureTiming":"The only predictive features are team ratings and fixed selected parameters. Ratings begin at 1500 and update only after prior observed full-time results. No future score, same-kickoff result, injury, news, odds, or post-match statistic is used.","frequencyBaseline":{"countsHDA":[347,175,238],"fit":"Counts from the 760 training matches only; never refit on calibration or test.","probabilitiesHDA":[0.45657894736842103,0.23026315789473684,0.3131578947368421]},"modelsCompared":["training-only outcome-frequency baseline","uncalibrated Davidson-style three-outcome Elo","temperature-calibrated Elo"],"ratingModel":{"grid":"K in {10,20,30,40,50}; H in {0,25,50,75,100}; D in {0.50,0.75,1.00,1.25,1.50}; 125 candidates.","initialRating":"1500 for an unseen team","probabilityFormula":"a=10^((R_home+H-R_away)/400); P(H)=a/(a+1+D*sqrt(a)); P(D)=D*sqrt(a)/(a+1+D*sqrt(a)); P(A)=1/(a+1+D*sqrt(a)).","selected":{"D":0.75,"H":75.0,"K":50.0,"trainingWalkForwardClippedLogLoss":0.9814514596464402},"selection":"Minimum chronological walk-forward training clipped log loss on all 760 training matches; ties lexicographically by (K,H,D).","stateHandling":"Selected ratings are carried forward through observed, prior calibration results to form test pre-match features. No test outcome affects its own or any earlier test prediction.","update":"After each simultaneous-kickoff group, S=1,0.5,0 for H,D,A; E=P(H)+0.5P(D); R_home+=K*(S-E), R_away-=K*(S-E)."}},"metrics":{"calibrationSeason":{"temperatureCalibrated":{"clippedLogLoss":0.942768003317732,"multiclassBrier":0.5565123568507828,"n":380},"uncalibrated":{"clippedLogLoss":0.9430059491856116,"multiclassBrier":0.5567341063972313,"n":380}},"definitions":{"clippedLogLoss":"-(1/N) sum_m log(max(1e-15,p_m,true)); clipping is solely to make the convention finite.","multiclassBrier":"(1/N) sum_m sum_i (p_mi-y_mi)^2 for i in {H,D,A}, with one-hot y.","uncertainty":"For each test model, 10,000 seeded (20250225) non-parametric resamples of 380 match/prediction rows, fixed predictions, and linear-interpolated empirical 2.5%/97.5% percentiles. These are descriptive only: resampling individual matches does not remove within-season/team dependence and is not a betting-profitability inference."},"honestComparison":"Against the training-only frequency baseline, both Elo variants have lower held-out Brier and log loss. On the untouched test, temperature calibration is worse than uncalibrated Elo: Brier 0.589473 vs 0.588117 and log loss 0.986711 vs 0.984471. No calibrated-improvement claim is made.","units":"Brier is squared-probability units per match (lower is better); log loss is natural-log nats per match (lower is better).","untouchedTest":{"temperatureCalibratedElo":{"bootstrap95":{"clippedLogLoss95":[0.9294000403412936,1.0445353214006812],"method":"match-resampling percentile bootstrap; fixed predictions; descriptive only","multiclassBrier95":[0.550120697798394,0.6295674571419477],"reps":10000,"seed":20250225},"point":{"clippedLogLoss":0.9867105033733159,"multiclassBrier":0.5894733698609452,"n":380}},"trainingOnlyFrequency":{"bootstrap95":{"clippedLogLoss95":[1.055037190517721,1.109629693890784],"method":"match-resampling percentile bootstrap; fixed predictions; descriptive only","multiclassBrier95":[0.6381878462603877,0.6751636080332409],"reps":10000,"seed":20250225},"point":{"clippedLogLoss":1.08250220856647,"multiclassBrier":0.6568109418282548,"n":380}},"uncalibratedElo":{"bootstrap95":{"clippedLogLoss95":[0.9293113316952888,1.0399848679490664],"method":"match-resampling percentile bootstrap; fixed predictions; descriptive only","multiclassBrier95":[0.5501129284767453,0.6266933605203441],"reps":10000,"seed":20250225},"point":{"clippedLogLoss":0.9844707719274888,"multiclassBrier":0.5881172376112791,"n":380}}}},"releaseGatesForOtherFiveSports":{"NBA":"Use a reusable game-results source; define overtime convention, prevent same-day/future leakage, and independently reproduce held-out probabilities and reliability before release.","NFL":"Use a reusable game-results source; define ties and postseason inclusion before splits, isolate final-season test data, and audit injury/lineup timestamp availability before any feature use.","NHL":"Use a documented reusable results source; define regulation/overtime/shootout outcome convention before fitting, timestamp games, and repeat untouched-season calibration and checks.","Tennis":"Use reusable match results; define retirement/walkover exclusions and surface/tournament timing before fitting, use chronologically untouched testing, and publish sport-specific reliability/uncertainty results before release.","UFC/MMA":"Use only legally reusable bout results; freeze a chronology with completed-bout labels, handle no-contest/draw rules explicitly, and reproduce this train/calibration/test, leakage, reliability, and uncertainty audit before release.","shared":"For each sport: immutable hashed inputs; complete-schema and duplicate checks; pre-event-only features; tuning on training only; calibration on a separate period only; frozen final test; training-frequency comparator; no profitability claim without timestamped odds; independent rerun approval. No football result is copied to any other sport."},"reliabilityBins":{"convention":"Test only. Confidence=max_i p_i; predicted class is first maximum in H,D,A order. Fixed bins [0.0,0.2), [0.2,0.4), [0.4,0.6), [0.6,0.8), [0.8,1.0]. empiricalAccuracy=correct/n; gap=meanConfidence-empiricalAccuracy; null means empty bin.","temperatureCalibratedElo":[{"empiricalAccuracy":null,"gap":null,"meanConfidence":null,"n":0,"range":"[0.0,0.2)"},{"empiricalAccuracy":0.36363636363636365,"gap":0.018711607223505178,"meanConfidence":0.3823479708598688,"n":33,"range":"[0.2,0.4)"},{"empiricalAccuracy":0.4897959183673469,"gap":0.006999969030126174,"meanConfidence":0.4967958873974731,"n":196,"range":"[0.4,0.6)"},{"empiricalAccuracy":0.5785123966942148,"gap":0.11206766760040776,"meanConfidence":0.6905800642946226,"n":121,"range":"[0.6,0.8)"},{"empiricalAccuracy":0.8,"gap":0.04697021660695744,"meanConfidence":0.8469702166069575,"n":30,"range":"[0.8,1.0]"}],"uncalibratedElo":[{"empiricalAccuracy":null,"gap":null,"meanConfidence":null,"n":0,"range":"[0.0,0.2)"},{"empiricalAccuracy":0.3684210526315789,"gap":0.014378109986442844,"meanConfidence":0.38279916261802177,"n":38,"range":"[0.2,0.4)"},{"empiricalAccuracy":0.495,"gap":0.00209388238657382,"meanConfidence":0.4970938823865738,"n":200,"range":"[0.4,0.6)"},{"empiricalAccuracy":0.5726495726495726,"gap":0.11720878562296544,"meanConfidence":0.689858358272538,"n":117,"range":"[0.6,0.8)"},{"empiricalAccuracy":0.88,"gap":-0.036831063362754435,"meanConfidence":0.8431689366372456,"n":25,"range":"[0.8,1.0]"}]},"reproduction":{"commands":["mkdir epl-calibration && cd epl-calibration","curl -fsS https://raw.githubusercontent.com/openfootball/football.json/master/2021-22/en.1.json -o 2021-22-en.1.json","curl -fsS https://raw.githubusercontent.com/openfootball/football.json/master/2022-23/en.1.json -o 2022-23-en.1.json","curl -fsS https://raw.githubusercontent.com/openfootball/football.json/master/2023-24/en.1.json -o 2023-24-en.1.json","curl -fsS https://raw.githubusercontent.com/openfootball/football.json/master/2024-25/en.1.json -o 2024-25-en.1.json","Save reproductionScriptPython below as benchmark.py; python3 benchmark.py"],"dependencies":"Python 3.12.3 executed; standard library only (hashlib, itertools, json, math, pathlib, random). No package installation.","expectedOutput":"The script prints all recorded point metrics, duplicate counts, hashes, calibration metrics, reliability bins, and deterministic bootstrap intervals. It asserts the four hashes before evaluation.","reproductionScriptPython":"#!/usr/bin/env python3\n\"\"\"Standard-library-only EPL calibration benchmark (deterministic).\"\"\"\nimport hashlib, itertools, json, math, pathlib, random\n\nROOT = pathlib.Path(__file__).resolve().parent\nSEASONS = (\"2021-22\", \"2022-23\", \"2023-24\", \"2024-25\")\nOUTCOMES = (\"H\", \"D\", \"A\")\nEPSILON = 1e-15\nEXPECTED_SHA256 = {\n \"2021-22\":\"fbdfd426fa18fa2f8630b77de87c082734da495ac4668d6d72f29f76b73b9564\",\n \"2022-23\":\"8d09f0f9846981626cdfec48903e1f21e7c79aabe6f92535c9e092e8e79b808b\",\n \"2023-24\":\"03e13eafbf78dfe00d7e89dd3bf6643986eb6e8fd86c7664aeb8c5bc0bed88d0\",\n \"2024-25\":\"c3d18f552d83382cd4b6b21127adbbfe38e7f8618ddc979fb5404f2df07d0a75\"}\n\ndef load(season):\n    path = ROOT / (season + \"-en.1.json\")\n    raw = path.read_bytes()\n    assert hashlib.sha256(raw).hexdigest() == EXPECTED_SHA256[season]\n    doc = json.loads(raw)\n    games = []\n    for m in doc[\"matches\"]:\n        assert set((\"round\", \"date\", \"time\", \"team1\", \"team2\", \"score\")) <= set(m)\n        ft = m[\"score\"][\"ft\"]\n        assert len(ft) == 2 and all(isinstance(x, int) and x >= 0 for x in ft)\n        outcome = \"H\" if ft[0] > ft[1] else \"A\" if ft[0] < ft[1] else \"D\"\n        games.append({\"season\": season, \"date\":m[\"date\"], \"time\":m[\"time\"], \"home\":m[\"team1\"], \"away\":m[\"team2\"], \"outcome\":outcome})\n    games.sort(key=lambda x:(x[\"date\"],x[\"time\"],x[\"home\"],x[\"away\"]))\n    return games, hashlib.sha256(raw).hexdigest(), doc[\"name\"]\n\nALL = {}\nfor s in SEASONS:\n    ALL[s], _, _ = load(s)\n\ndef probs(rh, ra, home_advantage, draw_factor):\n    # Davidson-style three-way extension of Elo; numerically stable enough for these ratings.\n    a = 10 ** ((rh + home_advantage - ra) / 400.0)\n    root = math.sqrt(a)\n    denom = a + 1.0 + draw_factor * root\n    return (a / denom, draw_factor * root / denom, 1.0 / denom)\n\ndef score_index(outcome): return OUTCOMES.index(outcome)\n\ndef grouped(games):\n    for _, g in itertools.groupby(games, key=lambda x:(x[\"date\"], x[\"time\"])):\n        yield list(g)\n\ndef walk(games, params, ratings=None, collect=True):\n    k, h, d = params\n    ratings = {} if ratings is None else ratings.copy()\n    rows = []\n    for batch in grouped(games):\n        predicted = []\n        for m in batch:\n            ph = probs(ratings.get(m[\"home\"], 1500.0), ratings.get(m[\"away\"], 1500.0), h, d)\n            predicted.append((m, ph))\n            if collect: rows.append((m[\"outcome\"], ph))\n        for m, ph in predicted:  # all same kickoff use pre-kickoff ratings\n            actual = 1.0 if m[\"outcome\"] == \"H\" else 0.5 if m[\"outcome\"] == \"D\" else 0.0\n            expected = ph[0] + 0.5 * ph[1]\n            delta = k * (actual - expected)\n            ratings[m[\"home\"]] = ratings.get(m[\"home\"], 1500.0) + delta\n            ratings[m[\"away\"]] = ratings.get(m[\"away\"], 1500.0) - delta\n    return ratings, rows\n\ndef clipped_logloss(rows):\n    return -sum(math.log(max(EPSILON, p[score_index(y)])) for y,p in rows) / len(rows)\n\ndef brier(rows):\n    return sum(sum((p[j] - (1.0 if score_index(y)==j else 0.0))**2 for j in range(3)) for y,p in rows) / len(rows)\n\ndef temperature(p, t):\n    q = [max(EPSILON, x) ** (1.0/t) for x in p]\n    z = sum(q)\n    return tuple(x/z for x in q)\n\ndef metrics(rows):\n    return {\"n\":len(rows), \"multiclassBrier\":brier(rows), \"clippedLogLoss\":clipped_logloss(rows)}\n\ndef percentile(xs, q):\n    xs = sorted(xs); pos = (len(xs)-1)*q; lo = int(pos); hi = min(lo+1,len(xs)-1)\n    return xs[lo] + (xs[hi]-xs[lo])*(pos-lo)\n\ndef bootstrap(rows, reps=10000, seed=20250225):\n    rng=random.Random(seed); n=len(rows); bs=[]; ls=[]\n    for _ in range(reps):\n        sample=[rows[rng.randrange(n)] for _ in range(n)]\n        bs.append(brier(sample)); ls.append(clipped_logloss(sample))\n    return {\"method\":\"match-resampling percentile bootstrap; fixed predictions; descriptive only\", \"reps\":reps, \"seed\":seed,\n            \"multiclassBrier95\": [percentile(bs,.025),percentile(bs,.975)], \"clippedLogLoss95\": [percentile(ls,.025),percentile(ls,.975)]}\n\ndef bins(rows):\n    # confidence is max predicted class probability; five fixed half-open bins, last includes 1.\n    acc = [[0,0.0,0.0] for _ in range(5)]\n    for y,p in rows:\n        c=max(p); correct=float(p.index(c)==score_index(y)); idx=min(4,int(c*5))\n        acc[idx][0]+=1; acc[idx][1]+=c; acc[idx][2]+=correct\n    ans=[]\n    for i,(n,sconf,scorr) in enumerate(acc):\n        ans.append({\"range\":\"[%.1f,%.1f%s\"%(i/5,(i+1)/5,\"]\" if i==4 else \")\"),\"n\":n,\"meanConfidence\":None if not n else sconf/n,\"empiricalAccuracy\":None if not n else scorr/n,\"gap\":None if not n else sconf/n-scorr/n})\n    return ans\n\ndef counts(games):\n    return {x:sum(m[\"outcome\"]==x for m in games) for x in OUTCOMES}\n\ndef main():\n    train=ALL[\"2021-22\"]+ALL[\"2022-23\"]\n    calibration=ALL[\"2023-24\"]\n    test=ALL[\"2024-25\"]\n    # K,H,D selected by minimum walk-forward training clipped log loss, then lexicographically.\n    candidates=[]\n    for par in itertools.product((10.,20.,30.,40.,50.), (0.,25.,50.,75.,100.), (0.50,0.75,1.00,1.25,1.50)):\n        _, r=walk(train,par)\n        candidates.append((clipped_logloss(r),par))\n    _, par=min(candidates, key=lambda x:(x[0],x[1]))\n    ratings, train_rows=walk(train,par)\n    ratings, cal_rows=walk(calibration,par,ratings)\n    temperatures=[x/100 for x in range(50,301)]\n    t=min(temperatures,key=lambda v:(clipped_logloss([(y,temperature(p,v)) for y,p in cal_rows]),v))\n    _, test_rows=walk(test,par,ratings)\n    calibrated=[(y,temperature(p,t)) for y,p in test_rows]\n    c=counts(train); n=len(train); frequency=tuple(c[x]/n for x in OUTCOMES)\n    freq_rows=[(m[\"outcome\"],frequency) for m in test]\n    info={\n      \"hashes\":{s:load(s)[1] for s in SEASONS}, \"names\":{s:load(s)[2] for s in SEASONS},\n      \"sizes\":{s:len(ALL[s]) for s in SEASONS}, \"counts\":{\"train\":c,\"calibration\":counts(calibration),\"test\":counts(test)},\n      \"duplicates\":{s:len(ALL[s])-len({(m[\"date\"],m[\"time\"],m[\"home\"],m[\"away\"]) for m in ALL[s]}) for s in SEASONS},\n      \"params\":{\"K\":par[0],\"homeAdvantage\":par[1],\"drawFactor\":par[2],\"temperature\":t,\"trainingWalkForwardLogLoss\":min(candidates)[0]},\n      \"calibrationRaw\":metrics(cal_rows), \"calibrationCalibrated\":metrics([(y,temperature(p,t)) for y,p in cal_rows]),\n      \"testFrequency\":metrics(freq_rows), \"testRaw\":metrics(test_rows), \"testCalibrated\":metrics(calibrated),\n      \"testFrequencyBootstrap\":bootstrap(freq_rows), \"testRawBootstrap\":bootstrap(test_rows), \"testCalibratedBootstrap\":bootstrap(calibrated),\n      \"reliabilityRaw\":bins(test_rows), \"reliabilityCalibrated\":bins(calibrated),\n      \"frequency\":frequency\n    }\n    print(json.dumps(info,indent=2,sort_keys=True))\n\nif __name__ == \"__main__\": main()\n"},"scope":"One reproducible English Premier League results pilot. It is neither a deployed production model nor evidence that UFC/MMA, NHL, NFL, NBA, or tennis are calibrated. It provides sports analysis only; it has no odds, wagering, token, NFT, or contract component.","sourcesLicenceEvidence":{"claim":"The README says the football.json schema, data and scripts are dedicated to the public domain; it also describes the data as free open public-domain football match fixtures and results. This is the repository's licence assertion, revalidated at retrieval, not a legal opinion.","commercialReuseAssessment":"CC0/public-domain dedication stated by the data publisher is compatible with this pilot's commercially reusable-data requirement; downstream users should independently assess their jurisdiction and the underlying competition-data rights.","licenceEvidenceQuote":"The football.json schema, data and scripts are dedicated to the public domain. Use as you please with no restrictions whatsoever.","repositoryReadme":"https://raw.githubusercontent.com/openfootball/football.json/master/README.md"},"splitManifest":{"calibration":{"boundaries":["2023-08-11 20:00","2024-05-19"],"n":380,"outcomes":{"A":123,"D":82,"H":175},"seasons":["2023-24"]},"ordering":"Sort key is (date,time,team1,team2). Matches with identical (date,time) are predicted from the same pre-kickoff ratings and only then updated as a group.","selection":"Specified chronological split accepted without alternate season selection: 2021-22 and 2022-23 train; 2023-24 calibration; 2024-25 untouched final test.","test":{"boundaries":["2024-08-16 20:00","2025-05-25"],"n":380,"outcomes":{"A":132,"D":93,"H":155},"seasons":["2024-25"],"untouchedUntilFinalEvaluation":true},"training":{"boundaries":["2021-08-13 20:00","2023-05-28"],"n":760,"outcomes":{"A":238,"D":175,"H":347},"seasons":["2021-22","2022-23"]}}}
