Code Monkey home page Code Monkey logo

nba-expected-bucket's Introduction

nba-expected-bucket

Predicting the outcome of shots based on the events and tracking data available for the 2015/16 season.

Quick links:

Data

The repo combines events data and tracking data from the 2015/16 season.

Data Source:

Features used in the model

Categorical Features

SHOT_TYPE SHOT_ZONE_BASIC SHOT_ZONE_AREA SHOT_ZONE_RANGE ACTION_TYPE_SIMPLIFIED
2PT Mid-Range Right Side Center(RC) 16-24 ft. Layup
3 PT Above the Break 3 Right Side(R) 24+ ft. Dunk
Restricted Area Center(C) 8-16 ft. Hook Shot
In The Paint (Non-RA) Left Side(L) Less Than 8 ft. Jump Shot
Left Corner 3 Left Side Center(LC)
Right Corner 3

Numerical Features

AVERAGE_DEFENDER_DISTANCE SHOOTER_DEFENDER_DISTANCE OFFENSE_SPACING DEFENSE_SPACING SHOT_CLOCK

Calculating Spacing

I used convex hull technique to calculate the OFFENSE_SPACING and DEFENSE_SPACING. This is explained much better here: http://projects.rajivshah.com/sportvu/Chull_NBA_SportVu.html

AVERAGE_DEFENDER_DISTANCE and SHOOTER_DEFENDER_DISTANCE are calculated using the distance formula.

Where do teams take their shots from?

Hex bin of shots

Does better spacing result in higher shooting percentage?

From the charts below we can infer that, although that is not the case always, we do see that among the teams with shooting percentage higher than the league average, the spacing also is better and vice versa

average defense spacing vs field goal percentage average offense spacing vs field goal percentage

average defense spacing vs two point percentage average offense spacing vs two point percentage

average defense spacing vs three point percentage average offense spacing vs three point percentage

Shooting % based on zones?

Shooting percentage based on zones

Points per shot based on zones?

Points per shot based on zones

Performance of ML Models

Decision Tree

images/Decision tree shooting percentage based on zones

images/Decision tree points per shot based on zones

Random Forest

images/Random Forest shooting percentage based on zones

images/Random Forest points per shot based on zones

LICENCE

MIT

nba-expected-bucket's People

Contributors

aviskarkc10 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

hbbruce305

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.