Skip to content
Find basketball players with similar shot charts
Python HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
analysis
data
scraper
shotchart
static
templates
tests
.gitignore
.travis.yml
Procfile
README.md
app.py
requirements.txt
runtime.txt

README.md

Similar-Shooter

CI Coverage Status

Find basketball players with similar shot charts

Examples

A live version of this flask app can be seen at: https://similar-shooter.herokuapp.com/. Note, I am not paying anything to host this, so it could take forever to run...

Here are some static examples, though.

Who is most similar to DeAndre Jordan? Top shot-chart match: Rody Gobert Jordan Gobert

Who is most similar to Buddy Hield? Top shot-chart match: Tim Hardaway Hield Hardaway

How does it work?

I played around with a lot of different algorithms to define what makes shot charts similar. It's an interesting question: what does it mean for two shot charts to be similar?

I made the following assumptions:

  • If two shot charts are the exact same, but with different densities, they are still very similar. Players with different usage rates shouldn't be penalized as being different.
  • The most important features are distance from the hoop, and 2PT vs 3PT shots. I largely disregard things like which side of the court players shoot from.

Using these assumptions, I compare the Kullback-Leibler divergence of each players shot distributions. Players with low KL divergence have high similarity.

What data are used?

Shot data and shot charts are scrapped seperately (design flaw). These data were scraped March 7 2017, so they contain data from the 2017 season up until this data.

To get up-to-date data, rerun scraper/scraper.py and shotchart/shotchart.py.

To get historic data, change global parameter YEAR before scraping.

You can’t perform that action at this time.