Jon2Anderson / NBA_Prediction_Modeling

NBA player prediction model for use in daily fantasy sports
12 stars 5 forks source link

NBA Prediction Model Read Me

This pair of scripts is intended to predict each NBA player's fantasy point total for that day's game for the purpose of building successful lineups in NBA daily fantasy sports.

DFS is a form of fantasy sports where each contest lasts just one day. You are given a certain amount of money to build a lineup with, and then you assemble an eight player team while staying under the salary cap. The player salaries are set by the hosting website every day.

This purpose of these scripts is to bring in a bunch of data to learn from in order to build a prediction model that gives a salary based projection for every available player.

First thing to run every day is the boxScoreScrape.py script, which scrapes basketball-reference.com for every box score of each game played in the previous day. This is the core data that our models rely on. It saves off every individual player box score and every team box score, generating a ton of data.

The getDailyData.py script does the following:

After that we have everything we need to build and run the model for that day's projections. The runModel.py script does this.

All three scripts and an example of the final product (the .xlsx file) are on this Github repository.