The Match Predictor codebase contains an app with several predictors for football results.
It's reading football match data from 531.org
While this is a football match predictor it's also a framework for automated testing of models
with code changes over time.
Follow the instructions below to get the app up and running on your machine.
- Install Python 3.11 and a recent version of NPM.
- Install dependencies and run tests.
make install test
- View the list of available tasks
make
Here are a few tasks that are useful when running the backend app. Make sure they all run on your machine.
-
Run tests
make backend/test
-
Run model measurement tests (trains model)
make backend/measure
-
Run server
make backend/run
-
Run an accuracy report (runs models and generates accuracy reports)
make backend/report
Here are a few tasks that are useful when running the frontend app. Make sure they all run on your machine.
-
Run tests
make frontend/test
-
Run server
make frontend/run
If it's helpful, you may want to run integration tests during development. Do so with the tasks below.
-
Run tests
make integration/test
-
Interactive mode
make integration/run
less
Some models created are for validating the framework with automated testing (e.g. alphabetic/home team) models. Otherw are intended to be actual models to see how they perform (e.g. LR modell, improved LR model, )
Create a measurement test for your alphabet model in the backend/test/predictors directory.
- Measure_alphabet_predictor.py in test/predictor. Measure for 33% accuracy, it's not going to be a great model.
- Created (alphabet_predictor.py) alphabet model in the backend/matchpredictor/predictors directory. Make sure that it inherits from Predictor.
- Make sure the tests pass by running make backend/measure. There are 7 model tests.
- Added alphabet model to ModelProvider in app.py and test_models_api.py
- Make sure added alphabet model shows up in the report by running make backend/report. Automated testing of models: adaboost, alphabetic (just for testing framework), gaussian NB, home team (baseline), Improved LR (more featurs, Linear regression,
- and past results predictor.
If you want to develop a more sophisticated model. Bonus points if you can get better than 50% accuracy predicting the 2021 English Premier League season.
Create a test for a new model, trained on past results (see a few of the other models for ideas in the backend/matchpredictor/predictors directory). Start to implement your new model. Add your new model to ModelProvider in app.py. Using the measurement tests and the report, iterate on your model to improve the accuracy.