We continue to look into various NBA statistics. This time, we'll be examining NBA team over unders. An over-under is a prediction by sportsbooks about how many points a team could score in a game. For example, the line could be Warriors over-under 115.5, which means you can either bet on the warriors scoring over 115 points or under 115 points. You can see my full model in my github repository here.
The goal of this project is to create a program that, given a team name and a line, will be able to return a probability of whether or not that team goes over or under that line. To do this, I used the same dataset I used in my last blog post, which contains every NBA game's statistics. I decided to only use the scores from the regular 2024-25 season.
The simplest way to do this is to just average the points scored by a team that season. However, this is not very accurate, as it doesn't take into account many factors and recent lineup changes. The quickest change that I made which improved things alot already was specifying home games versus away games. Simply creating two averages for each team, one for home games and one for away games, improved the accuracy of the model by a lot.
However, I wanted to improve the model even more. I did this by using a weighted average. Each game was given a weight, which would decay exponentially as the game became further away. For example, the most recent game would be given a weight of 0.9, the second most recent would be given a weight of 0.9^2, and so on. This way, more recent games would have a larger impact on the average, which helps account for things like lineup changes and general trends.
To test for the best decay value, I used the log loss algorithm. Log loss is the measure of how well a model is able to predict the probability of an event. You can read up about it here. Essentially, I ran the simulation on the entire 24-25 season, using different decay values from 0 to 1, and calculated the log loss for each decay value. Depending on the over under line, this decay value would change slightly, but it was mainly > 0.95.
One of analyzing this over other things in NBA sports betting is that it's more niche. Moneylines, which we covered through the ELO method in the last blog post, are much more common, meaning that the sportsbook odds are extremely sharp and difficult to bet on. It's much easier to find an edge on things that less people bet on.
Overall, this was a very interesting project. I'm sure my model could use a lot of improvement, as its very rudimentary right now and still doesn't account for many factors. However, it's a good starting point and shows that even with simple methods, we can create a model that is able to predict NBA team over-unders with some accuracy.