DataMavericks, or DataMavs for short, is a one-stop shop for analyzing Dallas Mavericks player performance and optimizing matchups based on lineups and player performance. A powerhouse dashboard run by AI, DataMavs allows users to do a wide variety of functionalities, including:
- Viewing hypothetical lineups
- Compare players across different teams
- Analyze player shots on the Mavs.
Simply run streamlit run main.py
and the website should load.
- For the frontend, we used Streamlit and CSS.
- For the backend, we used Python and Jupyter Notebooks.
We analyze and display three particular statistics
- Optimizing Lineup
- For lineup optimization, the player data for the season is used. Initial preprocessing helps us aggregate player performance for Dallas Mavericks based on the opponent team. Since the whole goal of optimization is to create an offense and defense score based on the numerous features such as fgm, fga, plusMinus we use Principal Component Analysis to reduce the numerous features to simply two features - offense and defense.
- Following our reduced features we can build lineups based on Starting Position and the constraint of 5 players on the field. We use unsupervised learning specifically KMeans clustering to generate clusters of players for every starting position to then create unique lineups for games against every team, along with the ability to optimize the lineup for Offense Score or Defense Score.
- For lineup optimization, the player data for the season is used. Initial preprocessing helps us aggregate player performance for Dallas Mavericks based on the opponent team. Since the whole goal of optimization is to create an offense and defense score based on the numerous features such as fgm, fga, plusMinus we use Principal Component Analysis to reduce the numerous features to simply two features - offense and defense.
- Optimizing Matchup
- To create matchups for individual players we used Feature Engineering to divide the dataset into offensive vs defensive players by team and also create additional features for our model to use for offense or defense stats generation based on player performance. A thing to consider was to ensure that opponent team was considered when creating a score
- Following feature generation a Random Forest Regressor is used to train our dataset and then generate offense and defense scores for the players on the same plane. For predicting who wins the matchup a simple comparison is done based on the weighted averages of the score.
- Spatial Shot Analysis
- Given a player from the Mavericks, view heat maps of where the players take their shots (and how frequently). This uses KDE to determine density-based player areas; the denser the area, the hotter the heatmap.
- Also view the percentage of offensive shots.
- The best offense is a good defense, so view their defenses as well!
Figuring out what we wanted to include and filtering the data was important.
We can pit real-life players in hypothetical scenarios. We can also generate hypothetical scenarios ourselves.
We learnt a lot about the Mavs and the power of predictive artificial intelligence.
- Medical Information to track hurt/resting players
- Scouting for Trade and Free Agency Market
- Create custom players for a Fantasy Basketball league
- Calculator to assess shooting performance from PBP data