Categorizing NBA Offenses with Machine Learning

In an age where old heads are complaining that every team plays the same (but anyone who watches games can tell you this is not at all true), I got to thinking about how many different types of offenses there really are in the NBA. I wondered, as any normal person would, “How well can an algorithm categorize NBA offenses without watching a single second of NBA basketball?”

I gathered 58 statistical categories from to capture how well and how often teams did different offensive actions, ranging from setting screens to taking catch and shoot threes to passing out of post ups to earning free throws on drives. (A complete list of the categories I used is at the bottom of this post.)

To categorize offenses, I used k-means clustering, a machine learning algorithm that categorizes data into a set number (“k”) of groups based on the data’s features. For NBA offenses, this meant categorizing them based on how similar they were across all 58 statistical categories; think of this as putting offenses into groups based on how similar they were across the categories. Teams in one category are close in most, if not all, of the statistical categories.

K-means is unsupervised, which just means that it creates the categories itself; I don’t get to tell it what the categories should be. This makes the results more interesting for me, since the algorithm makes up categories to fit the data I give it, and part of the process for me is interpreting what the algorithm saw when it put teams in the same category.

The results suggested there are seven categories of NBA offenses. Let’s break them all down and see which teams fit into each category.

Seven Categories of NBA offenses

1: Analytics Darlings

Boston, Dallas, Milwaukee, Minnesota, Portland, Sacramento, and Utah

In an age where analytics have pushed teams towards dunks and threes, these teams have fully embraced analytically ideal offense. The teams in this category are the best at scoring on drives and are the lowest in both catch and shoot and pullup 2 point field goal frequency. They shoot threes more often than all but one (very unique) category of teams, and they earn more free throws on their drives than all but one (also very unique) category. Unsurprisingly, the two best teams by offensive rating (Sacramento and Boston) were in this category, and every Analytics Darling except for the Blazers, who spent the last part of the season tanking, finished in the top half of NBA offenses.

2: Midrange Maestros

Atlanta, Brooklyn, Chicago, Detroit, LA Clippers, Philadelphia, Phoenix, Washington

Put on your JNCO jeans and stick a Notorious B.I.G CD in your boombox if you’re going to watch these guys play offense. They are the true hoopers: they love shooting between 8 and 24 feet and isolating. They live and die with the talent of their players more than perhaps any other category; the potential inconsistency of relying heavily on self-created jump shots meant that there was a huge range in how these offenses performed. At the top, you have the 76ers, whose past and (probably) future MVPs led them to the third best offensive rating. At the bottom, you have the third-worst offense with the Pistons.

Phoenix is the most obvious member of this group, with the ironic inclusion of analytics superstar Daryl Morey’s 76ers being the biggest surprise (to me, at least). Fittingly, both teams Kevin Durant played on fit into this category.

3: The Beautiful Ugly Game

Charlotte, Houston, Memphis, New Orleans, Orlando, San Antonio, Toronto

Epitomized by bad shooting, minimal passing, and the self-awareness to acknowledge that their best chance of scoring is to rebound their misses and try again, these teams are the heroes of brick fans everywhere. They chuck up inaccurate shots and they know it, so they score their points by chucking up as many inaccurate shots as possible. This category includes the four of the five worst offenses in the league — Charlotte, San Antonio, Houston, and Orlando — but other teams pull off the style much better, such as Memphis and Toronto, whose clunky offenses landed just outside the top 10 (at 11 and 13). Ideally, this style lets you make up for lacking offensive talent with physical talent and effort, though I doubt a team with this style will produce a top-tier offense anytime soon.

4: Paint Grinders

Denver, LA Lakers

They box you out. They play out of the elbow and the post, and they do it well. They take the most shots near the rim. While their seasons may have looked very different, the algorithm has spoken and put these two abnormal offenses together. Denver’s unique point center offense and the Lakers’ dependence on AD and old man LeBron resulted in a category that sounds like old school basketball but can look surprisingly fresh.

This was the most surprising category to me, as watching the Nuggets play offense felt quite different from watching the Lakers clunkily amble their way through offensive possessions. Additionally, the Lakers are one of the teams that underwent a huge midseason makeover, meaning some of their stats are averages of two different eras rather than reflections of what the team played like at any particular point.

5: Sunday Drivers

Cleveland, Indiana, Miami, New York

These teams have drive-heavy offenses, but don’t let that give you the impression that they play fast. This is the slowest-paced category, with methodical, turnover-proof drives used to compensate for the worst catch-and-shoot accuracy of any category. These teams all rely heavily on their ballhandlers to make offense happen and tend to use their bigs more as play finishers than play creators.

6: The Oklahoma City Thunder

A quick look at the Thunder roster and its dearth of big men should make the following no surprise: they are the least likely to play out of the post or the elbow, they have the fewest screen assists, and they are the least likely to box out on offense. Instead, they rely on running in transition and a steady onslaught of isolation drives from their guards and wings, leading to the most field goal attempts within 8 feet of all the categories (though they weren’t particularly good at finishing these attempts). But that doesn’t mean they can’t score; the Thunder had the highest points per isolation of any category. Their skewed roster and willingness to play to their strengths made them one of two teams that were placed into their own category.

7: The Golden State Warriors

Golden State’s offensive uniqueness is well-heralded (and something I’ve touched on before). In many ways they are the polar opposite of the Thunder: a churn of screens and passes and the fewest drives and isolations. This opens up a barrage of catch-and-shoot threes from some guys who you may have seen hit a few shots before. Their emphasis on scoring in the paint off of passes and only very rarely off of drives sets them apart from the Analytics Darlings; the Warriors rarely draw free throws or score points off of drives and were the most likely category to pass out of a drive to keep their offensive blender going.

Which types of offenses are we seeing in the playoffs?

The playoffs feature representatives from every category but one (though the Thunder did manage to make the play-in tournament), offering something for fans of every kind of NBA offense.

Analytics darlings: 3 out of 6 (Milwaukee, Boston, Sacramento)

Midrange maestros: 5 out of 8 (Philadelphia, Phoenix, LA Clippers, Brooklyn, Atlanta)

The Ugly Game: 1 out of 7 (Memphis)

Paint Grinders: 2 out of 2 (Denver and LA Lakers)

Sunday Drivers: 3 out of 4 (Cleveland, New York, Miami)

Thunder: Nope

Warriors: Yes

Statistics used to categorize teams

Screen Assists, Points off of screen assists

Percent of offensive box outs, offensive rebound percent

Pace, Transition frequency and points per possession

Field goal makes and attempts from: Less than 8 ft, 8-16ft, 16-24ft, 24+ feet

Catch and shoot: Frequency, Field goal percent, effective field goal percent, 2 point frequency and percent, 3 point frequency and percent

Pullup: Frequency, Field goal percent, effective field goal percent, 2 point frequency and percent, 3 point frequency and percent

Drives: Drives per game, fg% on drives, free throws attempted off of drives, points off of drives, points percent, pass percent, assist percent, turnover percent

Elbow touches: Touches per game, fg% on elbow touches, free throws attempted off of touches, points off of touches, points percent, pass percent, assist percent, turnover percent

Post ups: Post ups per game, fg% on post ups, free throws attempted off of post ups, points off of post ups, points percent, pass percent, assist percent, turnover percent

Passes made, assists, secondary assists

Isolation frequency and points per possession

2 thoughts on “Categorizing NBA Offenses with Machine Learning”

Leave a Reply