christopherjenness / Similar-Shooter

Find basketball players with similar shot charts

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Find basketball players with similar shot charts


Languages

Language:Python 83.4%Language:HTML 15.9%Language:CSS 0.7%