An Equation to Predict NBA Playoff Probabilities

Based on a previous paper I wrote that used machine learning to determine the most relevant factors for teams making the NBA playoffs, I did some further analysis in an attempt to come up with an equation that outputs the probability of an NBA team making the playoffs in a given season.

From the aforementioned paper, one concludes that the two most important factors in determining whether a team makes the playoffs or not is its opponent assists per game and opponent two-point shots made per game. Based on that, I came up with the following equation:

\boxed{P(playoffs) = 0.49 \left[ \frac{1}{1 + \exp\left(-7.6683 +0.2489 o2P   \right)   }   \right] + 0.51 \left[ \frac{1}{1 + \exp\left(-9.1835 +0.4211 oAST   \right)   }   \right]}

A plot of this equation is as follows:

probplot1

A contour plot is perhaps more illuminating:

contourprobplot1

One can see from this contour plot that teams have the highest probabilities of making the playoffs when their opponent 2-point shots and opponent assists are both around 20. In general, we also see that while a team can allow more opponent 2-point shots, having a low number of opponent assists per game is evidently the most important factor.

 

Using this equation, I was able to classify 71% of playoff teams correctly from the last 16 years of NBA data. Even though the playoff classifier developed in the paper mentioned above is more accurate in general, those methods are non-parametric, so, it is difficult to obtain an equation. To get an equation as we have done here, can be extremely useful for modelling purposes and understanding the nature of probabilities in deciding whether a certain team will make the playoffs in a given season. (Also: note that we are using the convention of using 0.50 as the threshold probability, so a probability output of >0.5, is classified as a team making the playoffs.)

Advertisements

When is it optimal to shoot a 3-Point Shot

A very interesting result: computing payoffs of players, the following is a diagram that shows when it is optimal for a player to shoot a 2 point or a 3-point shot. One sees that it is hardly ever optimal for a player to shoot a 3-point shot, since the region corresponding to 3-point optimality is quite narrow. This can be interpreted as saying that for a 3-point attempt to be optimal, a player’s 2PT% must be roughly equal to his/her 3PT%, which is certainly not the case for the vast majority of even designated 3-point shooters in the NBA!

updatedpic32point
The grey region is where shooting a 3-point shot is optimal, the blue region is where shooting a 2-point shot is optimal, and the red line that separates these boundaries is where the payoff is equivalent in both approaches.

Lectures on Nonlinear Dynamical Systems 

Here is a link to my lectures on nonlinear dynamical systems given at York University during the Winter semester of 2017. 

These lectures start off with manifold theory, and end with examples in biology, game theory, and general relativity/cosmology. 

What if Michael Jordan Played in Today’s NBA?

By: Dr. Ikjyot Singh Kohli

It seems that one cannot turn on ESPN or any YouTube channel nowadays without the ongoing debate of whether Michael Jordan is better than Lebron, what would happen if Michael Jordan played in today’s NBA, etc… However, I have not seen a single scientific approach to this question. Albeit, it is sort of an impossible question to answer, but, using data science I will try.

From a data science perspective, it only makes sense to look at Michael Jordan’s performance in a single season, and try to predict based on that season how he would perform in the most recent NBA season. That being said, let’s look at Michael Jordan’s game-to-game performance in the 1995-1996 NBA season when the Bulls went 72-10.

Using neural networks and Garson’s algorithm , to regress against Michael Jordan’s per game point total, we note the following:

jordanpoints
In this plot, the “o” stands for opponent.

 

One can see from this variable importance plot, Michael’s points in a given game were most positively associated with teams that committed a high number of turnovers followed by teams that make a lot of 3-point shots. Interestingly, there was not a strong negative factor on Michael’s points in a given game.

Given this information, and the per-game league averages of the 2017 season, we used this neural network to make a prediction on how many points Michael would average in today’s season:

Michael Jordan: 2017 NBA Season Prediction: 32.91 Points / Game (+/- 6.9)

It is interesting to note that Michael averaged 30.4 Points/Game in the 1995-1996 NBA Season. We therefore conclude that the 1995-1996 Michael would average a higher points/game if he played in today’s NBA.

As an aside, a plot of the neural network used to generate these variable importance plots and predictions is as follows:

jordannnet

What about the reverse question? What if the 2016-2017 Lebron James played in the 1995-1996 NBA? What would happen to his per-game point average? Using the same methodology as above, we used neural networks in combination with Garson’s algorithm to obtain a variable importance plot for Lebron James’ per-game point totals:

lebronplot

 

One sees from this plot that Lebron’s points every game were most positively impacted by teams that predominantly committed personal fouls, followed by teams that got a lot of offensive rebounds. There were no predominantly strong negative factors that affected Lebron’s ability to score.

Using this neural network model, we then tried to make a prediction on how many points per game Lebron would score if he played in the 1995-1996 NBA Season:

Lebron James: 1995-1996 NBA Season Prediction: 18.81 Points / Game (+/- 4.796)

This neural network model predicts that Lebron James would average 18.81 Points/Game if he played in the 1995-1996 NBA season, which is a drop from the 26.4 Points/Game he averaged this most recent NBA season.

Therefore, at least from this neural network model, one concludes that Lebron’s per game points would decrease if he played in the 1995-1996 Season, while Michael’s number would increase slightly if he played in the 2016-2017 Season.

How to Beat the Golden State Warriors

By: Dr. Ikjyot Singh Kohli

The Golden State Warriors have posed quite the conundrum for opposing teams. They are quick, have a spectacular ability to move the ball, and play suffocating defense. Given their play in the playoffs thus far, all of these points have been exemplified even more to the point where it seems that they are unbeatable.

I wanted to take somewhat of a simplified approach and see if opposing teams are missing something. That is, is their some weakness in their play that opposing teams can exploit, a “weakness in Helm’s deep”?

original
“Helm’s Deep has but one weakness”– (Sorry, couldn’t resist!)
The most obvious place to start from a data science point-of-view seemed to me to look at every single shot the Warriors took as a team this season in each game and compile a grand ensemble shot chart. Using the data from Basketball-reference.com and some data scraping scripts I wrote in R, I obtained the following:

GSWshotchart
Red circles denote missed shots, black circles denote made shots. Note that in this diagram and what follows, we have defined coordinates such that the origin of the x-y plane here denotes the far left and far bottom of an NBA court such that the basket itself is approximately at (x,y) = (25,0).
Certainly, on the surface, it seems that there is no discernible pattern between made shots and missed shots. This is where the machine learning comes in!

From here, I now extracted the x and y coordinates of each shot and recorded a response variable of “made” or “missed” in a table, such that the coordinates were now predictor variables and the shot classification (made/missed) was the response variable. Altogether, we had 7104 observations. Splitting this dataset up into a 70% training dataset and a 30% test data set, I tried the following algorithms, recording the % of correctly classified observations:

Algorithm % of Correctly Predicted Observations
Logistic Regression

56.43

Gradient Boosted Decision Trees

62.62

Random Forests

58.54

Neural Networks with Entropy Fitting

62.47

Naive Bayes Classification with Kernel Density Estimation

57.32

One sees that that gradient boosted decision trees had the best performance correctly classifying 62.62% of the test observations. Given how noisy the data is, this is not bad, and much better than expected. I should also mention that these numbers were obtained after tuning these models using cross-validation for optimal parameters.

Using the gradient boosted decision tree model, we made a set of predictions for a vast number of (x,y)-coordinates for basketball court. We obtained the following contour plot:

contouroneGSW

Overlaying this on top of the basketball court diagram, we got:

contourtwoGSW

The contour plot levels denote the probabilities that the GSW will make a shot from a given (x,y) location on the court. As a sanity check, the lowest probabilities seem to be close to the 1/2-court line and beyond the three-point line. The highest probabilities are surprisingly along very specific areas on the court: very close the basket, the line from the basket to the left corner, extending up slightly, and a very narrow line extending from the basket to the right corner. Interestingly, the probabilities are low on the right side of the basket, specifically:

contourtwoGSW

A map showing the probabilities more explicitly is as follows (although, upon uploading it, I realized it is a bit harder to read, I will re-upload a clearer version soon!)
contourgsw3

In conclusion, it seems that, at least according to a first look at the data, the Warriors do indeed have several “weak spots” in their offense that opponents should certainly look to exploit by designing defensive schemes that force them to take shots in the aforementioned low-probability zones. As for future improvements, I think it would be interesting to add as predictor variables things like geographic location, crowd sizes, team opponent strengths, etc… I will look into making these improvements in the near future.

Dynamical Systems in Cosmology Lectures

In the final two lectures of my differential equations class , I discussed how Dynamical Systems theory can be used to understand and describe the dynamics of cosmological solutions to Einstein’s field equations. Videos and lecture notes posted below:

Lecture Notes: