Back to Home

How Does This Work?

Overview

This project uses supervised machine learning (linear regression) to predict NBA player salaries based on their statistics. The model compares predicted salaries with actual salaries to determine if players are overpaid or underpaid.

Data Collection

We collect data about NBA players using the SportsData.io API, which provides comprehensive statistics and salary information for over 340 players. This data is organized and stored in a SQLite database for efficient access.

Feature Selection

We analyzed over 50 different statistics to identify the most relevant features for salary prediction. Using Pearson correlation coefficients, we selected 28 parameters that have the strongest relationship with player salaries.

Points vs Salary Correlation
Points vs Salary (Correlation: 0.73)
3-Point Percentage vs Salary Correlation
3-Point % vs Salary (Correlation: 0.05)

Model Training

Our model uses linear regression with gradient descent optimization. The process includes:

Cost Function Formula
Mean Squared Error Cost Function
Gradient Formula
Gradient Descent Update Rule

Prediction Process

When you enter a player's name:

  1. The system fetches the player's statistics from our database
  2. Features are normalized using pre-computed means and standard deviations
  3. The model predicts the player's expected salary
  4. Results are compared with actual salary to determine if the player is overpaid or underpaid

Technical Stack

This project is built using: