/r/NBAanalytics

3,790 Subscribers

10

Lineup Optimization

Source: https://www.vacstats.com/lab

Hello Statheads,

I'm sharing this web app I created because it's a fun way to put together hypothetical lineups (e.g. Curry on the Lakers or a team of all Jokics), but I also have a larger idea for those interested.

Ultimately I would love to create a 538/kenpom-type of site for NBA, and am interested in anyone who would like "join forces" or add onto what currently exists in this base site.

If anyone is interested, send a DM!

Also, feedback is appreciated if you feel so inclined to provide any.

4 Comments
2024/10/28
19:57 UTC

1

Dumksandthrees new dashboard

The new dashboard has a predictive section and has data for this year, but when you look at the shooting day from game 1 it completely doesn't align. So are the current 24/25 data just smoothed 23/24 data? And the single game epm is uncorrected info, thus not indicative of game stats? https://dunksandthrees.com/epm

2 Comments
2024/10/25
19:37 UTC

4

Pushed NBA stata/betting model site live, would love feedback

Hi everyone. We finally have the basic features for www.sharpsresearch.com live

Its pretty bare-bones at the moment, with a lot of stuff we are still working on.

Right now it has 4 features when viewing a match

Moneyline prediction

  • basic prediction on who will win the game. We trained the model with 13 features on 2008 - present games.

Starting lineup strengths

  • We trained a bunch of models on starting lineups. We used the regression coefficients of the top 5 features from the models and multiplied and summed them up for each player.

Similarity search

  • This is pretty cool. We scan all the historical games, and look for the 10 most similar games to the matchup that is loaded. Its basically a cosine similarity + k-nearest neighbours algo

Daily updated NBA elos (/nba/datasets).

  • Our own engineered Elo.

Right now im working on

  • o/u models
  • spreads
  • model breakdowns (so users can see the calibration, confusion matrix etc)

Thanks for the community here. There iv definitely learned from a few of you.

6 Comments
2024/10/23
01:51 UTC

2

Ahead of the Game: Intro to Points Over Expected

Hey yall, I had Jackson McGuire on my podcast today to talk about his new player metric, Points Over Expected. What sets this metric apart from most others is that it takes into account how much a player is being paid. Hope yall enjoy

0 Comments
2024/10/20
19:00 UTC

6

Why do the advanced metrics hate Jalen Johnson?

JJ is projected by lots of outlets to be on the MIP radar. The Greek chorus are basically unanimous in that he is good at basketball. You can watch him play and see he is good at lots of things. So my question why do BPM, LEBRON, EPM, literally any metric that tries better estimate performance see him as fine. What's the deal?

19 Comments
2024/10/20
15:36 UTC

4

Beginner coder

Hey everyone! I really want to start on some nba analytics projects on my own but it seems the best way to go about this is coding using API instead of copy and pasting into excel. Realistically how long with it take me to get a basic understanding of coding so I can start to mess around with stats and have some fun.

3 Comments
2024/10/16
02:20 UTC

4

Question about calculation of PER and PIE

Hello, everybody,

I know these advanced stats are far from perfect, but that's ok, I'm just playing with them as part of creating stats for smaller European competitions.

The PER calculation is made up of several parts, I'll try to simplify it.

uPER = (1 / MP) *

[ 3P

  • (2/3) * AST
  • (2 - factor * (team_AST / team_FG)) * FG
  • (FT * 0.5 * (1 + (1 - (team_AST / team_FG)) + (2/3) * (team_AST / team_FG)))
  • VOP * TOV
  • VOP * DRB% * (FGA - FG)
  • VOP * 0.44 * (0.44 + (0.56 * DRB%)) * (FTA - FT)
  • VOP * (1 - DRB%) * (TRB - ORB)
  • VOP * DRB% * ORB
  • VOP * STL
  • VOP * DRB% * BLK
  • PF * ((lg_FT / lg_PF) - 0.44 * (lg_FTA / lg_PF) * VOP) ]

I want to ask what does some of these parameters exactly mean in this formula:

  • team_AST - is this the total number of ASTs for a particular team for the entire season, or is it the team's average per game?
  • lg_FT - is this the total number of FTs of all teams in the league, or is it an average per game or an average per team?
  • Parameters for players (FGA / ORB...) - I assume this is a player's total for the whole season?

Then a question regarding PIE, where is this formula:

(PTS + FGM + FTM - FGA - FTA + DREB + (.5 * OREB) + AST + STL + (.5 * BLK) - PF - TO) / (GmPTS + GmFGM + GmFGM + GmFTM - GmFGA - GmFTA + GmDREB + (.5 * GmOREB) + GmAST + GmSTL + (.5 * GmBLK) - GmPF - GmTO)

  • The PTS figure is the total number of points a player scored in a season?
  • The figure for Gm (e.g. GmPTS) means what exactly? The average number of points per game?

Thank you for your help.

9 Comments
2024/10/06
16:56 UTC

12

NBA Dataset to run SQL queries

Is there an NBA dataset available to run sql queries on? The one on kaggle by Wyatt doesn't seem up to date, unless I'm doing something wrong there. Thanks!

7 Comments
2024/10/02
20:34 UTC

2

Player Impact Estimate for download?

Does anyone know where you can download PIE (Player Impact Estimate) for individual players? Doesn't seem to be on basketball-reference

13 Comments
2024/09/27
07:15 UTC

24

Do NBA Draft Combine Metrics Predict NBA Success?

edit: looks like the pics/visualizations aren’t showing up in this post on mobile for some reason, but you can see them here: https://www.formulabot.com/blog/do-nba-draft-combine-metrics-predict-nba-success

Kevin Durant, one of the greatest scorers in NBA history, famously couldn't put up a single rep of 185 on the bench at the combine. That begs the question--do combine metrics matter? Do they meaningfully predict NBA success in any way?

^(Spoiler alert: not really)

Methodology

Data collection:

  • Combine metrics: I used Python to scrape combine results from 2000-2023 from NBA.com, narrowing down the metrics to max vertical leap, lane agility time, three-quarter court sprint, and bench press. I also wanted to include height and weight, so I calculated height and weight ratios to adjust for height confounding.
  • NBA success: I decided to operationalize NBA "success" via Bball Index's all-in-one advanced impact metrics, LEBRON, which is further broken down into O-LEBRON and D-LEBRON for offensive and defensive impact, respectively. I scraped all 3 in R to use as outcome variables in my analyses.
  • Data pre-processing was conducted in R.

Analyses:

  • I ran linear regression analyses predicting all 3 outcomes from all 6 combine metrics individually (total of 18 models)
  • I then broke down each analysis by position for a total of 90 models.
  • I also ran a random forest model predicting the 3 outcomes from all 6 combine metrics combined.
  • All analyses were conducted using Formula Bot's chat feature. You can view the chat log here.

Results

Linear regression analyses (all positions):

After adjusting for multiple comparisons, only D-LEBRON was significantly associated with select metrics:

https://preview.redd.it/don1ir7rdsqd1.png?width=1300&format=png&auto=webp&s=f828029d6523e1032f68f091e6c7d3546c26c8f1

Surprisingly, vertical leap was negatively associated with D-LEBRON while slower lane agility and three-quarter court sprint times were associated with D-LEBRON.

Linear regression analyses (by position):

After adjusting for multiple comparisons, no single regression was significant due to small sample sizes and low statistical power.

https://preview.redd.it/ta6j9vwvesqd1.png?width=1300&format=png&auto=webp&s=eb215911111279f7e8ec4370fc248817c3c269dc

But if we ignore multiple comparison adjustments, there were some interesting significant effects:

  • Three-quarter court sprint time was negatively associated with both LEBRON and O-LEBRON (i.e., quicker times, higher LEBRON) for point guards only (not pictured above). The effect size for O-LEBRON was the largest in our entire dataset at -0.38.

  • Wingspan ratio was positively associated with D-LEBRON for power forwards and especially centers. The effect size for centers was 0.14, which was larger than the effect for any other position.

Here's a more in-depth visualization of the latter effect:

https://preview.redd.it/8lb3fpt8fsqd1.png?width=1300&format=png&auto=webp&s=b8828094cd7a16f8132c97db655e51938fbc17ef

Random forest models:

https://preview.redd.it/fbkoz7kdfsqd1.png?width=1228&format=png&auto=webp&s=9edde8eccaa8a66a64464e51b68e920be7c32bec

The LEBRON and O-LEBRON models were terrible fits (i.e., no meaningful prediction), but the D-LEBRON model had a decent fit, with all 6 combine metrics collectively explaining around 8% of the variance in defensive impact.

Takeaways

  • For offense, three-quarter sprint speed is the only metric that might reliably translate to NBA success—but only for point guards.
  • For defense, all metrics combined provide a little bit of predictive utility, explaining about 8% of the total variance in D-LEBRON.
    • Looking at the metrics individually, slow lane agility times and a high weight ratio seem to be the most important overall for D-LEBRON, although there are inconsistent effects (some positive, some negative) depending on position.
  • Wingspan ratio is the only metric with a consistent positive association with D-LEBRON across all positions. The effect is especially pronounced for centers.

A more in-depth write-up of my analyses and findings is available here: https://www.formulabot.com/blog/do-nba-draft-combine-metrics-predict-nba-success

5 Comments
2024/09/24
17:02 UTC

4

NBA scores predicting

Yesterday I finally invented a way to predict NBA games. Maybe 🤔

I use NBA API, calculate some averages, then I ask GPT about them, then create some embedding vectors, then logistic regression. In the end I have probabilities of a team scoring more than each possible score plus minus 20 from the real score. So the first 20 should have a higher probability of "more", the second 20 should have a higher probability of "less".

What do you think is the best way to test this algorithm? What metrics should I use to test it well and either against bookmaker predictions or at least against real scores, comparing the average accuracy to bookmakers?

0 Comments
2024/09/21
14:52 UTC

2

Looking For A Committed Owner To Fill A Spot In My Fantasy NBA 20 Team League!

Hello,

If anyone is interested in potentially joining a 20 team fantasy NBA league on ESPN, please feel free to reach out to me. This league has been running for 10+ years and is very competitive, serious, fun, and exciting!

It's head-to-head match-ups, with points format. (It's not categories).

12 teams make the playoffs. There is an entry fee set at 20.

If you wish to hear more details, I'd be happy to share them with you. You can email me at: hardcorebball@gmail.com

I'm looking to fill these spots ASAP!

Thank you!

0 Comments
2024/09/20
12:41 UTC

3

Does anybody have stats on which players were most impacted by NBA’s midseason rule changes on fouling calling for drives?

It’s reported by David Locke that the NBA is pleased and keeping the rule change they made during All-Star break of the 23-24 season. This rule change impacting how often the offensive players get foul calls when driving.

So, I was wondering if any of y’all had stats on which NBA players were most affected by this rule change be it TS% or something else. Like I guess TS before vs after All Star Break? If you have something else that’s fine too.

Thank You!

1 Comment
2024/09/20
10:33 UTC

16

Best NBA Writers

I wanted to highlight the best NBA writers in the field right now. Unsurprisingly, most of them are writing on Substack or Medium.

Neil Paine: https://neilpaine.substack.com/

Great source of data-driven work in all sports with massive audience. If you're looking for specifically basketball content, you might have to wait till the season starts. Still a remarkable writer and helped expand my worldview as a sports fan.

The Zone Master: https://thezonemaster.substack.com/

Hidden gem with less than 100 subscribers. Honestly the best amateur analytics writer in the field right now. - the ideas are innovative(check out the player tracking model) and the explanations are crisp for people inexperienced in data analytics. If you're looking for purely basketball analytics work, I would recommend this blog as my #1.

Logan Adams: https://www.loganadamsnba.com/

Great draft write-ups, and heavy emphasis on conceptual understanding over outcomes. His Prospects and Concepts series is going to be amazing this year. Check out his post on Nolan Traore, very informative and an emphasis on the parts that numbers can't really say much about.

Some others I like: Nic Thomas, JSuttHoops, Nick Kalinowski, Basketball Poetry.

4 Comments
2024/09/05
17:52 UTC

6

If we make a new metric called RMoWS(rap mentions over win shares), could Mo Bamba possibly be the goat by that stat?

1 Comment
2024/09/05
10:29 UTC

12

Check out this NBA Mini-Game I made using python

Check out this minigame I made in python using box scores from NBA API! 

Basically, you draft a 10-player NBA lineup, and then simulate a season to see how they perform.
Each player's performance in each game is based on a randomly selected game of theirs from last season.

https://www.playhoopgm.com/

https://preview.redd.it/h66fdym5j3kd1.png?width=1426&format=png&auto=webp&s=a4e49c89aee480fc15a36350e6c646f457f82aac

https://preview.redd.it/yt3w7y46j3kd1.png?width=1910&format=png&auto=webp&s=0ae5363c74439947ecc9e3bb32c20a25c761c503

0 Comments
2024/08/21
22:48 UTC

3

Chose Data Science as a major(Just graduated from Tunisian and HS thus total beginner) so would you recommend it as an introductory tool ?

for the record,I'm a complete beginner

I love Basketball thus I think it would be perfect to utilize NBA stats as a way to introduce myself to the topic since it's something I'm familiar with and if I like it why not become a sports analyst.

So for reference,I graduated from a Tunisian HS but we had a big emphasis on math since I was in the mathematics branch(last things I studied were things such as integrals/primitives/spatial geometry/stats/probability and arithmetic etc) which would like normal knowledge for an undergraduate seeking DS but if I were to compare test I got in Tunisia vs ones I've seen online in US,the difference is night and day.

The test I've passed/excelled at are much more comparable to US top AP tests or even some test in Uni.

So is Basketball Reference enough/can I start with this as an entry level student or is it not feasible?

3 Comments
2024/08/10
15:19 UTC

5

Unpacking the NBA Finals: Boston's Mastery Over Dallas

Hey NBA fans! I recently published an article on my Substack analyzing how the Boston Celtics clinched their 18th championship by outplaying the Dallas Mavericks. The piece uses detailed play by play data from the NBA. Highlights include:

  • Strategic Shot Selection and Execution: Analyzing Action and Shot Types
  • Precision and Placement: Analyzing Shot Location
  • From Shot Selection to Player Efficient Offensive Production: Analyzing EOP
  • Defense Wins Championships? Analyzing Hustle Plays

Check it out using the link below and let me know your thoughts!

https://sltsportonomix.substack.com/p/unpacking-the-nba-finals-analyzing

0 Comments
2024/06/27
15:19 UTC

12

NBA Streamlit Apps

Hey guys,

I built these NBA streamlit apps. I would really appreciate it if you check them out and let me know what you think and any areas of improvement.
Thanks
https://3dnbashotvisualizer.streamlit.app - This app plots NBA games from 2002 - present in a 3D form so you can see the shot paths of every shot. It also has many filters so you can customize what shots you want to see.

https://nbashotvisualizer.streamlit.app - This app is similar to the 3D but it is 2D and is player shot charts rather than games. You can select multiple seasons from a player and customize with filters. It also has a variety of shotcharts available like make/miss, heatmap, KDE, etc.

https://nbasalarycentral.streamlit.app - This app is a NBA salary predictor. It uses multiple features such as per game and advanced stats to predict a players value and predict a salary based on that value. It also has a bunch of other features and visualizations.

Thanks again.

5 Comments
2024/06/27
10:01 UTC

5

NBA shot chart court dimensions

Doing a project with NBA api data and was looking at NBA court dimensions. At first I was confused by the datum which is in feet x 10. This lead me checking the dimensions of publicly posted code and it seems many left out a critical detail, the 6" between the rim and the hoop. In fact, the NBA rule book clearly notes the center of the hoop is 15" from the plane of the backboard.

Many of these codes list the baseline as -47.5 but it should be -52.5, which is 5.25 feet (4' + 1' 1/4" [15"]).

https://preview.redd.it/l3kheavhnd7d1.png?width=671&format=png&auto=webp&s=4366db05994d33b8a9b2f3e3a9e0395864acbe5c

Code listed here would need to be revised:
How to Create NBA Shot Charts in Python - Savvas Tjortjoglou

College Basketball Shot Mapping with Python | by Amitparikh | Medium

3 Comments
2024/06/18
19:12 UTC

5

NBA Totals Predictor

Dad and I were traveling for work last week, found ourselves staying at the casino Thursday night. Both of us live in Boston so we figured we would catch the Celtics on the big screen.

Dad doesn't bet, but I do. Told him I liked the over 226.5, he tailed. When in Rome. The game finished at 236.

Riding home he was talking about how I should build a model for Totals. I have been working on some NFL models that I have posted about a couple times on other subs. ( wagerwerks.com )

By Friday night I had a working model.

1. 5/24: Predicted 214, finished at 217. Over 207.5 ✅

2. 5/25: Predicted 227, finished at 225. Over 222.5 ✅

3. 5/26: Predicted 214, finished 223. Over 207.5 ✅

4. 5/27: Predicted 223, finished 207. Under 223.5 ✅

5. 5/28: Predicted 212, finished ?

1 Comment
2024/05/28
17:05 UTC

0

Synergy Account

Was there any way I could use Synergy for free? There stats seem so sick, but man is it expensive

1 Comment
2024/05/24
16:05 UTC

4

Minute distribution across years in the NBA by cluster (playing style).

https://preview.redd.it/32z9qjina52d1.png?width=2880&format=png&auto=webp&s=9e92087015912104e29534a864f652f2090af3f7

Jokic is in cluster_2 and follows the light blue line.

It's very interesting to see the sharp decrease in variance and increased mean for cluster_4 after four years in the NBA. Cluster_2 seems to have a significantly greater minutes per season mean compared to every other cluster, in every year.

Unsurprisingly, every cluster also shows a steady decrease in mean minutes per season around 10 years into an NBA career.

1 Comment
2024/05/23
09:29 UTC

4

Is there any way to get tracking data at the level of individual shots?

Hi, so I was looking for a way to get tracking data (defender distance specifically) on individual shots so that I can integrate it with play-by-play data. Currently, you can get tracking data on shots at the season-level or even the single-day-level, either directly from nba.com (Players Shooting Dashboard Closest Defender | Stats | NBA.com) or from nba_api. However, I haven't found a way to get data on single shots. Is there any way for the public to access that type of data?

7 Comments
2024/05/18
13:46 UTC

17

Revolutionizing NBA Team Composition with Modern Portfolio Theory

I've published my last post on Substack where I apply Modern Portfolio Theory from finance to NBA team building. I wanted to combined my finance expertise and passion for sports, espacially basketball, for a long time. The post is about blending strategic investment principles with basketball team management to uncover new insights into forming winning teams. If that sounds interesting, come check it out and let me know your thoughts.

https://sltsportonomix.substack.com/p/revolutionizing-nba-team-composition?r=2mhplq

3 Comments
2024/05/06
12:37 UTC

1

Cleveland Cavaliers vs Orlando Magic Series Predictions | 2024 NBA Playoffs

0 Comments
2024/04/18
05:39 UTC

6

Teaching an NBA Statistics Course - Looking for Input

Hi! My name is Torsten Maier and I teach Industrial Engineering at Kettering University. I have a background in statistics and data analytics for manufacturing but a personal passion for the NBA. I have decided (with backing from my department) to teach an NBA Statistics course (starting in October). The goal of the course is to teach engineering students basic statistical and data analytic concepts but in a fresh application area that the students hopefully are passionate about and find fun and engaging.

I'm looking for any type of input from the broader community. This could range from specific content creators (Thinking Basketball is my favorite) that I should include in the course to specific ideas/topics that I should be sure to include (like the many different types of +/- stats).

Thanks ahead of time to anyone willing to throw in their two cents!

5 Comments
2024/04/17
18:36 UTC

4

NBA Challenge Rewind: Unveiling Top Insights from Analytics Experts

I recently hosted an event called the NBA Data Modeling Challenge, where over 100 participants utilized historical NBA data to craft SQL queries, develop dbt™ models, and derive insights, all for a chance to win $3k in cash prizes!

The submissions were exceptional, turning this into one of the best accidental educations I've ever had! it inspired me to launch a blog series titled "NBA Challenge Rewind" — a spotlight on the "best of" submissions, highlighting the superb minds behind them.

In each post, you'll learn how these professionals built their submissions from the ground up. You'll discover how they plan projects, develop high-quality dbt models, and weave it all together with compelling data storytelling. These blogs are not a "look at how awesome I am!"; they are hands-on and educational, guiding you step-by-step on how to build a fantastic data modeling project.

We have five installments so far, and here are a couple of my favorites:

  1. Spence Perry - First Place Brilliance: Spence wowed us all with a perfect blend of in-depth analysis and riveting data storytelling. He transformed millions of rows of NBA data into crystal-clear dbt models and insights, specifically about the NBA 3-pointer, and its impact on the game since the early 2000s.
  2. Istvan Mozes - Crafting Advanced Metrics with dbt: Istvan flawlessly crafted three highly technical metrics using dbt and SQL to answer some key questions:
  • Who is the most efficient NBA offense? NBA defense?
  • Why has NBA offense improved so dramatically in the last decade?

Give them a read!

0 Comments
2024/04/16
18:04 UTC

0

Every Regular Season Final Standings

This is probably easy for y'all but I just am not good yet at automated webscraping, and Power Query gets on my nerves. Is there a repository or dataset somewhere that would have every regular season final standings? I can use R or Python (or just a csv would work.)

I have stathead and basketball reference but clicking for every season and page seems tedious.

5 Comments
2024/04/15
18:31 UTC

2

Opponent Shooting Stats on NBA .com

Does anyone know if the Opponent Shooting stats page on NBA .com covers shots that the listed player guarded/contested, or is it just the opposing team's shooting stats when the listed player is on the court (regardless if the listed player contested the shot or not).

Stat page available here: https://www.nba.com/stats/players/opponent-shooting?DistanceRange=By+Zone&PerMode=Totals

1 Comment
2024/04/15
18:12 UTC

Back To Top