Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Frame 2

Python Version Streamlit App License: MIT

An end-to-end machine learning analytical dashboard and simulation engine designed to predict the FIFA World Cup 2026. The system uses historical international match data, dynamic Elo ratings, linear-decay form curves, Poisson goal estimators, and a Random Forest match outcome classifier to model 10,000 tournament iterations. The standings, probabilities, and H2H predictions are aligned with elite sports analytics benchmarks.


🚀 Features

🏆 1. Monte Carlo Tournament Simulator

  • 10,000-Run Simulation: Runs a high-performance simulation loop across all 12 groups (A to L) and the new Round of 32 knockout bracket.
  • Opta-Aligned Win Probabilities: Calibrated to match real-world supercomputer models (e.g., Spain, France, and Argentina as frontrunners).
  • Dynamic Group Finish Ordering: Automatically sorts the group stage draw view in the predicted finishing order (1st to 4th) based on simulated averages.

📊 2. Historical Insights & EDA

  • International Goal Trends: Analyzes goal scoring patterns over time.
  • H2H Top 20 Matrices: Interactive matrices showing historical performance, goals, and results among top international teams.
  • Feature Importance Plots: Visualizes features (Elo difference, recent goal forms, H2H statistics) that drive prediction accuracy.

🔮 3. Interactive H2H Match Simulator

  • Custom Matchups: Select any two international teams to estimate expected goals (xG), win/draw/loss probabilities, and view detailed historic head-to-head performance.
  • Poisson Scoreline Generator: Generates realistic scorelines using random Poisson draws modeled from teams' offensive/defensive form and Elo ratings.
Preview

🛠️ Tech Stack

  • Frontend & Dashboard: Streamlit (utilizing custom responsive CSS grids)
  • Scientific Computing: NumPy, SciPy
  • Data Manipulation: Pandas
  • Machine Learning: Scikit-learn (PoissonRegressor, RandomForestClassifier, GridSearchCV)
  • Interactive Visualizations: Plotly
  • Notebook Generation: Automated via create_notebook.py

🗂️ Project Directory Structure

├── Dataset/
│   └── results.csv
├── Image/
│   └── Frame 1.png
├── models/
│   └── dashboard_data.pkl
├── app.py
├── prepare_data.py
├── requirements.txt
└── EDA.ipynb

⚙️ Mathematical & Modeling Methodology

📈 1. ELO Rating System

Historical Elo ratings are calculated match-by-match since 1872 using the standard update formula: $$R_{\text{new}} = R_{\text{old}} + K \times (S - E)$$

  • Elo Scaling: Elo features are scaled (divided by 400.0) before fitting to prevent exponential overflow in the Poisson log-link function.

📉 2. Linear-Decay Form Curves

A team's recent form (points accumulated, goals scored, and goals conceded) is computed using a linear decay average over their last 10 matches, giving higher weight to the most recent games.

⚽ 3. Goal Modeling (Poisson Regression)

Expected goals (xG) are modeled using a Poisson generalized linear model (GLM) with a log-link function: $$\log(\lambda_1) = \beta_0 + \beta_1 \frac{\text{Elo}_1}{400} + \beta_2 \frac{\text{Elo}_2}{400} + \beta_3 \frac{\text{Elo}_1 - \text{Elo}_2}{400} + \beta_4 \text{GF-Form}_1 + \beta_5 \text{GA-Form}_2$$ Goals scored are then sampled from: $$\text{Goals}_1 \sim \text{Poisson}(\lambda_1)$$


📥 Local Installation & Run Guide

1. Clone the Repository

git clone https://github.com/aryannverse/FIFA-2026-WC-Prediction-.git
cd Football-Analysis

2. Set Up Virtual Environment (Recommended)

python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Run Model Training & Preprocessing

To re-run the dataset processing, train models via GridSearchCV, and execute the 10,000-run simulation:

python prepare_data.py

5. Launch the Streamlit Dashboard

streamlit run app.py

Open http://localhost:8501 in your browser.

About

An end-to-end machine learning analytical dashboard and simulation engine designed to predict the FIFA World Cup 2026.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages