Skip to content

A collection of python scripts to collect, clean and visualise odds for football matches from Betfair, as well as perform machine learning on the collected odds.

Notifications You must be signed in to change notification settings

amankhoza/betfair-machine-learning

Repository files navigation

Betfair

Collect odds

To begin collecting odds you must run the betfair.py script using the following command:

python3 betfair.py appKey sessionToken &

Create Application Key

To create an Application Key visit:
http://docs.developer.betfair.com/docs/display/1smk3cen4v3lu3yomq5qye0ni/Application+Keys#ApplicationKeys-HowtoCreateAnApplicationKey

Obtain Session Token

Clean data

To clean the data (remove noise and anomalous results), run the cleanData.py script using the following command:

python cleanData.py directory

where directory is the directory that contains the .csv files to be cleaned. This will create a new directory CLEANED_FILES within directory which will contain the cleaned .csv files.

Plot match odds

To plot collected odds for a particular match run the plotMatchOdds.py script using the following command:

python plotMatchOdds.py example.csv

You can produce a more detailed plot which includes shaded regions for when the match is inplay, and dashed lines for goals using the following command:

python plotMatchOdds.py example.csv extraMinsFirstHalf extraMinsSecondHalf minOfGoal1 minOfGoal2 ...

About

A collection of python scripts to collect, clean and visualise odds for football matches from Betfair, as well as perform machine learning on the collected odds.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages