NBA Hackathon

nbaHackathon Preview Tile


About the Project

I was one of 200 students out of 1000+ applicants to participate in the NBA’s first annual hackathon. Over an entire day of coding, myself and two teammates developed a new metric to quantify how well NBA players are able to defend shots.

Our metric was well received – particularly to do the cohesive presentation of the information (scope of the work, usefulness, and use of data visualization) and lead to a top 5 finish in the hackathon

Personal Impact

In my team of 3 I had the most technical experience, consequently handled the majority of the analysis (via R) and the data visualization (R/ggplot2) while my teammates focused on the presentation and quick data analysis (via Excel).

Tools Used

ggplot2     R

Project Overview


Our team developed a new defensive metric – contest quality, to gauge how well NBA players were at contesting shots, independent of the defensive sequence before that.


We chose to tackle the following prompt:

Develop a new method or tool for evaluation of defensive performance in the NBA.

Currently, there are robust ways to detect shot quality, such as the Quantified Shot Metric (qSI) developed by ESPN. The idea behind qSI is that value of a given shot can be determined by shot distance and the distance of defender(s) to the shooter.

The metric we developed, Contest Quality, looks at how well players are contesting shots independent of shot quality.


A shot 15 ft away from the basket with a defender 2 ft away from has an expected Pts/FGA of 0.74 (eFG% = 0.37). The eFG% under different circumstances is defined by the heatmap below:



Shooters under those aforemtnioned conditions, defended by Kevin Durant have an Exp. Pts/FGA of 0.68, creating an expected points difference of -0.06. By taking that expected points difference for every shot a player defended over the past two seasons (14/15 & 15/16), averaging that amount of shots they defended.

Shots Durant defended the past 2 seasons had an expected 1.000 Pts/FGA, but in reality Durant only allowed  0.839 points.


To better visualize how players performed their charts have been stratified by role (guard, wing, & big).


A player’s presence in quadrants II & III indicates they’re forcing low percentage looks.  Their presence in quadrants I & IV indicates they’re contesting shots well. Redick stands out as a player that both forces poor shots and contests those shots well. Contrast that with Conley, who does an excellent job in forcing lower percentage looks, but does not to a great job of contesting them.

This doesn’t necessarily mean that Conley is a poor defender, but that he might be doing a poor job of contesting shots, despite doing everything else well.


Durant is an enormous outlier. While he isn’t doing the best job of forcing bad shots, his ability to contest turns would-be good shots into bad ones. Jabari Parker is the worst of both worlds – allows good looks, and does a poor job of contesting them after the fact.


The big men pass the eye test as well. Draymond ranks as one of the best at contesting shots, while someone like Randolph scores poorly.


Players with longer wingpspans (e.g. Durant, ABC, ABC), seem particularly contest shots well.


While the above chart suggests there is a correlation between anthropomorphic data (wingspan, height, standing reach) and contest quality, breaking out the data into player roles (guard, wing, big), the correlation is more dubious.



This doesn’t seem to indicate that the anthropomorphic stats have any large impact on contest quality. It’s difficult to say what that means for the idea that players with longer wingspans are better at contesting shots, and is certainly a topic worth exploring further.


Leave a Reply

Your email address will not be published. Required fields are marked *