GitHunt
MI

mikss/coldmaps

NBA Cold Maps

For details: See the iPython notebook nba_scrape.ipynb.


NBA Cold Maps

NBA shot charts are a popular way of visualizing shooting efficiency across different parts of the basketball court. Some examples include:

One quirk of these charts is that "misses" are all treated alike; that is, a missed layup is viewed as the same as a missed three. But there is reason to believe this perspective is inappropriate! That is, perhaps a bricked three can lead to a fast break, whereas a missed layup can lead to a offensive putback.

To answer this question with data, I decided to produce cold maps, which visualize the next-possession value from each part of the floor. That is, for each shot location, I compute the expected point outcome of the subsequent possession conditional on a missed shot (where a positive value represents a point for the shooting/missing team, and a negative value represents a point for the opposing/defending team).

png

In the above figure, cooler colors represent "safer" shots (i.e., less punishing next-possession value), whereas warmer colors represent "more dangerous" shots (i.e., more negative next-possession value). The size of each cell represents the volume of misses from each court location.

Other info

The relevant files are:

gather.py
draw.py

Prerequisite packages include:

matplotlib
numpy
pandas
requests

For any questions, bug reports, etc., contact Steven S. Kim via e-mail at steven_kim@brown.edu.

Languages

Jupyter Notebook73.2%Python26.8%
Created July 7, 2016
Updated July 7, 2016
mikss/coldmaps | GitHunt