A real-time data science web dashboard designed for local basketball clubs. Log game events (fouls, points, assists), track player statistics, and use advanced machine learning (SVM) to predict 1v1 matchup outcomes.
- Live Stat Logging — Log in-game events for local club players.
- Player Stats Dashboard — Box scores, leaderboards, and per-player event logs.
- Trends & Insights — Visualizations including cumulative performance over time and stat correlation matrices using Plotly.
- Machine Learning Predictions — Integrated Support Vector Machine (SVM) model trained to predict 1v1 matchup win probabilities based on comprehensive player statistics.
- Data Entry Management — Upload CSVs of past games or batch-enter data. Add and remove players from the club roster dynamically.
data sci project/
├── ledger.py # EventLog class for maintaining a chronological list of events
├── stats.py # Per-player aggregation and metric calculations
├── ml.py # SVM model and synthetic training data generation
├── app.py # Streamlit dark-theme dashboard
├── requirements.txt
└── README.md
- Python 3.10 or newer
- pip
From the project directory:
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
streamlit run app.pyOn macOS/Linux, activate with source .venv/bin/activate instead of .venv\Scripts\activate.
The app opens in your browser (default: http://localhost:8501).
- Use the Live Feed tab to log stats (points, fouls, assists) for club players.
- Open the Stats Dashboard tab to view the live-updating box score and individual player breakdowns.
- Check the Trends & Insights tab to see cumulative points plotted over time and a correlation matrix of player stats.
- Go to ML Prediction to run the Support Vector Machine (SVM) and predict head-to-head match outcomes.
- Add custom players or upload large CSV logs via the Data Entry tab.