TOP π WINNING FOOTBALL π TEAMS
FOOT-FORECASTER is a web application that provides forecasted wins for each team in the African Cup of Nations (AFCON) tournament. It utilizes historical data and machine learning models to predict the performance of teams in future tournaments. The application offers visualizations of the forecasted wins through a forecast chart, a team wins map and a ranking table.
π FOOT-FORECASTER
|
βββ π README.md
βββ π data
β βββ π afcon.csv
β βββ π results.csv
βββ π documentation
β βββ π Documentation [EN].docx
β βββ π Documentation [EN].pdf
βββ π models
β βββ π model.pkl
βββ π static
β βββ π css
β β βββ π styles.css
β βββ π js
β β βββ π jquery.min.js
β β βββ π plotly.min.js
β β βββ π script.js
β βββ π favicon.ico
βββ π templates
β βββ π index.html
βββ π preprocessing.ipynb
βββ π training.ipynb
βββ π prediction.ipynb
βββ π app.py
βββ π requirements.txt
The project folder structure consists of the following files and folders:
-
π README.md: This file contains the documentation and information about the FOOT-FORECASTER web application, including how to use it and any additional details.
-
π data: This folder contains the data files used for preprocessing and training the machine learning models, including
afcon.csv
andresults.csv
. -
π documentation: This folder contains the documentation files related to the FOOT-FORECASTER web application, including
Documentation [EN].docx
andDocumentation [EN].pdf
. -
π models: This folder contains the trained machine learning models in the form of a pickle file named
model.pkl
. -
π static: This folder contains the static assets used in the web application, including CSS files, JavaScript files, and a favicon.ico file.
-
π css: This subfolder contains the CSS stylesheets used for styling the web application, specifically the
styles.css
file. -
π js: This subfolder contains the JavaScript files used for the web application's functionality, including the
jquery.min.js
,plotly.min.js
, andscript.js
files.
-
-
π templates: This folder contains the HTML templates used for rendering the web pages, specifically the
index.html
file. -
π preprocessing.ipynb: This Jupyter Notebook file is used for preprocessing the data before training the machine learning models.
-
π training.ipynb: This Jupyter Notebook file is used for training the machine learning models using the preprocessed data.
-
π prediction.ipynb: This Jupyter Notebook file is used for forecasting the top teams based on the trained machine learning models.
-
π app.py: This file contains the Flask microservice backend for the FOOT-FORECASTER web application. It includes the machine learning model and handles the data requests and responses.
-
π requirements.txt: This file lists the project's dependencies and their versions for easy installation.
To use the FOOT-FORECASTER web application, follow these steps:
-
Clone or download this project repository.
-
Install the required dependencies by running the following command:
pip install -r requirements.txt
-
Open the
preprocessing.ipynb
notebook and execute it to preprocess the data. -
Open the
training.ipynb
notebook and execute it to train the machine learning models. -
Open the
prediction.ipynb
notebook and execute it to generate the forecasted wins for the top teams. -
Run the Flask microservice backend by executing the following command:
python app.py
-
Open a web browser and access the FOOT-FORECASTER web application by navigating to
http://localhost:5000
. -
Use the year slider to select a specific year and view the forecasted wins for each team in the forecast chart.
-
Explore the team wins map to see the forecasted wins for African teams.
-
Check the top countries table for a summary of the top-performing countries based on the forecast.
The FOOT-FORECASTER web application is implemented using JavaScript, jQuery, Plotly, and Flask. Here's a breakdown of the different components:
-
JavaScript: The
FootForecaster
class in thescript.js
file handles the interactivity of the web application, including attaching event listeners, updating the dashboard based on user input, and managing scroll behavior. -
jQuery: jQuery is used to select and manipulate HTML elements in the web application. It simplifies event handling and DOM manipulation.
-
Plotly: The Plotly library is used for creating the forecast chart and team wins map visualizations. The
updateForecastChart()
andupdateTeamWinsMap()
functions in thescript.js
file update the respective visualizations using data retrieved from the Flask backend. -
Flask: The Flask microservice backend is implemented in the
app.py
file. It handles the routing and data requests for the web application. The/update_dashboard
endpoint receives the selected year from the frontend and returns the necessary data for updating the forecast chart, team wins map, and top countries table.
If you encounter any issues or errors while using the FOOT-FORECASTER web application, consider the following:
-
Double-check that all the necessary files and folders are present in the correct locations, as described in the folder structure section.
-
Ensure that you have Python installed on your system, and the required dependencies are installed by running
pip install -r requirements.txt
. -
Verify that the data files (
afcon.csv
andresults.csv
) are located in thedata
folder and are correctly formatted. -
If you encounter any issues with the machine learning models, make sure you have successfully preprocessed the data and trained the models using the provided Jupyter Notebook files (
preprocessing.ipynb
andtraining.ipynb
). -
If the Flask microservice backend fails to run, check that there are no errors in the
app.py
file and that the required dependencies are installed.
If the problem persists, feel free to open an issue in the GitHub repository for further assistance.
This README file provides an overview of the FOOT-FORECASTER web application, its folder structure, usage instructions, code explanation, and troubleshooting tips. Use it as a guide to understand and utilize the FOOT-FORECASTER app.