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.
- 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
andLogisticRegression
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
nba-prop-model/
├── main.py # Entry point script
├── top3_model_predictions.csv # Output file with daily best picks
├── requirements.txt # Python dependencies
└── README.md
pip install -r requirements.txt
python main.py
This will:
- Scrape props from BettingPros
- Pull historical player game logs (via nba_api)
- Engineer features and label outcomes
- Train and cross-validate a Random Forest model
- Score and output top 3 model-predicted props
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 |
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
- undetected_chromedriver
- beautifulsoup4
- nba_api
- sklearn, shap
- pandas, numpy, matplotlib
- BettingPros.com for daily prop lines
- FantasyPros for player projections
- nba_api for historical player data
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.