πŸ€ NBA Game Predictor (XGBoost)

A machine learning model for predicting NBA game outcomes and identifying value bets by comparing model predictions to betting market odds.

Model Description

This model uses an XGBoost classifier trained on historical NBA game data to predict home team win probability. It's designed for value bet detection β€” comparing model probabilities to sportsbook implied odds to find +EV (positive expected value) betting opportunities.

Performance

Metric Value
Test Accuracy 57.4%
Cross-Val Accuracy 60.5% (Β±1.5%)

Features

The model uses 11 engineered features:

  • home_win_pct / away_win_pct β€” Win percentages
  • home_ppg / away_ppg β€” Points per game
  • home_opp_ppg / away_opp_ppg β€” Opponent points per game
  • home_point_diff / away_point_diff β€” Average point differential
  • win_pct_diff β€” Win percentage difference
  • point_diff_diff β€” Point differential difference
  • home_advantage β€” Home court advantage factor

Usage

import joblib
import pandas as pd

# Load model
model = joblib.load('model.pkl')

# Prepare features
features = pd.DataFrame([{
    'home_win_pct': 0.65,
    'away_win_pct': 0.45,
    'home_ppg': 115.0,
    'away_ppg': 110.0,
    'home_opp_ppg': 108.0,
    'away_opp_ppg': 113.0,
    'home_point_diff': 7.0,
    'away_point_diff': -3.0,
    'win_pct_diff': 0.20,
    'point_diff_diff': 10.0,
    'home_advantage': 0.03
}])

# Predict win probability
probs = model.predict_proba(features)
home_win_prob = probs[0][1]
away_win_prob = probs[0][0]

print(f"Home win probability: {home_win_prob:.1%}")
print(f"Away win probability: {away_win_prob:.1%}")

Value Bet Detection

The model pairs with Kelly Criterion bet sizing for value bet identification:

  1. Convert sportsbook odds to implied probability
  2. Compare to model's predicted probability
  3. If model probability > implied probability β†’ positive edge (+EV)
  4. Kelly Criterion determines optimal bet size based on edge

Live Demo

Interactive dashboard available at: ianalloway/sports-betting-ml

Training Data

The model was trained on 2,000 simulated NBA games using realistic team strength ratings. In production, this would use live data from the NBA API.

Author

Ian Alloway β€” GitHub Β· Twitter Β· LinkedIn Β· Portfolio

License

MIT License

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support