The past 10 days or so, I participated in a data competition on Kaggle. The challenge was trying to predict how likely Kobe Bryant was to score 5000 shots, given a training set of a little over 25,000. While I was messing around with selecting features for my models, I became side-tracked with understanding how the last few seconds of a basketball quarter is different than the rest of the game and what that means for a shooter like Kobe. I thought I’d share a few visualizations from this process.
To start, the last seconds of a close basketball game can be breathtaking and the stuff of legends. Even casual fans like me know about Jordan last shot where he broke Bryon Russel’s ankles to clinch the 1998 title.
And at least anecdotally speaking, the last seconds of an NBA game seem to operate differently. For example, the flow of the game changes, as trailing teams look for quick possessions to chip away at leads and teams ahead look to manage the clock. Occasionally the final seconds produce odds-defying shots from the back court in heavy pressure that find the net to the cheers or gasps of the crowd. And with all this myth-making and hype around the final seconds there is the idea that some players perform better under this pressure than others. Some players are considered clutch and winners like Jordan, others are considered “absent from the big moments”.
So this is a post to visualize some of the ways the final seconds are different for Kobe Bryant. I am limited in my understanding of the NBA, my knowledge of advanced basketball stats, and by the Kobe Bryant specific data set the Kaggle competition happened to provide for me, so in no way will this offer hard answers to finer questions about the game of professional basketball. But what I hope to do at least, is document the ways Kobe changes his behaviour with the clock counting down and to see if there is any unexplained greatness or weakness in Kobe’s game.
This next graph I made is what motivated me to look into this closer.
Shots are binned in groups of 5 seconds. The larger the bubble, the more shots were taken in the bin. The more opaque the colour the farther away those shots were taken on average. Red represents the last 5 seconds of the quarter.
What we can see is that shots in the last 5 seconds are huge outliers. Kobe Bryant in our sample made 44.6% of the shots he took, but in the last 5 seconds of the quarter this drops to just 25.4%. Additionally, we can see from the large bubble, Kobe is much more likely to throw up a shot in the last 5 seconds than any other 5 second interval.
To establish a bit of context, the first thing I looked at was how do different shots vary in accuracy with distance. In the data set there are six basic types of shots: Bank Shots, Dunk, Hook Shot, Jump shot, Layup, and Tip Shot.
Interactive Version of Graph 2
A few things to note from the graph. Different shots have different probabilities of going in. Dunks go in more than 90% of the time, hook shots on the other hand are pretty hit or miss. The next is that the only type of shot that has an obvious trend in distance is jump shots, which makes sense. Jump shots should get progressively more difficult as you get farther from the basket. That is probably true for layups and dunks as well, but past a certain distance we don’t see any dunk or layup attempts for obvious reasons. So as distance changes, so does shot selection. Outside of the paint, Kobe’s only reliable option is the jumpshot. And as distances gets larger, Kobe becomes a less and less reliable marksman. At around 45 feet out, the Black Mamba’s stats could be easily confused for my high school stats, zeros all around.
What I want to understand is how much of Kobe’s performance in the last 5 seconds can be attributed to the simple fact that he is likely to be shooting from farther away. Or are there factors unaccounted for like psychological pressure, or increased defensive coverage that are the culprits behind Kobe’s lackluster final moment performance?
One way to get a sense of this is to ignore shot selection for the moment and look at just Kobe’s Jump Shots to see if there is an unexplained drop in performance, and compare apples to apples so to speak. If the only driving factor behind lower shooting percentages was simply a change in shot selection (i.e Kobe hits his shots just like normal except he is forced to take lower percentages shots like jump shots instead of dunks), we should still see Kobe hit jumpers at his normal rate. If not, there may be other factors at play.
Interactive Version of Graph 3
So what we see is that even comparing jump shots to jump shots, Kobe is much less likely to score in the last five seconds, 21.2%, versus his normal clip of 39% during the rest of the game. Again, he also shoots many more shots in the last 5 seconds than a typical 5 second interval during the game as represented by the larger bubble.
A typical Kobe shot is taken in the 12-15 ft. range, with 13.44 ft. being the average and 15 ft. his median shot in the sample. In the last 5 seconds, these shots are taken from over 20 ft. on average. A typical jumper for Kobe is in the 17-19 ft. range, with an averate of 17.37 and a median of 18 ft. In final 5 seconds, Kobe’s averages jump shots from over 24 ft.
Let’s visualize the difference.
Interactive Version of Graph 4
Only Jumpshots are included in the graph
Here we divide all of the jump shots up into categories of roughly how far away the shots were (Less than 8 ft., 8-16 ft., 16-24 ft., 24 ft. +, and back court shot), keeping the x-axis the same and colouring the last 5 seconds in red again.
Comparing the shots in each range to each other directly, the difference between the last 5 seconds and other intervals is not so large. Take the 8-16 ft. range in the above graph. When we compare how Kobe did in the last 5 seconds for shots between 8-16 ft. in the last 5 seconds to shots between 8-16 ft. in the rest of the game, it is no longer a huge outlier. It is definitely near the lower end of the expected shooting percentage range, but comparing the red dot in this panel to graph 3 above it looks more like a typical 5 second interval. This is similarly true for shots take from less than 8 ft. (Panel 1 in graph 4), shots from 16-24 ft.(Panel 3 in graph 4), and to a lesser extent 24 + ft (Panel 4 in graph 4).
Another thing that we notice in graph 4 is that many more shots were taken from 24ft. + or the back court than in the rest of the game, as seen by how the red dots are much larger in panel 4 and 5 than the black dots in the same panels. So the story that is starting to emerge is not so much that Kobe is somehow 20% worse at shooting during the last 5 seconds, but from graph 4 he seems to shoot a bit below average, but his shots are from worse distances than we typically observe during the rest of the game.
Diving deeper, I found that even within these distance ranges (each represented by a panel in graph 4), that shots in the last 5 seconds were likely to be farther away. For example, the average 24ft. + shot (panel 4, graph 4) is taken from pretty close to 24ft., but in the last 5 seconds they are taken from around 27 ft..
Even though we haven’t used any fancy regression or machine learning techniques to this point, we can reasonably believe that distance is one of the main reasons that shots in the last 5 seconds are much less likely to go in. When we compare similar shot selection at similar distances, shots in the last 5 seconds tend to look much more like typical 5 second bins in our dataset.
Let’s visualize all of the jump shots he has taken to get a better sense in how they are different in the last 5 seconds than in the rest of gameplay.
Interactive Version of Graph 5
Visualation of all jump shots taken. Last 5 seconds on the right, all other jumpers on the right. Red means the basket was scored, black represents a miss.
What we see in graph 5 is that the vast majority of the shots are taken from inside the 3 point arc, and those outside the line are almost all within a couple feet of it. On the right part of the graph, the shots are much more erratic, many of which occur outside the 3 point line and on average they are far from the line. The story we see here is a Kobe that is desperately fighting the clock and throwing up whatever shots he can to hopefully score another bucket and push his team over the edge.
I used a simple logistic regression to test some of the ideas we developed with the visualizations. Once I control for distance (modeled as a 3rd degree polynomial), area on the court (as in right-side, left-side, back-court, etc), and shot selection, there is only roughly a 1.4% shooting percentage gap left to account for in the last 5 seconds of the quarter. So Kobe doesn’t shoot 20% worse in the last 5 seconds in the quarter, he mostly just shoots from crappier positions on the floor. According to this logistic model, he is also significantly less likely to take dunks and layups like we suggested earlier, and much more likely to take jump shots from beyond the 3 point arc.
And this is without factoring in any sort of defensive pressure that may be put on Kobe at the end of a quarter, which is information that I do not have included in my dataset. What this suggests to me at least is that it is unlikely that the pressure of performing in the big moment is driving Kobe’s performance at the end of quarters. However, this still doesn’t tell us what Kobe’s value is in pressure moments, because his true value would be above replacement or above expectation. Should Kobe be trusted with the last shot? Does he do enough to get into good scoring position with the game on the line?
I have no idea…
The data set that I have and any models that I developed for this project are not sophisticated enough to tell us how Kobe does compared to giving the final shot to someone else, or whether or not we should have expected Kobe to get himself into better scoring position as the clock ticked down the final seconds, only that from where he was shooting he shot 1.4% worse than he did in the rest of the game.