This is a project where I calculate the minute-by-minute probabilities of a team winning an NBA game given how many points they are down and how many minutes are left in the game. Read more about the project on my blog post or view the Shiny app.
main.R
- This is the main script that calls a series of functions to perform various steps in data cleaning and analysis.download_data.R
- wrapper for Python functionsdownload_data.py
- functions to download data using thenba_api
Python package
clean_data.R
- clean play-by-play datasmooth_data.R
- calculate smoothed probabilitiesmodel_data.R
- calculate binomial probabilitiesplot_data.R
- plot heatmaps
app/app.R
- Shiny app