I Trained a Model on 150 Years of Football to Predict Today’s World Cup Final

· Source: Machine Learning on Medium · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Data Science & Analytics · Depth: Intermediate, medium

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

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

Topics

Code references

Best for: Machine Learning Engineer, Data Scientist, AI Student

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by Machine Learning on Medium.