All Projects

NBA Predictions

A Monte Carlo ensemble model with meta-learner calibration for predicting NBA game outcomes. Combines team efficiency stats, player performance data, and pace metrics through a multi-stage ML pipeline.

Overview

NBA Predictions is a machine learning system built to forecast NBA game outcomes with calibrated probability estimates. The pipeline ingests live game data, runs feature engineering across multiple stat categories, and produces win probability scores via a stacked ensemble of base learners and a meta-model.

The project was built iteratively โ€” starting with a simple logistic regression baseline, then expanding into a full ensemble architecture with temperature scaling for calibration. The meta-learner layer sits on top of the base model outputs and learns to correct systematic over/under-confidence in the probability estimates.

Architecture

  • Data ingestion layer pulls from NBA stats API with caching
  • Feature engineering: team offensive/defensive efficiency, pace, home-court, rest days, recent form
  • Base learner ensemble: gradient boosted trees, random forest, logistic regression
  • Meta-learner stacks base model logits for final prediction
  • Temperature scaling calibration module reduces Expected Calibration Error
  • Monte Carlo simulation runs N game scenarios to produce distribution over outcomes
  • Evaluation pipeline with ECE, Brier score, and accuracy metrics per model stage

Calibration

One of the core challenges in probabilistic sports prediction is model overconfidence โ€” a model might say 85% but win only 70% of those games. The calibration module uses temperature scaling (a single learned parameter) to rescale the raw logits before softmax, reducing ECE without degrading accuracy.

The meta-learner includes a forward_logits method that returns pre-softmax activations specifically to support the temperature scaling step in the calibration pipeline.

Tech Stack

Python PyTorch scikit-learn pandas NumPy

Status

Active development. Calibration pipeline complete and verified. Edge detection phase in progress.