NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > R > Interactive Exploration of NBA Lineup Data

Interactive Exploration of NBA Lineup Data

Tom Walsh
Posted on Feb 15, 2016

Contributed by Tom Welsh. He is currently in the NYC Data Science Academy 12 week full time Data Science Bootcamp program taking place between January 11th to April 1st, 2016. This post is based on his second class project - R Shiny (due on the 4th week of the program).

My first project explored the relationship between the performance of NBA lineups (5-man combinations of players) and the 5 players who made up those lineups. A full breakdown of how I put together this dataset can be found at the link above. However, this initial investigation really created more questions than answers.

For my second project, I created a tool that would allow a user to try to answer some of these questions themselves. With so many possible variables to explore, the aim was to pass control to the user.

The Data

The data set consists of both Lineup Stats and Player Stats pulled from stats.nba.com. The Lineup Stats are the statistical output of specific 5-man combinations. An example is here. You can hover over the columns for definitions of the stats and click over to other tabs to see more of them and play with the various filters. An example Lineup Stat would be that the lineup of Bismack Biyombo, Cory Joseph, Kyle Lowry, Patrick Patterson, and Terrence Ross makes 11.6 3-pointers per 100 plays. Their FG3M.lineup is 11.6.

For each lineup, I pulled in the full-season stats of the 5 individuals within that lineup and averaged them. For our example lineup, Bismack Biyombo makes zero 3-pointers per 100 plays (he has other skills), Cory Joseph makes 0.5, Kyle Lowry makes 3.4, Patrick Patterson makes 2.5, and Terrence Ross makes 3.3. Their FG3M.player is 1.94.

In basketball, there's only 1 ball, so for offensive stats, it's usually more relevant to look at usage-weighted values. We scale the offensive stats based upon how likely each player is to be the one using the possession.

Biyombo uses only 11.7% of his team's possessions when on the floor, Joseph uses 16.8%, Lowry uses 25.8%, Patterson uses 13.1%, and Ross uses 17.0%. That only adds up to 84.5% of available possessions, and this lineup doesn't simply suffer shot-clock violations on the remaining 15.5% of their possessions. So, we re-scale their stats, and their FG3M.usage is calculated as 2.19 ((11.7*0 + 16.8*0.5 + 25.8*3.4 + 13.1*2.5 + 17.0*3.3)/84.5).

Lineups

On the first tab, we can explore the relationships between the Lineup Stats and the Player Stats in either raw or usage-weighted form. It's very important to choose appropriate settings (basketball knowledge required) or else the results will likely be meaningless or at least very difficult to interpret. For example, usage-weighting is not particularly applicable to defensive rebounding.

The initial view displays NET_RATING.lineup on the Y axis and NET_RATING.player on the X axis. We see an increasing slope, which makes sense (we would intuitively expect lineups of higher net rating players to be have stronger net ratings). There is some explanatory text, which can be collapsed once you've read it. Below that, to the right, we see the size of our filtered data set, and the results of a linear fit on this data.

Please note that no numerical EDA has been done, so the validity of the fit is questionable. This should be seen merely as a starting point for further analysis, rather than a statement of statistical fact. To the left, we can change our Player Stat on the X axis and our Lineup Stat on the Y axis. There is also a checkbox to switch between raw and usage-weighted Player Stats. Below, a slider allows us to filter our data set based upon the number of minutes played by a lineup.

3 pointers

Let's explore the relationship between the 3 pointers made by a lineup, and the 3 pointers made by the players in that lineup. We'll set the Lineup Stat to FG3M and the Player Stat to FG3M and click the Use Usage-Weighted Stats toggle to use usage-weighted stats. Surprisingly, there doesn't seem to be any relationship. Maybe it's just the lineups with very small numbers of minutes throwing our data off, so we can shift the left side of the slider over to 100, and see that while this has significantly reduced our number of data points, we still don't see a relationship.

When we think about this, this makes some intuitive sense. 3 point attempts (and hence makes) may be the result of ball movement, and free-flowing offense, rather than the particular proclivity for and talent at shooting of the individuals in that lineup. So, let's explore a few more possibilities.

Most 3 pointers seem to be assisted, so let's change the Player Stat to AST. We now see a slight downward trend (which may or may not be significant... personally, I hope it isn't). The data seems to suggest that there probably isn't a positive correlation. This seems quite surprising, though, because we might have expected that players who generate lots of assists would also generate lots of 3 pointers for their teammates. However, our data doesn't seem to bear this out.

Another hypothesis is that 3 point opportunities come as a result of the defense collapsing due to penetration. Let's see what happens when we set Player Stat to PCT_POINTS_PAINT (percentage of points in the paint). We finally see a possible positive relationship, although more investigation is needed to determine if it stands up to statistical scrutiny. Intuitively, though, this suggests that having players who score their points in the paint seems to lead to 3 point attempts (surprisingly, though, PTS_PAINT doesn't seem to have this relationship... more investigation is definitely needed).

You can use this tab to explore many similar questions.

Diminishing Returns

Our next tab is inspired by some of Eli Witus' work. The layout is similar to the previous tab, but our plots are slightly different, for investigating diminishing returns.

Our initial plot looks at true shooting percentage(TS_PCT). On the Y axis, we see the difference between the lineup's true shooting percentage and the "null hypothesis" true shooting percentage (what we would expect in the absence of diminishing returns). On the X axis we see the extent by which the players in that lineup have increased or reduced their usage. The increasing slope here suggests that as players are forced to decrease their usage, their true shooting percentage increases.

If we want to look at offensive rebounding(OREB_PCT), usage-weighting no longer makes sense. Let's select OREB_PCT as the Stat, uncheck the Use Usage-Weighted Stats checkbox, and check the Sum Player Stats checkbox. Our null hypothesis is now that a lineup's offensive rebounding percentage should be equal to the sum of the offensive rebounding percentages of its players. The Y axis now display the difference between reality and this expectation. The X axis now displays the null hypothesis offensive rebounding as well. What we see is that the more offensive rebounding we have in our lineup, the greater the diminishing returns.

Distributions

The final tab allows for visual inspection of the distributions of our data. It's useful when you see a strange shape in the plots on the other two tabs and wonder where there's actually an interesting shape in the data or if you're just looking at random noise due to small numbers of data points.

About Author

Tom Walsh

Tom Walsh (M.Sc. Computer Science, University of Toronto) developed a desire to get deeper into the data while leading a team of developers at BSports building Scouting Information Systems for Major League Baseball teams. A course on Basketball...
View all posts by Tom Walsh >

Leave a Comment

Cancel reply

You must be logged in to post a comment.

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application