Source code for a few simple experiments in predicting results in the English Premier League
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
tests
README.md
get_results_from_bbc.py
predictOmatic.py
require.txt

README.md

Overview

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.

Dependencies

  • 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

Contents

./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 get_results_from_bbc.py

/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 lib

tests/test_predictor_algorithms.py - experiments.

How to run

predictOmatic.py and 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 PYTHONPATH=pwd/lib; python -m unittest tests/test*.py should work.

Documentation

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 ...

More info

There will be a blog post on this shortly which will be found here.

https://taskudo.info/blog/