Skip to content

An analysis of Lebron James' Shots from 2014-2015

Notifications You must be signed in to change notification settings

ehhope/LBJ-for-T-h-ree

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Classification Tree for Lebron James's Shots

Authors

Objective

  • Create a decision tree model for Lebron James's shots. Use our model to find the three strongest predictors for determining whether Lebron makes or misses a shot.

Results

  • Using a decistion tree model our findings suggest (1) Shot Distance, (2) Shot Clock and (3) Touch Time were the strongest predictors in dictating whether Lebron James would make a shot or not.

Dependencies

  • R:

    • tidyverse v1.2.1
  • Python:

    • argparse v1.1
    • pandas v0.20.3
    • matplotlib v3.0.1
    • numpy v1.15.4
    • scikit-learn v0.20.1

Usage

Without Docker +git a Without Make

  1. Clone this repo.
  2. Run these commands:

Rscript src/01_loading_wrangling.R "lebron james"

data/shot_logs_raw.csv data/tidy_data_lebron_james.csv

python src/02_EDA.py data/tidy_data_lebron_james.csv results/figs/EDA "lebron james"

python src/03_machine_learning.py data/tidy_data_lebron_james.csv data/accuracies_lebron_james.csv data/features_lebron_james.csv

python src/04_analysis_plots_script.py data/accuracies_lebron_james.csv data/features_lebron_james.csv results/figs/train-test-acc_lebron_james.png results/figs/best_features_lebron_james.png

Rscript -e "rmarkdown::render('docs/Report.Rmd')"

With Make

  1. With Make installed (install guides can be found here), clone this repo.

  2. Run:

    make all

With Docker

  1. Clone this repo and navigate to the repo's root.

  2. Run the analysis within a docker container with the following code in command line:

     docker run --rm -it -v PATH_ON_YOUR_COMPUTER:/home/swish jessimk/dsci-522-jes-alex bash -c 'cd /home/swish; make'
    
  3. To clean the analysis, use the following code in command line:

     docker run --rm -it -v PATH_ON_YOUR_COMPUTER:/home/swish jessimk/dsci-522-jes-alex bash -c 'cd /home/swish; make clean'
    

🏀 🏀 🏀

What you'll find in this repo:

  • Figures from our Analysis

✨Future Dev Note: We plan to update our scripts so that they are flexible and robust enough to be able to run our analysis for any player in the data set. Stay tuned.✨

👑

About

An analysis of Lebron James' Shots from 2014-2015

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 49.4%
  • Makefile 22.4%
  • Jupyter Notebook 16.1%
  • R 8.5%
  • Dockerfile 3.6%