A fun project using a custom Multi-Layer Perceptron (MLP) with manual backpropagation to predict NBA championship winners based on team statistics.
You can clone this repo and tune the model to your liking. You can try:
- different batch sizes
- different learning rates
- different activation functions (relu, sigmoid, tanh)
- back propgation entirely
Head to model.py to tune to your liking.
25 input features → 64 hidden neurons → 32 hidden neurons → 2 output classes
Takes in one team's 25 stats and outputs a logit for champion vs non-champion.
- Training Accuracy: 97.49%
- Validation Accuracy: 96.25%
- Test Accuracy: 96.25%
- Trained on 797 team-seasons from 1996-2024
- Uses 25 features (shooting efficiency, scoring, rebounds, defense)
- Dataset: 28 champions (3.5%), 769 non-champions (96.5%)
The model achieves high accuracy by predicting "non-champion" for most teams (rational given class imbalance). However, it does learn patterns - championship contenders receive higher probabilities (28-33%) compared to the baseline.
uv sync
uv run python train.py # Train the model
uv run python predict.py # Predict current seasondata.py- Data collection and feature engineeringmodel.py- MLPtrain.py- Training pipeline and evaluationpredict.py- Current season predictions