Machine learning pipeline that forecasts the probability of each team winning the 2026 FIFA World Cup using ~49K real international matches (1872-2026) and Monte Carlo bracket simulation.
A machine learning pipeline that forecasts the probability of each remaining team winning the 2026 FIFA World Cup, using ~49,000 real international football matches played between 1872 and 2026.
This project uses real historical match data to:
| File | Description |
|---|---|
international_results.csv |
~49,000 international matches (1872β2026), sourced from martj42/international_results β a widely-used mirror of the Kaggle dataset βInternational football results from 1872 to 2026β. |
The dataset already includes the 2026 World Cup fixtures. As of the current run, two Round-of-16 matches have been played and are treated as hard results:
| Date | Match | Score |
|---|---|---|
| 2026-07-04 | France vs Paraguay | 1β0 |
| 2026-07-04 | Morocco vs Canada | 3β0 |
The remaining six R16 matches and the entire knockout tree (QF β SF β Final) are forecast by the model.
Tabular data with tens of thousands of rows is the sweet spot for tree-based ensemble methods. Deep learning offers no advantage here without event-level tracking data (player positions, possession chains, etc.). Gradient Boosting is fast, interpretable, handles mixed feature types well, and β with isotonic calibration β produces the reliable probability estimates needed for bracket simulation.
.
βββ world_cup_forecast.py # Main forecasting pipeline (5 steps)
βββ world_cup_forecast_analysis.ipynb # Jupyter notebook with full analysis & visualizations
βββ international_results.csv # Raw match data (~49K matches, 1872β2026)
βββ .gitignore
βββ README.md
Install dependencies:
pip install numpy pandas scikit-learn
# 1. Clone the repository
git clone https://github.com/andresveraf/World-Cup-2026.git
cd World-Cup-2026
# 2. (Optional) Create a virtual environment
python3 -m venv venv
source venv/bin/activate
# 3. Install dependencies
pip install numpy pandas scikit-learn
# 4. Run the forecaster
python world_cup_forecast.py
The script will print:
| Step | What it does |
|---|---|
| 1. Load data | Parses international_results.csv, separates played matches from upcoming fixtures |
| 2. Feature engineering | Builds Elo diff, form (last 10 matches), H2H win rate, rest days, neutral flag β all leak-free |
| 3. Train + calibrate | Gradient Boosting (250 trees) wrapped in CalibratedClassifierCV (isotonic, 3-fold) |
| 4. Validate | Time-based 90/10 split; reports log loss and Brier score |
| 5. Monte Carlo | Precomputes pairwise win probabilities, then simulates 50,000 complete tournaments through the real live bracket |
42) for reproducibility.This project is for educational and analytical purposes. The match data is sourced from the public martj42/international_results dataset.