Management And Artificial Intelligence, Machine Learning: Court Dynamics
Team Members: Utku Kaan Akçiçek, Vladimir Todorovski, Federico Schiavone Ercoli
[Section 1] --- Introduction
Project Overview: This project explores how NBA players evolve over time by analyzing detailed performance data from the basketball.db dataset. Instead of building a prediction model, our focus was on uncovering patterns, role changes and notable trends that reveal how players develop within a team context. By examining career length performance metrics and shooting efficiency, we aim to provide a clearer picture of how players grow throughout their time in the league. These insights can help teams make more informed decision about player roles development strategies and long term planning.
[Section 2] --- Methods
Machine Learning Overview
In addition to traditional statistical analysis, our project incorporates several machine learning methods aimed at uncovering deeper structure in player performance. We use unsupervised learning (K-Means) to identify player roles, supervised learning (KNN,SVM,Random Forest) to classify player positions, and anomaly detection (Isolation Forest) to highlight unusual seasons. These models complement our descriptive analysis by revealing hidden patterns that cannot be captured through simple summary statistics alone.
- Dataset Exploration
We began by loading all core tables from basketball.db including players, teams, coaches, regular season data and playoff statistics. After examining DataFrame shapes, data types and sample rows, we identified the seasons covered and the total number of players and teams. This initial exploration helped us understand the structure and limitations of the dataset before performing deeper analysis.
- Data Cleaning and Filtering
To ensure meaningful and accurate results, we applied several cleaning steps:
- Removed unrealistic physical measurements (height < 3ft, weight <25 lbs)
- Filtered out players who appeared in fewer than 10 games
- Excluded players active after the dataset cutoff year which is 2004 These design choices were made to eliminate noise and prevent misleading statistics, especially in per game and shooting efficiency metrics.
- Player Physical Attributes
We converted height from feet + inches into total inches to standardize comparisons across players. We then analyzed distributions of height and weight to understand physical trends in the league. This step helped establish baseline characteristics of the average NBA player.
- Missing Data Analysis
We calculated the percentage of missing values in each column and visualized missingness in the regular season table. This allowed us to identify incomplete records and understand how much the missing data could affect later analyses.
- Career Length Analysis
Career length was computed for each player by subtracting their first season from their last. We plotted its distribution and highlighted the average career duration. This analysis provides insight into how long players typically remain in the league and how competitive the environment is.
- League Entry and Exit Trends
We counted how many players entered and exited the league each season and visualized these trends with line charts. This reveals patterns of roster turnover and helps contextualize career lengths and player development
- Per-Game Performance Metrics
For each player, we computed core statistics on a per game basis:
- Points
- Assists
- Rebounds
- Minutes
- Steals
- Blocks
- Turnovers
We visualized the distributions using histograms and highlighted league averages. These metrics help characterize the typical performance level of NBA players and identify outliers.
- Shooting Efficiency Analysis
We calculated three major efficiency indicators:
- Field Goal Percentage (FG%)
- Free Throw Percentage (FT%)
- Three-Point Percentage (3P%) To avoid misleading results, we only ranked players with at least 300 field goal attempts. This filtering ensures that top shooters are genuinely efficient rather than statistical accidents from small sample sizes.
- Player Rankings We ranked the top 10 players in:
- Points per game
- Assists per game
- Rebounds per game These rankings highlight standout performers and help contextualize overall league trends.
-
Correlation Analysis We computed a correlation matrix across major performance metrics (PPG,APG,RPG,shooting percentages) and visualized it with a heatmap. This allows us to understand how different aspects of performance relate to one another
-
Full Statistical Visualization We produced a 3x3 grid of histograms covering all key per game metrics. This comprehensive visualization provides an intuitive summary of how the average NBA player performs across multiple dimensions.
-
Machine Learning Components
In addition to descriptive and statistical analysis, we applied several machine learning techniques to uncover deeper structure in player performance and behavior. The goal of this part of the project was not to build a single predictive model, but to use machine learning as a tool for identifying patterns, comparing player roles and detecting unusual performance profiles.
Clustering (Unsupervised Learning) We used K-Means clustering to group players based on their statistical profiles, using features such as points, assists, rebounds, blocks, steals and shooting percentages. This allowed us to discover natural player "roles" in the data (ball handlers, traditional bigs, 3 and D wings) Scaling the data and selecting the number of clusters via the elbow method were key design choices that ensured meaningful grouping.
Why K= 6 Cluster chosen? We used the elbow method to determine a suitable number of clusters. K = 6 was chosen because inertia begins to flatten beyond this point, indicating diminishing returns from additional clusters.
Player Position Classification (Supervised Learning) To understand how well basic performance metrics can predict a player's official position, we trained three different models:
- K-Nearest Neighbors (KNN)
- Support Vector Machine (SVM)
- Random Forest We evaluated them using accuracy, macro-F1 and weighted-F1 scores. Afterwards, we improved each model through hyperparamter tuning using GridSearchCV, leading to more robust classification performance.
Anomaly Detection
We applied an Isolation Forest model to detect statistical outliers in the dataset. This helped us identify unusually high impact or unusual seasons that deviate significantly from typical performance patterns. The anomaly scores allowed us to quantify how "unusual" certain player seasons were.
Why Machine Learning Was Included?
ML was used here to deppen the analysis and reveal structure that simple statistics cannot always capture Clustering and classification helped us understand roles and player behavior, while anomaly detection highlighted exceptional performances worth further investigation.
Environment: We have used the following environment:
- Python
- pandas
- numpy
- matplotlib
- sqlite3
- Jupyter Notebook
Key Libraries Used
- pandas :
- Used for loading, cleaning and manipulating all NBA tables.
- Makes it easy to work with DataFrames and calculate per game stats.
- sqlite3 :
- Connects to the basketball.db database.
- Allows us to run SQL queries directly from Python.
- matplotlib :
- Used to create all visualizations (histograms, line plots, bar charts).
- Helps us explore distributions and trends in the data
- numpy :
- Provides fast numerical calculations.
- Used for computing shooting percentages and handling missing values.
- seaborn :
- Used to create visually clearer and more polished plots.
- Mainly used for the correlation heatmap and enhanced staistical visualization.
Machine Learning and Statistical Modeling:
- sklearn Used for clustering, classification, anomaly detection, evaluation and model tuning: Preprocessing: StandardScaler LabelEncoder Clustering: KMeans Classification Models: KNeighborsClassifier SVC RandomForestClassifier Model Selection and Evaluation: train_test_split ConfusionMatrixDisplay GridSearchCV accuracy_score, precision_score,recall_score,f1_score Anomaly Detection: IsolationForest
Key Questions We Have Explored:
- How long do NBA plyers typically stay in the league?
- How do height and weight distributions look across players?
- How many players enter and exit the league each season?
- Which players rank highhest in points, assists and rebounds per game?
- Who are the most effiicient shooters?
- How do per game stats correlate with each other?
Key Features Analyzed:
- Player physical attributes (height, weight)
- Career Length
- League entries and exits
- Per game stats
- Shooting Efficiency
- Best shooters
- Correlation matrix
- Histograms and visual distributions
Design Choices:
- We cleaned unrealistic entries (height < 3 ft, weight < 25 lbs).
- We focused on players with >= 10 games played for meaningful per game stats.
- For shooter ranking, we required >= 300 Field Goals Attempted (FGA) to avoid misleading percentages.
- Histograms and line charts were chosen for clarity and interpretability.
Recreating The Environment
To reproduce our environnment, install all required libraries using: pip install numpy pandas matplotlib seaborn scikit-learn
If using conda, the environment can also be exported or recreated with: conda env export > environment.yml conda env create -f environment.yml
[Section 3] --- Experimental Design: Describing experiments that our group conducted to demonstrate/validate the target of our contributions of our project.
In this section, we describe the experiments we conducted to validate the main insights of our project. Each experiment focused on a different aspect of player evolution in the NBA and helps demonstrate whether our analytical approach captures meaningful trends. For each experiment, we outline the purpose, the baseline we compared against and the metrics used to evaluate the results.
Experiment 1 -- Career Length Analysis:
Purpose: To understand how long NBA players typically remain in the league and identify broader patterns in career longevity.
Baseline: The raw, unfiltered distribution of career lengths across all players in the dataset.
Evaluation Metrics: Mean and median career length, histogram distribution and variance. We used these metrics because they show both the typical career length and how much player careers vary across the league.
Experiment 2 -- League Entry and Exit Trends:
Purpose: To analyze how many players enter and leave the NBA each season, providing insight into roster turnover over time.
Baseline: Season by season counts of player entries and exits.
Evaluation Metrics: Line chart trends, year to year differences and overall patterns in player flow. We have used these metrics because they help us clearly see how player movement changes from season to season and reveal any major shifts in league turnover.
Experiment 3 - Shooting Efficicency Analysis:
Purpose: To evaluate how efficiently players score by analyzing %FG %FT and %3P across the league and identifying truly elite shooters
Baseline: League wide average shooting percentages without any filtering
Evaluation Metrics: Distributions of %FG %FT %3P and mean efficiecny values. We also applied a >= 300FGA filter to remove statistical outliers, ensuring more reliable comparisons.
Experiment 4 -- Seasonal Evolution Of Performance Metrics:
Purpose: To understand how key player statistics(points ,assists, rebounds, steals, minutes) changed across seasons and whether long term trends exists in the NBA.
Baseline: The earliest available seasons in the dataset used as the historical reference point.
Evaluation Metrics: Year to year trends, moving averages and line plot visualizations. These metrics show whether performance levels increased, decreased or remained stable over time
Experiment 5 -- Correlation Analysis:
Purpose: To identify how major performance metrics relate to one another for example wheter points correlate with minutes or assists.
Baseline: The assumption of no correlation between variables
Evaluation Metrics: Pearson correaltion coefficients and a correlation heatmap. These reveal which metrics move together and which ones behave independently.
Experiment 6 -- K-Means Clustering (Unsupervised Learning):
Purpose: To discover natural player groups based on their statistical profiles and identify potential role patterns in the league.
Baseline: No predefined player roles cluster structure is discovered purely from the data.
Evaluation Metrics: Inertia values from the eblow method and qualitative seperation of clusters K=6 was chosen because additional clusters did not significantly improve the inertia reduction
Experiment 7 -- Player Position Classification (Supervised Learning):
Purpose: To test whether performance statistics can predict a player's listed position (G/F/C).
Baseline: A majority class baseline (most common position in the dataset).
Evaluation Metrics: Accuracy, macro-f1 and weighted f1 scores. These metrics evaluate both overall performance and how well the models handle class imbalance.
Experiment 8-- Hyperparameter Tuning for Classification Models:
Purpose: To improve the performance of the initial KNN,SVM and Random Forest models using paramter optimization.
Baseline: The untuned models trained with default scikit-learn parameters.
Evaluation Metrics: Cross Validated accuracy and F1 scores from GridSearchCV. These provide a more stable evaluation of model performance.
Experiment 9 -- Anomaly Detection (Isolation Forest):
Purpose: To detect players or seasons with unusually high or unusual statistical patterns.
Baseline: Typical player distributions.
Evaluation Metrics: Anomaly scores produced by the Isolation Forest model and mean performance differences between normal and anomalous groups.
Experiment 10 -- Per Game Performance Analysis:
Purpose: To explore typical player performance by examining distributions of core per game metrics such as points, assists and rebounds.
Baseline: League wide averages for PPG, APG, RPG, SPG, BPG and MPG.
Evaluation Metrics: Histograms, means and spread of each distribution. We used these metrics because they show both the average performance levels and how widely players differ across each statistic.
[Section 4] --- Results: In this section, we present the main findings of our analysis and summarize the trends revealed by our visualizations. These results highlight how NBA players evolve over time in terms of career duration, movement within the league, and on court performance
Main Findings: Our analysis reveals several important patterns about how NBA players develop and perform over time:
- Career Longevity: Most NBA players have relatively short careers, with the majority staying in the league for only a few seasons. A smaller group has significantly longer careers, which creates a long-tail distribution.
- Player entry and exit trends: New player entries vary across seasons, while exits remain more stable. The difference between the two helps highlight periods of higher roster turnover.
- Per game performance: The distribution of points assists and rebounds show that most players cluster around modest averages, with a small group standing out as exceptional performers.
- Shooting efficiency: League wide FG% , FT% and 3P% follow clear and consistent patterns. Applying the >= 300 FGA filter allowed us to identify players who are truly efficient shooters rather than statistical outliers.
- Metric relationships: Correlation results show meaningful connections between stats such as points, assists and minutes while shooting percentages are less strongly correlated with other performance metrics.
Key Figures: The figures below are automatically generated by our code in main.ipynb. In the README we show placeholders referencing where these results appear.
Figure 1 -- Career Length, League Entries and Exits Distribution

Figure 2 -- Per-Game Statistics Grid

Figure 3 -- Seasonal Evolution of Key Performance Metrics

Figure 4 -- Correlation Matrix

Conclusion Of Results These figures collectively illustrate the structure of the NBA player population: their typical career duration, the flow of players into and out of the league, performance differences across key metrics and how different aspects of performance relate to one another.
[Section 5] --- Conclusions:
Summarizing in one paragraph the take-away points from our work: This project helped us build a broader understanding of how NBA players develop within the league and how different performance metrics shape their roles over time. Instead of focusing on one specific prediction task, looking at the data from multiple angles allowed us to see the league as a dynamic system where players enter , grow, adapt and eventually exit. The patterns in career length , performance distrubitions, and shooting efficiency all highlight how competitive the NBA environment is and how small differences in skill or consistency can influence long-term outcomes. More importantly, the analysis shows that meaningful insights often come not from one metric alone but from observing how several indicators interact.
Explaining what questions may not be fully answered by our work as well as natural steps for this direction of future work: At the same time, our study leaves room for deeper exploration. We did not examine player development across individual seasons, nor did we model how performance changes in response to factors like age, injuries, team systems, or coaching styles. We also did not investigate more advanced questions, such as predicting future performance, grouping players by developmental trajectories, or identifying early career indicators of long term success. Future work could incorporate machine learning models, clustering techniques or longitudinal analysis to expand on the foundations we built here. These extensions would allow for a more complete understanding of player evolution and could support more strategic, data driven decision making in team management.
Limitations
Our analysis is limited by the dataset ending in 2004, meaning modern NBA style changes (pace shift, 3-point era) are not represented. In addition, our models rely only on box score statistics, so contextual factors such as lineups, playstyle or injuries are not captured.