Machine learning for sports betting: this is not a classification problem
To illustrate, we have devised two basic strategies
Betting on sports is one of those ideal tasks for machine learning algorithms, especially neural network classification, Tons of available data and a clear winner-take-all target!
However, classical classification models are not well suited to betting strategies, and you need to use the user loss function in your neural network to achieve greater profitability. We will explain why below.
Simple betting strategies for the English Premier League.
Let's implement basic betting strategies based on odds from betting exchanges. Decimal odds are the ratio of the total payout to the bet. For example, odds of 2 means that for a bet of $1 you can win $2 (including your bet). Note that the inverse of the odds ratio gives the implied probability of being right. A chance of 2 means a 50% chance of winning (1 / odds). Consequently, you want to bet on the teams with the lowest odds, i.e. with the highest probability of winning.
To illustrate, we have devised two basic strategies:
- "Win or Draw": Bet on the team with the lowest odds, the one with the highest probability of winning.
- "Win or Draw": Bet on the team with the lowest odds and bet on a draw.
Suppose we have odds of 5.5-1.61 for the Bournemouth vs Chelsea game. The odds for Chelsea to win are 1.61. Therefore, we bet on Chelsea to win for Win or Draw Strategy, and Win or Draw Strategy
Prediction accuracy and overall profit
Now let's compare the two betting strategies: Win or Draw.
For the data we used the Betfair API, Betfair is one of the largest betting exchanges, and its API contains browsing exchange markets, odds search and betting operations.
The bar graphs above represent the accuracy and profit achieved by both betting systems. Accuracy represents the number of correct bets divided by the total number of bets (in this case 200). The profit represents the amount of money you could have earned by investing £1 in each bet.
The first graph on the left shows an accuracy ratio of 61% for the 'win or draw' strategy and 80% for 'win or draw'. In this case "Win or Draw" looks much better. However, the second graph shows that the profits it generates are much smaller than the 'win or draw' strategies. £1 versus £12.
Therefore, we should not strive for greater accuracy in predicting game results, but instead, we should focus on maximising our overall profits,
A neural network for betting predictions
When deciding which team to invest in, a lot of data is required. For this reason, betting is an ideal subject for one of the most popular machine learning techniques,Neural Networks,
In particular, we could use neural network classification. NN classification is ideal when applied to tasks for which there is a discrete outcome, or otherwise specified when determining which category a particular observation belongs to. As examples, think of the ridiculous "Hotdog, not Hotdog" or "Sentiment Analysis" which attempts to classify a text as positive or negative.
When applied to sports betting, we could develop a neural network with three simple categories. Below is the architecture of such a network.
However, it is clear from our previous example with two simple betting strategies that we are not trying to predict the outcome of the game, but rather which bet would be most profitable. Applied to the classification neural network, this would lead to the following architecture. Note that in this case we even allow no category bets.
We end up stacking on multiple labels (not to be confused with the multi-class classification), because the outcome of the game can lead to one or two predictions being correct. For example, a win for the home team will result in two winning bets: "Win Home" as well as "Win Home or Draw".
Read more: The legality of betting sites in India