Hello again, and welcome to the final post in this series.
Final post at least for now as I think the code is working about as best as it can using this method of prediction.
It appears to be around 70% accurate in predicting home/draw/away and around 60% in the over/under 2.5 predictions.
Obviously, there are other things that could be inferred from the poisson distribution. It wouldn't take much, for example, to calculate odds for each individual score line. I leave any such improvements to the world at large. :-)
The main reason for this post is for a quick description of how to get the code running on a Windows Python installation.
I've made some updates to the code, done some tidying up and changed the scraping method slightly. The biggest change was removing the selenium webdriver as this wasn't necessary, it now uses the standard requests module.
So, here's a brief explanation of what I did to confirm it works on Windows.
I installed a fresh copy of Windows (Win7/64 - won't matter if you're on 8, 10, or even XP) and then installed the standard Python 3.6.2 distribution - I used the "Windows x86-64 executable" installer package from python.org.
Once this was done, I downloaded soccerprediction.py, put it in it's own folder, opened a command prompt and changed directory to the location of the file. In my case, it was d:\python\soccerpredictions\
Then, to install the dependencies I ran
pip install pandas
pip install requests
pip install beautifulsoup4
The pandas install brings down the numpy module as well as a few others, so I didn't need to install numpy.
python soccerprediction.py -t
successfully completed the backtest and output the following.
Score of 66.67% with history setting of 400 and cutoff of 70
Validation score of 88.89%
If the above scores seem acceptable, you should use these options
soccerprediction.py -c "England" -l "Premier League" -y 400 -b 70
Good Luck!
The next Premier League games are on the 30th of September so I then ran
soccerprediction.py -c "England" -l "Premier League" -y 400 -b 70 -d 2017-09-30
Which gives only one prediction from the seven to be played on that day.
Manchester United v Crystal Palace : Prediction:Manchester United Win, Probability:76.69, Odds:1.30
There are predictions for the other six games, you can find them in the file data\England-Premier-League.csv. If you run the code yourself, you'll see that there are a couple of games with predicted home win probabilities of ~59% but since this is lower than the 70% cutoff the backtest provided the code doesn't flag these as worthwhile bets (they might be though).
Anyway, that's enough from me for now. I'll be continuing to use this code myself but don't intend to develop it any further for the foreseeable future.
I've started work on a Poloniex Trading Bot and will be posting some articles about my progress soon.
Later. :-)