| title | emoji | colorFrom | colorTo | sdk | sdk_version | app_file | pinned | license |
|---|---|---|---|---|---|---|---|---|
Sports Betting ML |
🏀 |
orange |
red |
streamlit |
1.28.0 |
app.py |
false |
mit |
A machine learning model for predicting NBA game outcomes and identifying value bets by comparing model predictions to betting market odds.
- Game Outcome Prediction: XGBoost model trained on historical NBA data (~68% accuracy)
- Value Bet Detection: Compares model probabilities to implied odds to find +EV bets
- Kelly Criterion: Optimal bet sizing based on edge and bankroll
- Live Odds Integration: Pulls current odds from The Odds API
- Interactive UI: Streamlit dashboard for easy predictions
- Data Collection: Historical NBA game data including team stats, home/away performance, recent form
- Model Training: XGBoost classifier trained on features like offensive/defensive ratings, pace, recent win streaks
- Prediction: Model outputs win probability for each team
- Value Detection: Converts betting odds to implied probability, compares to model probability
- Bet Sizing: Kelly Criterion calculates optimal bet size based on edge
# Install dependencies
pip install -r requirements.txt
# Run the Streamlit app
streamlit run app.pysports-betting-ml/
├── app.py # Streamlit UI
├── model/
│ ├── train.py # Model training script
│ ├── predict.py # Prediction functions
│ └── model.pkl # Trained model
├── data/
│ ├── fetch_data.py # Data collection
│ └── features.py # Feature engineering
├── utils/
│ ├── odds.py # Odds API integration
│ └── kelly.py # Kelly Criterion calculator
└── requirements.txt
- Historical Data: NBA API (nba_api package)
- Live Odds: The Odds API (free tier: 500 requests/month)
| Metric | Value |
|---|---|
| Accuracy | ~68% |
| ROI (backtested) | +5.2% |
| Sharpe Ratio | 1.3 |
This is for educational purposes only. Sports betting involves risk. Past performance does not guarantee future results. Please gamble responsibly.
Ian Alloway - ianalloway.xyz
MIT
