Skip to content

Hackathon for predicting the outcomes of Euro 2024 football matches

License

Notifications You must be signed in to change notification settings

dickymoore/Euro2024Predictor

Repository files navigation

Euro2024Predictor

Overview

Euro2024Predictor is a Python-based project that simulates the outcomes of UEFA Euro 2024 football matches. It includes functionalities for simulating group stage matches, computing standings, and predicting knockout stage results. The project also provides a Flask web application to display the simulated results.

Features

  • Group Stage Simulation: Simulates matches in the group stage based on historical data and win percentages.
  • Knockout Stage Simulation: Predicts the outcomes of knockout stage matches.
  • Standings Calculation: Computes the standings of teams based on match results.
  • Data Transformation: Preprocesses historical match data for simulations.
  • Web Interface: Displays the simulation results in an interactive web application.

Project Structure

Euro2024Predictor/
│
├── config/
│   └── config.yaml                    # Configuration file for teams and parameters
│
├── data/
│   ├── raw/                           # Raw data files
│   └── results/                       # Simulated results files
│
├── scripts/
│   ├── __init__.py
│   ├── cache.py                       # Cache handling functions
│   ├── calculations.py                # Main calculations and data handling
│   ├── config.py                      # Configuration loading
│   ├── data_sort.py                   # Data sorting functions
│   ├── data_store.py                  # Data storing functions
│   ├── data_transform.py              # Data transformation functions
│   ├── group_match_calculations.py    # Group stage match simulations
│   ├── knockout_stage_calculations.py # Knockout stage match simulations
│   ├── standings_calculations.py      # Standings calculations
│   ├── weighted_win_percentage.py     # Win percentage calculations
│   └── win_percentages.py             # Win percentages computations
│
├── static/
│   └── style.css                      # CSS for the web application
│
├── templates/
│   └── index.html                     # HTML template for the web application
│
├── tests/                             # Test cases for the project
│   └── __init__.py
│
├── .gitignore                         # Git ignore file
├── README.md                          # Project documentation
├── requirements.txt                   # Python dependencies
├── main.py                            # Main script to run the predictor
├── procfile                           # Procfile for deploying to Heroku
└── webapp.py                          # Flask web application

Getting Started

Prerequisites

  • Python 3.7+
  • pip (Python package installer)

Installation

  1. Clone the repository:
   git clone https://github.com/yourusername/Euro2024Predictor.git
   cd Euro2024Predictor
  1. Create a virtual environment and activate it:
   python -m venv venv
   source venv/bin/activate  # On Windows use `venv\Scripts\Activate`
  1. Install the dependencies:
   pip install -r requirements.txt

Usage

You can run the predictor as a command-line tool or as a web application.

Running as a Command-Line Tool

  1. Run the predictor:
   python main.py

Running as a Web Application

  1. Start the Flask web application:
   python webapp.py
  1. Open your web browser and go to http://127.0.0.1:5000 to view the results.

Running Tests

To run the tests, use the following command:

pytest

Configuration

The config.yaml file contains the configuration for the teams and other parameters used in the simulations. Update this file to change the teams or simulation settings.

Contributing

  1. Fork the repository
  2. Create a new branch (git checkout -b feature-branch)
  3. Commit your changes (git commit -m 'Add new feature')
  4. Push to the branch (git push origin feature-branch)
  5. Create a new Pull Request

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Hackathon for predicting the outcomes of Euro 2024 football matches

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •