Skip to content

aksheyd/NBAMLP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NBA Championship Prediction

A fun project using a custom Multi-Layer Perceptron (MLP) with manual backpropagation to predict NBA championship winners based on team statistics.

Learn

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.

Model Statistics

Architecture

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 Results

  • Training Accuracy: 97.49%
  • Validation Accuracy: 96.25%
  • Test Accuracy: 96.25%

Details

  • 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.

Quick Start

uv sync
uv run python train.py    # Train the model
uv run python predict.py  # Predict current season

Files

  • data.py - Data collection and feature engineering
  • model.py - MLP
  • train.py - Training pipeline and evaluation
  • predict.py - Current season predictions

About

Go warriors

Resources

Stars

Watchers

Forks

Languages