2026LocalSolo data and ML engineer
NBA Stats Pipeline
An XGBoost-based NBA margin predictor with quarter-level models, betting odds integration, and a planned FastAPI + React interface.
PythonXGBoostpandasFastAPI (planned)React (planned)
Local project, not public yet
Overview
A data and modeling pipeline for NBA game outcomes. Ingests games, players, coaches, per-quarter stats, and sportsbook odds. Trains an XGBRegressor on roughly 169 features to predict home-team margin, then calibrates a sigmoid over it for win probability. Quarter-level models (Q1 through Q4) run alongside the full-game model. A bet-result table and HTML viewer let me compare predicted vs actual outcomes. The FastAPI backend and React frontend are designed but not yet wired; right now it runs from scripts.
Highlights
- 169-feature XGBRegressor predicting home-team margin per game.
- Quarter-level sub-models (Q1, Q2, Q3, Q4) trained separately alongside the full-game model.
- Calibrated sigmoid converting predicted margin into a win probability.
- Odds integration (bet365, 1xBet, Betfair Exchange) plus a bet-results table for backtesting.
Challenges and approach
- Feature engineering across games, players, coaches, and per-quarter stats required a strict ingestion schema so new seasons could be added without rewriting downstream models.
- Calibration: raw margin predictions are not probabilities. Fitting a sigmoid over a held-out set produced calibrated win probabilities that actually compared to implied odds.