Skip to content

This project builds a machine learning pipeline to identify mispriced NBA player prop lines by comparing public betting lines with independent player performance projections. The goal is to highlight high-confidence over/under picks using real historical performance data, engineered features, and predictive modeling.

Notifications You must be signed in to change notification settings

kpundhir/Prop-Model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBA Prop Betting Value Model

This project builds a machine learning pipeline to identify mispriced NBA player prop lines by comparing public betting lines with independent player performance projections. The goal is to highlight high-confidence over/under picks using real historical performance data, engineered features, and predictive modeling.


Key Features

  • Web scraping from BettingPros NBA Underdog Props for current lines and projections
  • Game log collection using nba_api across multiple seasons
  • Feature engineering on player stats (rolling averages, usage rates, home/away splits)
  • Modeling using RandomForestClassifier and LogisticRegression with 5-fold stratified CV
  • SHAP explainability to surface key features behind predictions
  • Output: Top 3 value props for the day with probabilities and suggested over/under direction

Folder Structure

nba-prop-model/
├── main.py # Entry point script
├── top3_model_predictions.csv # Output file with daily best picks
├── requirements.txt # Python dependencies
└── README.md

Usage

1. Install Dependencies

pip install -r requirements.txt

2. Run the pipeline

python main.py

This will:

  1. Scrape props from BettingPros
  2. Pull historical player game logs (via nba_api)
  3. Engineer features and label outcomes
  4. Train and cross-validate a Random Forest model
  5. Score and output top 3 model-predicted props

3. View Output

top3_model_predictions.csv 
Player Stat Type Line Proj RF_Prob Prediction
J. Embiid Points 25.5 28.3 0.78 Over
S. Curry PRA 38.5 41.9 0.74 Over
D. Booker Rebounds 5.5 4.2 0.25 Under

Model Performance

Classifier: RandomForestClassifier (n=250) with 5-fold stratified CV

Test Accuracy: ~60%+

Log Loss: Reported on console

Feature importance: Visualized via SHAP bar plot for transparency

Dependencies

  • undetected_chromedriver
  • beautifulsoup4
  • nba_api
  • sklearn, shap
  • pandas, numpy, matplotlib

Acknowledgements

  • BettingPros.com for daily prop lines
  • FantasyPros for player projections
  • nba_api for historical player data

License

This project is licensed under the CC BY-NC-ND 4.0 license.
You may view, use, and share this for educational and research purposes only.
Commercial use and redistribution are strictly prohibited.

About

This project builds a machine learning pipeline to identify mispriced NBA player prop lines by comparing public betting lines with independent player performance projections. The goal is to highlight high-confidence over/under picks using real historical performance data, engineered features, and predictive modeling.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published