This project is a Flask-based web application that predicts Australian Football League (AFL) match outcomes using machine learning. It fetches current AFL match data, processes historical match data, and uses a TensorFlow model to make predictions.
- Fetches and converts AFL historical data from Excel to CSV format
- Retrieves current AFL match schedules
- Predicts match outcomes using a TensorFlow LSTM model
- Displays predictions in a web interface
- Dockerized for easy deployment and consistency across environments
To run this project, you need to have the following installed:
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/planetbridging/afl-prediction.git cd afl-prediction
-
Build and run the Docker container:
docker-compose up --build
-
Access the application by navigating to
http://localhost:5008/afl
in your web browser.
app.py
: Main Flask application fileafl_models.py
: Contains the TensorFlow model for match predictionexcel_convert.py
: Handles conversion of Excel data to CSVget_current_matches.py
: Fetches current AFL match datatemplates/afl.html
: HTML template for displaying predictionsDockerfile
: Defines the Docker image for the applicationdocker-compose.yml
: Defines the services for Docker Composerequirements.txt
: Lists Python package dependencies
- The application fetches historical AFL data and converts it to CSV format.
- Current AFL match schedules are retrieved from a web source.
- For each upcoming match, the application uses a TensorFlow LSTM model to predict the outcome based on historical data.
- Predictions are displayed in a web interface, showing the likely winner and predicted scores.
You can modify the TensorFlow model in afl_models.py
to experiment with different architectures or hyperparameters. Adjust the data fetching and processing in excel_convert.py
and get_current_matches.py
if the data sources or formats change.
Contributions to improve the project are welcome. Please follow these steps:
- Fork the repository
- Create a new branch (
git checkout -b feature/AmazingFeature
) - Make your changes
- Commit your changes (
git commit -m 'Add some AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Data provided by Austadiums and AusSportsBetting
- Inspired by the exciting world of AFL and the power of machine learning in sports prediction