Predict NBA champions with Bayesian stats & optimize fantasy lineups with Monte Carlo simulation.
Bayesian Sports Prediction App is an interactive Streamlit web app that tackles two hoops-analytics problems:
- NBA Championship Probabilities – Uses a Bayesian Bradley-Terry model (PyMC) and thousands of simulated playoff brackets to estimate each team’s odds of winning the title.
- Daily Fantasy Lineup Optimization – Runs Monte Carlo simulations of player performance, then picks the highest-EV lineup under the salary cap.
Everything runs in a friendly Streamlit UI—tweak parameters, watch the numbers change, and make smarter hoops decisions.
| Category | Highlights |
|---|---|
| 🏆 Championship Predictor | Posterior team strengths · Top-8 bracket simulation · Probability table & bar chart · “Roster-change” slider to test injuries/upgrades |
| 🤖 DFS Optimizer | Brute-force + MC lineup builder · Salary-cap aware · Histogram of total lineup points · Manual lineup-builder UI |
| 📊 EDA Dashboards | Interactive Plotly violin / histogram / scatter charts for team & player stats |
| 🎮 Streamlit UX | Multi-page layout · Instant re-simulation · Downloadable results |
| Tool | Role |
|---|---|
| Core language (v3.10) | |
| PyMC & Aesara | Bayesian inference & MCMC |
| Data wrangling | |
| App framework | |
| Interactive visualizations |
┌────────────────────────┐ │ Streamlit Front End │ ◄──── user interacts └──────────┬─────────────┘ │ calls ┌──────────▼─────────────┐ │ Simulation Engine │ (PyMC: Bradley-Terry & MC) └──────────┬─────────────┘ │ returns results ┌──────────▼─────────────┐ │ DFS Optimizer Module │ (salary-cap + MC totals) └────────────────────────┘
The app is deployed on Streamlit Community Cloud: <https://sports-predictor.streamlit.app>
- Clone
git clone https://github.com/yourusername/bayesian-sports-prediction-app.git
cd bayesian-sports-prediction-app- Create / activate a Python 3.10 env (optional)
python -m venv venv
source venv/bin/activate # on Windows: venv\Scripts\activate- Install deps
pip install -r requirements.txt- Run
streamlit run app.py- Fork this repo ➜ push to your GitHub.
- Go to share.streamlit.io ➜ “New app”.
- Select the repo, branch, and app.py (or streamlit_app.py) as entrypoint.
- (Optional) In Advanced settings, pick Python 3.10 and add secrets.
- Click Deploy. Streamlit Cloud installs requirements.txt and spins up your app.
Distributed under the MIT License. See LICENSE for info.