Soccer Predictions using Python (part 2a)

in #programming7 years ago

Here's a quick update on the predictions.

  • Crystal Palace 0-1 Southampton
  • Huddersfield Town 1-1 Leicester City
  • Liverpool 1-1 Burnley
  • Newcastle United 2-1 Stoke City
  • Tottenham Hotspur 0-0 Swansea City
  • Watford 0-6 Manchester City
  • West Bromwich Albion 0-0 West Ham

3 out of 7 correct - the rest were draws.  That's 42.86% - is there something wrong with the code?

Lets have a look at the stats for our misses.

Huddersfield v Leicester - Huddersfield appear to have been the stronger team - the site shows 57% possession and 4-0 in "shots on target" (I assume this precludes the goals scored for each team).

Liverpool v Burnley - Liverpool stronger team - 67% possession, 11-3 shots on target.

Spurs v Swansea - Spurs stronger team - 68% possession, 8-0 shots on target.

West Brom v West Ham -  This is less clear cut, with West Ham looking stronger - West Brom had only 37% possession but still managed to lead 2-1 in the shots on target stat.

Looks like we're going in the right direction so far but we have a lot to do - perhaps it would be worthwhile using a "double chance"/"home or draw" bet that although lowering our potential return on a correct prediction, would make a return much more likely.  Also worth looking at would be laying our predicted loser?  Advice from any professional gamblers would be most welcome here....

I've created a github page for the code which you can access here - https://github.com/steviecurrie/soccer-prediction.   You'll find the code we've used so far and it's the first place any updates will appear.

I'll be back soon with part 3 in which I hope to have some updated code and some more predictions.  As always, feel free to pipe in with any suggestions advice etc.

Have another day.

Steven


Sort:  

im interested in this kind of thing. do you make the code based on the percentage of ball possesion and predict how many goals it make for each team ? or you make something else. i'm interested. but im not entirely sure

So far the code is only using previous scores. It takes the historical results and calculates the average scores for the competition, then looks at at each teams scores and calculates an estimated attack and defence strength. Have a read through the code, It's pretty straight forward and well commented. If there's anything there you don't get, let me know and I'll try and expand on what's happening.

I'll likely be adding some machine learning elements to the code soon too.

Thanks for your interest.