This is the source code that I used to run a set experiments in predicting results for football matches in the English Premier League over the 2016/17 season using simple statistics.
- Mac or Linux - Tested on a Mac, so Linux will probably be okay but for Windows there's a good chance of something not working.
- Python 3.6 - I ran things with Python 3.6, so anything newer than that should be fine.
- Various libs - pip install -r require.txt
./predictOmatic.py - demo program for predicting match results using Goal Difference and independently derived Home and Away models.
./get_results_from_bbc.py - page scrapes results from the BBC sports website and dumps in a SQLite DB in a format suitable for use by libraries and programs here.
./lib/ActualResultsLib.py - library for interacting with SQLite files that contain the results, e.g. the one generated by
/lib/FeatureLib.py - library for working with Features and their models.
/lib/StatsLib.py - library for generating simple statistics from match results.
./tests/algorithm_test_results location under which test output SQLite DB's are generated, one per test case.
tests/fixture - sqlite databases constaining fixture test data for the season.
tests/tests_*_unit.py - unit tests for corresponding libraries in
tests/test_predictor_algorithms.py - experiments.
How to run
get_results_from_bbc.py should just work assuming dependencies are present.
The tests need the
lib directory to be added before invoking the unit testing framework.
From the project's root directory, something similar to
/lib; python -m unittest tests/test*.py should work.
To figure out how to use the libraries have a look at their unit tests, failing that I'm afraid it's time to Use the Source Luke ...
There will be a blog post on this shortly which will be found here.