I Trained a Model on 150 Years of Football to Predict Today’s World Cup Final
Summary
The author developed a machine learning model to predict the 2026 World Cup final between Spain and Argentina, utilizing a dataset of 49,521 international football matches dating back to 1872. A core component was an Elo rating system, which quantified team strength by adjusting ratings based on match stakes (e.g., K-factor 60 for World Cup, 20 for friendlies), goal difference, and a +100 rating boost for home advantage. This system generated features for a `HistGradientBoostingClassifier` model. Crucially, a walk-forward backtest on 103 matches of the 2026 World Cup tournament prevented data leakage, yielding 65% accuracy and a log-loss of 0.847, slightly better than an Elo-only baseline's 0.851. The model predicted Spain to win the final on July 19th, 2026, with a 53.6% probability against Argentina's 46.4%.
Key takeaway
For Machine Learning Engineers building predictive models with historical data, prioritize rigorous validation and data integrity. You should implement walk-forward backtesting to prevent data leakage and ensure your model's real-world performance is accurately assessed. Additionally, conduct adversarial reviews on your pipelines; even careful initial passes can miss critical bugs that impact prediction reliability. This approach, focusing on honest methodology, is more valuable than complex model architectures.
Key insights
Honest machine learning requires rigorous data handling and validation to avoid self-deception and ensure reproducible, reliable predictions.
Principles
- Data leakage invalidates model evaluation.
- Elo rating systems effectively quantify team strength.
- Rigorous backtesting is crucial for time-series predictions.
Method
The author built an Elo rating system by processing 49,521 matches chronologically, updating team ratings based on stakes, goal difference, and home advantage. This generated features for a `HistGradientBoostingClassifier` trained via walk-forward backtesting.
In practice
- Implement Elo ratings for competitive ranking.
- Use walk-forward backtesting for time-series ML.
- Conduct adversarial reviews on ML pipelines.
Topics
- Predictive Modeling
- Elo Rating System
- Data Leakage
- Walk-Forward Backtesting
- Gradient Boosting
- Sports Analytics
Code references
Best for: Machine Learning Engineer, Data Scientist, AI Student
Related on AIssential
See Counsel's argued verdicts on the open AI decisions leaders are weighing →
Editorial summary, takeaway, and curation by AIssential. Original article published by Machine Learning on Medium.