Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
This project pulls past game data from api-football, and uses this to predict the outcome of future premier league matches with the use of classical machine learning techniques.
| Date | Stars |
|---|---|
| 2026-07-31 | 303 |
| 2026-08-06 | 304 |
Today
+1 stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
<a href="http://matthaythornthwaite.pythonanywhere.com/"><img src="https://raw.githubusercontent.com/mhaythornthwaite/Football_Prediction_Project/master/web_server/static/images/Smart_Football_Predictor_Github_Logo_v2.png" alt="Smart Football Predictor" alt="Smart Football Predictor"></a>
<h4 align="center">Live predictions were displayed in a webapp from 2020 and 2024 but this feature is no longer supported.
</h4>
<p align="center">
<a href="https://www.python.org/doc/" alt="Python 3.7">
<img src="https://img.shields.io/badge/python-v3.7+-blue.svg" />
</a>
<a href="https://github.com/mhaythornthwaite/Football_Prediction_Project/blob/master/LICENSE" alt="Licence">
<img src="https://img.shields.io/badge/license-MIT-yellow.svg" />
</a>
<a href="https://github.com/mhaythornthwaite/Football_Prediction_Project/commits/master" alt="Commits">
<img src="https://img.shields.io/github/last-commit/mhaythornthwaite/Football_Prediction_Project/master" />
</a>
<a href="https://github.com/mhaythornthwaite/Football_Prediction_Project" alt="Activity">
<img src="https://img.shields.io/badge/contributions-welcome-orange.svg" />
</a>
<a href="http://matthaythornthwaite.pythonanywhere.com/" alt="Web Status">
<img src="https://img.shields.io/website?down_color=red&down_message=down&up_color=success&up_message=up&url=http%3A%2F%2Fmatthaythornthwaite.pythonanywhere.com%2F" />
</a>
</p>
## Table of Contents
<!--ts-->
* [Aims and Objectives](#Aims-and-Objectives)
* [Dataset](#Dataset)
* [Data Cleaning and Preparation](#Data-Cleaning-and-Preparation)
* [Feature Engineering and Data Visualisation](#Feature-Engineering-and-Data-Visualisation)
* [Model Selection and Training](#Model-Selection-and-Training)
* [Evaluation](#Evaluation)
* [Further Work and Improvements](#Further-Work-and-Improvements)
<!--te-->
## Aims and Objectives
The aim of this study was to build a model that could accurately predict the outcome of future premier league football matches. Success was judged using the following two objectives, one quantitative and one qualitative:
- Achieve a test accuracy of greater than 50%, with a stretch target of 60%.
- Output probabilities that appear sensible/realistic, that are comparable to odds offered on popular betting websites.
## Dataset
The data was collected directly from an API:<a href="https://www.api-football.com/" target="_blank"> api-football</a>. This was preferred over a static database that can be readily found online, due to the following:
- API calls can be made daily, refreshing the database with the most recent statistics and results, allowing the model to consistently be retrained on up-to-date information.
- The API not only provides past game data but also information on upcoming games, essential to make predictions which feed into the web application.
## Data Cleaning and Preparation
Data was initially collected from the 2019-2020 premier league season, in the form of a single json file per fixture containing a range of stats (e.g. number of shots, possession etc.) These json files were loaded into a Pandas DataFrame, and organised into a nested dictionary in the following form: `{team ID: {fixture_id: stats_df}}`
Execution of `01_api_data_request.py` and `02_cleaning_stats_data.py` will update the database with recently played fixtures not already stored within the database and add these DataFrames directly to the nested dictionary described above.
## Feature Engineering and Data Visualisation
In order to utilise as much previous match data as possible, whilst minimising the number of features, match data was averaged over the previous 10 games to predict an upcoming fixture. To understand how well a single team is performing, their average stats were subtracted from their opponent’s average stats, to produce a difference metric e.g. number of shots difference. A team with `number_of_shots_diff = 2` has taken on average 2 mExcerpt of 11,721 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:a6c75a3464d79958, llm:Repository topics and description: 'football-prediction', 'machine-learning', 'scikit-learn', 'data-science', 'prediction'. README describes pulling past game data and using classical machine learning to predict Premier League match outcomes; includes data cleaning, feature engineering, model selection, evaluation, and a Flask webapp.
matched fp:a6c75a3464d79958, llm:Repository topics and description: 'football-prediction', 'machine-learning', 'scikit-learn', 'data-science', 'prediction'. README describes pulling past game data and using classical machine learning to predict Premier League match outcomes; includes data cleaning, feature engineering, model selection, evaluation, and a Flask webapp.