Skip to content

Nielsvdvoort2002/WorldCup-Predictor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

World Cup 2026 Predictor

Prediction system for the 2026 FIFA World Cup (48 teams). Built in Python/Jupyter. Computes ELO ratings from 150+ years of match history, scrapes squad market values from Transfermarkt, trains an XGBoost classifier, and runs 1000 Monte Carlo tournament simulations.


Results

Tournament winner probabilities (1000 simulations)

Win probabilities

Group-stage match predictions

Group stage predictions


How it works

fetch_matches.ipynb   →  data/train.csv          (downloaded 40k+ historical results)
fetch_elo.ipynb       →  data/eloratings.csv      (compute ELO ratings)
scrape_team_worth.ipynb → data/squad_values.csv   (Transfermarkt squad values)
process.ipynb         →  data/wc2026_model.pkl    (XGBoost model + Monte Carlo tournament run)
predict_wc2026.ipynb  →  figures/                 (individual predictions + charts)

Model features

Category Features
ELO Current rating, 365-day rolling max/avg, momentum
Form Last-5 win rate, goals scored/conceded, goal diff (exponential decay)
H2H Historical win rate
Context Neutral venue, WC-related tournament flag, confederation
Squad value attack/defence and full squad values (from Transfermarkt 2005–2025)

Model: XGBClassifier (3-class: Home/Draw/Away).Chronological train/test split at 2022-01-01. Test log-loss ≈ 0.88, accuracy ≈ 60%.

Simulation: Each of 1000 runs simulates the full 48-team bracket. Draws in knockout rounds are resolved by ELO-weighted coin flip.

ELO system

Implements ELO system as in World Football ELO.

ELO history

Squad value vs ELO

Squad value vs ELO


Project structure

WorldCup-Predictor/
├── data/               # CSVs and model pickle
├── figures/            # Generated charts
├── notebooks/          # Jupyter notebooks (run in order)
└── src/
    ├── config.py       # All constants (ELO params, model params, N_SIMULATIONS)
    └── team_data.py    # Name maps, confederation lookup, groups, fixtures

About

Model to predict individual world cup football matches, allowing tournament prediction through monte carlo estimation.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors