Case Study · Machine Learning · Sports Analytics
International Football
Predictive Engine
An advanced machine learning pipeline and dynamic ELO tracking system forecasting the ultimate global football tournament, built resiliently from limited data.
Model Accuracy
42.0%
5-fold CV · 3-class (random = 33.3%)
Log-Loss vs Baseline
1.038
beats the 1.098 class-frequency baseline
Training Match-Ups
214
reconstructed from raw team logs
Teams Tracked
48
across 12 groups · live form index
Honest numbers, on purpose: 3-way football outcomes are noisy and draws are structurally hard. What matters for a betting-grade forecaster is calibration — beating the log-loss baseline — not a vanity accuracy figure.
The Challenge
Forecasting with almost no data
National teams play a handful of matches per year, advanced telemetry was missing, and anti-bot infrastructure limited scraping depth. The engine was designed around scarcity rather than wishing it away.
Empty xG telemetry → goal-based proxies
The scraped dataset arrived with the expected-goals columns 100% empty. Rather than discarding the feature, the pipeline substitutes a defensible proxy — average goals scored and conceded — and is wired to automatically prefer real xG the moment the scraper backfills it.
Sparse possession data → mean imputation
Possession was available for only ~40% of matches. A SimpleImputer inside the model pipeline handles missing values statistically instead of dropping rows, preserving every one of the scarce training examples.
No head-to-head history → symmetric augmentation
Only 214 matches existed between qualified teams. Each match is encoded from both perspectives (A vs B and B vs A with mirrored deltas), keeping the model order-invariant and squeezing maximum signal from minimum data.
System Design
A static brain with a living pulse
The core insight: separate what should be stable (the trained model) from what should adapt (team form). Each layer does one job and does it transparently.
Match-Up Feature Engineering
825 raw per-team match logs are collapsed into team profiles, then transformed into a relational 'Team A vs Team B' format. Every feature is a Delta — expected-goals difference, possession gap, betting-market implied probability spread, and historical pedigree (titles, finals, semifinals) — so the model learns relative strength, not team identity.
Calibrated Probabilistic Model
A multinomial Logistic Regression (impute → standardize → L2-regularized classifier) outputs true mathematical probabilities for Win A / Draw / Win B. It optimizes log-loss directly, so a 60% forecast genuinely means 60% — verified against a class-frequency baseline under stratified cross-validation.
Train Once, Never Retrain
The model is fitted a single time and persisted to disk. During the tournament it is never re-fitted — a deliberate guardrail against overfitting to tiny in-tournament samples. Adaptivity comes from a separate, transparent layer: the Live Form Index.
Live Form Index (Dynamic ELO)
After each real result, every team's multiplicative form index is updated Bayesian-style: the boost scales with the surprise (1 − predicted probability of the observed outcome), is amplified by goal margin, and corrected by the match's real expected-goals balance. Next-round predictions tilt the base probabilities by the form ratio — so forecasts evolve organically with the tournament.
The Adaptive Layer
How the Live Form Index thinks
A Bayesian-flavoured ELO update where evidence strength is the model's own surprise. Upsets move the needle; expected wins barely do.
surprise = 1 − Pmodel(observed outcome)
winner.form ×= 1 + Kwin · surprise · margin_boost
loser.form ×= 1 − Klose · surprise · margin_boost
both.form ×= 1 ± Kxg · tanh(ΔxG / 2)
next_round_odds ∝ base_odds · (form_A / form_B)γ
In stress tests, an unfancied side beating a heavy favourite (priced at just 3%) lifts its form index by over +40% — and every one of its subsequent fixtures is re-priced instantly, with zero retraining. Before kickoff, the index is seeded from open betting-market momentum, making the top favourite emerge organically from the data.
Hybrid Methodology
A Hybrid Intelligence Architecture
The engine's second evolution fuses its calibrated statistical core with LLM-powered agentic workflows. Generative AI telemetry parsing converts unstructured post-match documents — qualitative narrative and hard metrics alike — into machine-readable signal for the dynamic Bayesian ELO. This is generative AI deployed as a data engineering instrument, not a chat interface.
Hybrid AI Pipeline
// agentic_workflow · 5 stages · zero retraining
Unstructured Match PDF
raw post-match reports
input: *.pdf
LLM / NLP Extraction Agent
agentic parsing loop
agent.extract()
Data Normalization
strict JSON contract
ai_match_insights.json
Dynamic Bayesian ELO Update
surprise-weighted posterior
form ×= f(surprise, ΔxG)
Predictive Engine Forecast
form-tilted probabilities
P(win · draw · win)
LLM-Powered Agentic Workflows
Post-match intelligence does not arrive as clean tabular data — it arrives as unstructured match PDFs and anti-bot-walled results pages. An autonomous extraction agent orchestrates the run end-to-end: it drives a real browser, plans its own parsing strategy, self-corrects on malformed documents, and retries failed extractions. No brittle CSS selectors, no regex archaeology — the LLM reasons over each document the way a human analyst would.
NLP for Unstructured Data
Natural Language Processing (NLP) for unstructured data is the hard engineering problem here: a single match report mixes free-flowing narrative prose with embedded hard metrics. The generative layer performs layout-aware reading, entity resolution, and unit normalization to extract both the qualitative context (how the match actually unfolded) and the quantitative telemetry (xG, possession, duel percentages) from the same raw document.
Generative AI Telemetry Parsing
Every extraction is distilled into a strict, machine-validated JSON contract (ai_match_insights.json) — the boundary where probabilistic generation meets deterministic engineering. Each field is optional by design: the dashboard renders graceful pending states for unprocessed fixtures, so a parsing failure degrades the experience instead of breaking it. The parsed expected-goals balance then flows straight into the surprise-weighted Bayesian form update.
The Hybrid Verdict
The final synthesis is where the Hybrid Intelligence Architecture earns its name: the generative layer reads the statistical model's pre-match probability distribution alongside the extracted telemetry and writes an analyst-grade verdict — did the model genuinely miss, or did variance simply win the day? Quantitative calibration and qualitative reasoning, reconciled in a single loop.
Data Compliance & IP Integrity
Built to respect the rules of the game
Generic terminology by design
Major international sporting events are protected by some of the strictest trademark and ambush-marketing regulations in commercial law. This project deliberately avoids all protected event names, marks, logos, and venue branding — referring only to a generic “global football tournament”. The forecasting science is identical; the legal exposure is zero.
Shadow data analysis
All inputs come from publicly available team statistics and open betting-market signals — no official feeds, no licensed data products, no proprietary content. Results are tracked exclusively from publicly reported final scores. Operating in the “data shadow” of an event is a real-world constraint for analytics vendors, and handling it correctly is part of the engineering brief — commercial and legal maturity as a feature, not an afterthought.
See the engine in motion.
Live projections, prediction tracking, and the dynamic form index — straight from the engine's own output files.
Explore Dashboard