Giter Site home page Giter Site logo

lbj_make_or_miss's Introduction

A Classification Decision Tree for Lebron James's Shots

This repo started off as a project for UBC DSCI 522-- a course focusing on collaborative data science workflows and best practices.

Also, the original analysis was completed while we were beginning to learn ML basics. Here's my latest take on this project where I use Random Forests, XGBoost, Logistic Regression and more.

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 + 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.✨

πŸ‘‘

lbj_make_or_miss's People

Contributors

jessimk avatar ehhope avatar

Watchers

James Cloos avatar

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.