## Ranking NBA Players

The 2015-2016 NBA season is dawning upon us, and as usual, ESPN has been doing their usual #NBArank, where they are ranking players based on the following non-rigorous methodology:

We asked, “Which player will be better in 2015-16?” To decide, voters had to consider both the quality and quantity of each player’s contributions to his team’s ability to win games. More than 100 voters weighed in on nearly 30,000 pairs of players.

Of course, while I suspect this type of thing has to be just for fun , it has generated a great deal of controversy with many arguments ensuing between fans. For example, Kobe Bryant being ranked 93rd overall in the NBA this year gained a fair deal of criticism from Stephen A. Smith on ESPN First Take.

In general, at least to me, it does not make any sense to rank players from different positions that bring different strengths to a team sport such as basketball. That is, what does it really mean for Tim Duncan to be better than Russell Westbrook (or vice-versa), or Kevin Love to be better than Mike Conley (or vice-versa), etc…

From a mathematical/data science perspective, the only sensible thing to do is to take all the players in the league, and apply a clustering algorithm such as K-means clustering to group players of similar talents and contributions into groups. This is not a trivial thing to do, but it is the sort of thing that data scientists do all the time! For this analysis, I went to Basketball-Reference.com, and pulled out last season’s (2014-2015) per game averages of every player in the league, looking at 25 statistical factors from FGA, FG% to STL, BLK, and TOV. One can see that this is a 25-dimensional problem.

Our goal then is to consider the problem where denoting $C_{1}, ... C_{K}$ as sets containing the observations in each cluster, we want to solve the optimization problem:

$\mbox{minimize}_{C_{1},...C_{k}} \left\{\sum_{k=1}^{K} W(C_{k})\right\}$,

where $W$ is our distance measure. We use the squared Euclidean distance to define the within-cluster variation, and then solve:

The first thing to do is to decide how many clusters we want to use in our solution. This is done by looking at the within sum of squares (WSS) plot:

First, we will use 3 clusters in our K-means solution. In this case, the between sum of squares versus total sum of squares ratio was 77.0%, indicating a good “fit”). We use three clusters to begin with, because based on visual inspection, the data clusters very nicely into 3 clusters. The plots obtained were as follows:

The three clusters of players can be found in the following PDF File. Note that the blue circles represent Cluster 1, the red circles represent Cluster 2, and the green circles represent Cluster 3.

Next, we dramatically increase the number of clusters to 20 in our K-means solution.

Performing the K-means clustering, we obtain the following sets of scatter plots. (Note that, it is a bit difficult to display a 25×25 plot on here, so I have split them into a series of plots. Note also, that the between sum of squares versus total sum of squares ratio was 94.8 %, indicating a good “fit”):

The cluster behaviour can be seen more clearly in three dimensions. We now display some examples:

The 20 groups of players we obtained can be seen in the PDF file linked below:

nbastatsnewclusters

The legend for the clusters obtained was:

Two sample group clusters from our analysis are displayed below in the table. It is interesting that the analysis/algorithm provided that Carmelo Anthony and Kobe Bryant  belong in one group/cluster while LaMarcus Aldridge, Lebron James, and Dwyane Wade belong in another cluster.

 Group 16 Group 19 Arron.Afflalo.1 Steven.Adams Carmelo.Anthony LaMarcus.Aldridge Patrick.Beverley Bradley.Beal Chris.Bosh Andrew.Bogut Kobe.Bryant Jimmy.Butler Jose.Calderon DeMarre.Carroll Michael.Carter.Williams.1 Michael.Carter.Williams Darren.Collison Mike.Conley Goran.Dragic.1 DeMarcus.Cousins Langston.Galloway Anthony.Davis Kevin.Garnett DeMar.DeRozan Kevin.Garnett.1 Mike.Dunleavy Jeff.Green.2 Rudy.Gay George.Hill Eric.Gordon Jrue.Holiday Blake.Griffin Dwight.Howard Tobias.Harris Brandon.Jennings Nene.Hilario Enes.Kanter.1 Jordan.Hill Michael.Kidd.Gilchrist Serge.Ibaka Brandon.Knight.1 LeBron.James Kevin.Martin Al.Jefferson Timofey.Mozgov.2 Wesley.Johnson Rajon.Rondo.2 Brandon.Knight Derrick.Rose Kawhi.Leonard J.R..Smith.2 Robin.Lopez Jared.Sullinger Kyle.Lowry Thaddeus.Young.1 Wesley.Matthews Luc.Mbah.a.Moute Khris.Middleton Greg.Monroe Donatas.Motiejunas Joakim.Noah Victor.Oladipo Tony.Parker Chandler.Parsons Zach.Randolph Andre.Roberson Rajon.Rondo P.J..Tucker Dwyane.Wade Kemba.Walker David.West Russell.Westbrook Deron.Williams

If we use more clusters, players will obviously be placed into smaller groups. The following clustering results can be seen in the linked PDF files.

1. 50 Clusters – (between_SS / total_SS =  97.4 %) – PDF File
2. 70 Clusters – (between_SS / total_SS =  97.8 %) – PDF File
3. 100 Clusters – (between_SS / total_SS =  98.3 %) – PDF File
4. 200 Clusters (extreme case) – (between_SS / total_SS =  99.1 %) – PDF File

I did not include the visualizations for these computations because they are quite difficult to visualize.

Looking at the 100 Clusters file, we see two interesting results:

• In Cluster 16, we have: Carmelo Anthony, Chris Bosh, Kobe Bryant and Kevin Martin
• In Cluster 74, we have: LaMarcus Aldridge, Anthony Davis, Rudy Gay, Blake Griffin, LeBron James and Russell Westbrook

CONCLUSIONS:

We therefore see that is does not make much mathematical/statistical sense to compare and two pairs of players. In my opinion, the only logical thing to do when ranking players is to decide on rankings within clusters. So, based on the above analysis, it makes sense to ask for example whether Carmelo is a better player than Kobe or whether Lebron is a better player than Westbrook, etc… But, based on last season’s statistics, it doesn’t make much sense to ask whether Kobe is a better player than Westbrook, because they have been clustered differently. I think ESPN could benefit tremendously by using a rigorous approach to these sorts of things which spark many conversations because many people take them seriously.

## Breaking Down the Knicks’ Season

Like many of my fellow Knicks fans, I am in an absolute state of shock and disappointment as the Knicks are currently 5-29 to start the new year! Many analysts from the standard outlets, ESPN, Yahoo! sports, etc… have given their share of reasons why the Knicks are playing the way they are. Being a mathematical physicist and data scientist, I decided to see if one could deduce any useful information from how the Knicks have been playing to see what is the true reason why they are losing all of these games. Here is what I found. Based on the data available at Basketball-Reference.com,  I designed an algorithm in R to go through each game, and fit regression trees (Here is a link to more on regression trees if you are unfamiliar with the concept) and found the following:

1. The number of points the Knicks score per game:

From this regression tree, we see that if the Knicks for example make less than 33.5 FG’s in a game, and have a 3-Point shooting percentage of less than 0.309, they will be expected to score no more than 79 points in a game. On the other hand, if they make more than 38.5 FG’s in a game, and also attempt more than 19 free throws in a game, they can be expected to score more than 111 points in a game.

2. The number of points the Knicks’ opponents score per game:

From this regression tree, note that first “Tm” denotes how many points the Knicks score in a game. We see that for example, if the Knicks have less than 28 defensive rebounds in a game, also score less than 98 points in a game, and have fewer than 4-5 blocks in a game, their opponents will slightly outscore them, and win the game. In fact, if the Knicks manage to get less than 28-29 defensive rebounds per game, and score less than 98 points in a game, they will be expected to lose every game they play! Now, let’s say, the Knicks do manage to get more than 28 defensive rebounds in a game, if they still only manage to score less than 89 points in a game, they are still almost guaranteed to lose as well.

Although, many analysts have probably pointed these things out, the conclusion one draws from these regression tree analyses, is that the Knicks have a significant problem with defensive rebounding, as that seems to be the number one factor in them not winning games. Further, they also have a significant problem with how many points they score per game, which is a direct result of this Knicks team still not running their offense correctly.

Would Tyson Chandler have made a difference? As the above analyses show, no single factor determines whether the Knicks win games or not. It is reasonable to assume that if Tyson Chandler was on the team, then, the Knicks would get more than 28-29 defensive rebounds in a game. But, according to the above analyses, and the right of the previous regression team, if they still as a team would attempt more than 78-79 field goals, they would still be expected to lose every game. The question then remains would Tyson Chandler’s presence increase the Knicks’ offensive efficiency? In principle, according to his career FG% stats, I would say yes. According to Basketball-Reference.com, Tyson Chandler had a FG% of 0.638 while in New York, and for his career has a FG% of 0.588, which is quite high for NBA standards. It is quite reasonable to assume therefore, that the Knicks would have considerably less FGA’s (certainly less than 78-79) in a game, and their opponents would be held to around 91.0 points per game. One would conclude that from a statistical perspective, trading away Tyson Chandler was perhaps a mistake and had an overall negative impact on the team’s performance both defensively and offensively.