<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alex Cheng on Medium]]></title>
        <description><![CDATA[Stories by Alex Cheng on Medium]]></description>
        <link>https://medium.com/@alexcheng_?source=rss-684e7f985e16------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*g5mXPFRLB-sDg1R06NAoHg.jpeg</url>
            <title>Stories by Alex Cheng on Medium</title>
            <link>https://medium.com/@alexcheng_?source=rss-684e7f985e16------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 20:26:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alexcheng_/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Optimizing NBA Fantasy Lineups with Python]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/@alexcheng_/optimizing-nba-fantasy-lineups-with-python-67f1033e5fa9?source=rss-684e7f985e16------2"><img src="https://cdn-images-1.medium.com/max/718/1*B36ZMl480TXbsnE6zCtlMw.png" width="718"></a></p><p class="medium-feed-snippet">Using integer programming to determine optimal lineups for fantasy sports</p><p class="medium-feed-link"><a href="https://medium.com/@alexcheng_/optimizing-nba-fantasy-lineups-with-python-67f1033e5fa9?source=rss-684e7f985e16------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@alexcheng_/optimizing-nba-fantasy-lineups-with-python-67f1033e5fa9?source=rss-684e7f985e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/67f1033e5fa9</guid>
            <category><![CDATA[nba]]></category>
            <category><![CDATA[daily-fantasy-sports]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Alex Cheng]]></dc:creator>
            <pubDate>Wed, 31 May 2023 05:02:17 GMT</pubDate>
            <atom:updated>2023-05-31T05:02:17.755Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Calculate Plus Minus (+/-) from NBA play-by-play data using Python]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/fastbreak-data/how-to-calculate-plus-minus-from-nba-play-by-play-data-using-python-569690eaff87?source=rss-684e7f985e16------2"><img src="https://cdn-images-1.medium.com/max/602/1*biSdCmzG_JoISIv4aTh4Gw.jpeg" width="602"></a></p><p class="medium-feed-snippet">Have you ever wondered how NBA statisticians aggregate box scores from the play-by-plays after an NBA game?</p><p class="medium-feed-link"><a href="https://medium.com/fastbreak-data/how-to-calculate-plus-minus-from-nba-play-by-play-data-using-python-569690eaff87?source=rss-684e7f985e16------2">Continue reading on Fastbreak Data »</a></p></div>]]></description>
            <link>https://medium.com/fastbreak-data/how-to-calculate-plus-minus-from-nba-play-by-play-data-using-python-569690eaff87?source=rss-684e7f985e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/569690eaff87</guid>
            <category><![CDATA[nba]]></category>
            <category><![CDATA[data-wrangling]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Alex Cheng]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 21:07:03 GMT</pubDate>
            <atom:updated>2020-07-23T21:07:03.830Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to Calculate Plus Minus (+/-) From NBA Play-By-Play Data Using Python]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/swlh/how-to-calculate-nba-plus-minus-from-play-by-play-data-using-python-1ef4f7f9377c?source=rss-684e7f985e16------2"><img src="https://cdn-images-1.medium.com/max/602/1*biSdCmzG_JoISIv4aTh4Gw.jpeg" width="602"></a></p><p class="medium-feed-snippet">Have you ever wondered how NBA statisticians aggregate box scores from the play-by-plays after an NBA game?</p><p class="medium-feed-link"><a href="https://medium.com/swlh/how-to-calculate-nba-plus-minus-from-play-by-play-data-using-python-1ef4f7f9377c?source=rss-684e7f985e16------2">Continue reading on The Startup »</a></p></div>]]></description>
            <link>https://medium.com/swlh/how-to-calculate-nba-plus-minus-from-play-by-play-data-using-python-1ef4f7f9377c?source=rss-684e7f985e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ef4f7f9377c</guid>
            <category><![CDATA[nba]]></category>
            <category><![CDATA[data-wrangling]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Alex Cheng]]></dc:creator>
            <pubDate>Thu, 23 Jul 2020 16:43:36 GMT</pubDate>
            <atom:updated>2020-07-25T21:55:10.726Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[3 Tips on Winning in Fantasy Basketball]]></title>
            <link>https://medium.com/fastbreak-data/3-tips-on-winning-in-fantasy-basketball-c5243d32605c?source=rss-684e7f985e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/c5243d32605c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[nba]]></category>
            <category><![CDATA[fantasy-basketball]]></category>
            <dc:creator><![CDATA[Alex Cheng]]></dc:creator>
            <pubDate>Tue, 26 May 2020 03:53:42 GMT</pubDate>
            <atom:updated>2020-05-26T17:59:23.950Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*Z4uH-KrBCOBoTWKYJz5Wdw.png" /></figure><p>While NBA fans are patiently waiting for the 2019–2020 season to resume, we found some time in quarantine to dig into fantasy basketball data. These tips may shed some light on winning in your league whether it is your first time playing fantasy basketball or if you are a seasoned fantasy veteran.</p><p><strong>Disclaimer</strong>: This analysis was based only on the 2018–2019 NBA season due to the cost of data, and encapsulates player box scores and their respective daily fantasy scores. The figures presented here are for informational purposes only and do not represent a definitive study because of the small sample size.</p><p>In addition, the competitive fantasy player also takes into consideration the difference in game formats (i.e. rotisserie vs head-to-head), as the goal of this Medium post is to present tips on maximizing overall fantasy score.</p><ol><li><strong>Scoring is important in the early rounds, but multi-category players become more valuable in the later rounds.</strong></li></ol><p>Back in 2017, the NBA embraced fantasy basketball by adopting an <a href="https://www.espn.com/fantasy/basketball/story/_/id/20916781/fantasy-basketball-nba-embraces-fantasy-basketball-introduces-official-scoring-system">official fantasy scoring system</a>. The scoring system includes six categories: a point is worth one point, rebounds worth 1.2 points, assists worth 1.5 points, steals and blocks are both worth 3 points, and turnovers are -1 points. While this is common knowledge for the seasoned fantasy player, it still begs to question what stats should a fantasy player focus on? And do punt strategies win?</p><p>In our analysis of the 2018–2019 NBA season, we used a Random Forest, which is a tree-based, machine learning algorithm that uses a collection of decision trees to perform classification or regression tasks. Decision trees consist of multiple nodes testing an attribute on some feature, and the advantage of pooling multiple decision trees significantly increases the robustness of the modeling process. Furthermore, the feature importance method for Random Forests is extremely valuable as it shows what features contributed to, and to what scale, the drivers behind the model. So what does this mean?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*yAW5n9uJ9xnK4CTzHuAKSg.png" /></figure><p>When predicting fantasy score, the feature importance shows that points are, by far, the most important feature. The next important features, to a lesser degree, are total rebounds, assists, steals, and blocks. So does that mean one should focus solely on players that score? Not necessarily. The competitive fantasy player should also consider specific positions that offer multi-category stats.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/617/1*nPg3YD2AIXzh5gtnP0slhg.png" /></figure><p>In the late rounds, there are scorers still available but when you compare their fantasy output to other players, a trend emerges. Take for example players such as Tim Hardaway Jr. or Bojan Bogdanovic compared to players such as Josh Richardson and Malcolm Brogdon (see above). Because Josh Richardson and Malcolm Brogdon also have point guard responsibilities, their overall fantasy scores see a slight uptick despite scoring less. More on that below.</p><p><strong>2. It’s a star-driven league but centers and point guards offer the most ROI.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*F1MAG31rSigDLqA2cX9LYA.png" /></figure><p>In our analysis of top fantasy scores, it is obvious that drafting superstar players in the early rounds are key to building a top-notch fantasy team. In the 2018–2019 NBA season, there were 6 players that averaged 50+ fantasy points, and 19 players that averaged scores in the 40–49 range. If you are in an H2H 12-team league, you need to draft 2 of these players in the first two rounds in order to be competitive.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/864/1*Z4uH-KrBCOBoTWKYJz5Wdw.png" /></figure><p>But what about in the middle and late rounds? In our analysis, it seems that, on average, centers and point guards offered higher fantasy points than shooting guards and small forwards. This would support our earlier feature importance assessment as centers are more likely to collect rebounds and blocks while point guards more likely to get assists and steals.</p><p>So what does this say about shooting guards and small forwards? While there are definitely quality players in those positions that offer great value, late-round shooting guards and small forwards may score but lack in other categories such as rebounds, assists, steals, or blocks.</p><p>This makes sense in today’s NBA. Shooting guards and small forwards playing the 3-and-D role help space the floor with wing shooting, and as such, maybe in a more limited ball-handling role. In comparison, centers are often tasked with rebounding the ball and defending the rim and point guards with distributing the ball and defending the opponent’s primary ball-handler. While shooting guards and small forwards may be collecting defensive stats, one could argue that drafting another point guard could not only help with steals and another power forward/center with blocks but also still help your team with assists and rebounds, respectively.</p><p><strong>3. Slow starts are part of the game but centers, point guards, and shooting guards see improvement toward the playoffs.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*54XENWYBInARQyHswgDqZA.png" /></figure><p>Slow starts to the season happen to players for any number of reasons but is there an observable trend happening? Earlier in our analysis, we saw how, on average, centers and point guards offered the most value. By plotting the trend of average fantasy scores by position over time, it seems that centers, point guards, and shooting guards saw an improvement over the course of the season.</p><p>This makes sense as players coming into the season may not be in game-shape and typically their conditioning improves over the course of the season. But what’s interesting is that small forwards and power forwards declined closer to the playoffs from a fantasy score perspective. While it’s not exactly clear why this is the case, one hypothesis may be that small forwards and power forwards are more likely to be injury-prone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EWkdDTdm5-HGUkWDkAFvGg.png" /></figure><p>To test this hypothesis, we used a proxy for injuries by looking at “Days Rest” by “Position”. This showed a similar picture in the 2018–2019 NBA season, as small forwards and power forwards averaged a higher number of rest days throughout the season and saw spikes at key points in the NBA season, specifically during the Christmas and All-Star breaks.</p><p>For more information, please check out my <a href="https://github.com/acheng1230/Udacity_DataScientist_Nanodegree/tree/master/Project_01">GitHub</a> where I’ve uploaded my data, code, and analysis. Thanks for reading and until next time!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c5243d32605c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fastbreak-data/3-tips-on-winning-in-fantasy-basketball-c5243d32605c">3 Tips on Winning in Fantasy Basketball</a> was originally published in <a href="https://medium.com/fastbreak-data">Fastbreak Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mixing Art and the NBA]]></title>
            <link>https://medium.com/fastbreak-data/mixing-art-and-the-nba-17d22fcadc5a?source=rss-684e7f985e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/17d22fcadc5a</guid>
            <category><![CDATA[nba]]></category>
            <category><![CDATA[tensorflow]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[art]]></category>
            <dc:creator><![CDATA[Alex Cheng]]></dc:creator>
            <pubDate>Fri, 24 Mar 2017 19:12:44 GMT</pubDate>
            <atom:updated>2017-03-24T19:13:56.315Z</atom:updated>
            <content:encoded><![CDATA[<h4>Stylistically transforming these NBA MVP candidates with Deep Learning</h4><p>Using Google’s TensorFlow, you can add styles from any famous painting onto a picture of your own. Explaining how it works is beyond my power, but for more information check out the GitHub repo <a href="https://github.com/lengstrom/fast-style-transfer">here</a>. Below are a few images from this year’s MVP candidates.</p><p>The artworks that these images were inspired from are below:</p><ul><li>Leonid Afremov’s “Rain Princess”</li><li>Joseph Mallord William Turner’s “The Shipwreck of the Minotaur”</li><li>Pablo Picasso’s “La Muse”</li><li>Francis Picabia’s “Udnie”</li><li>Edvard Munch’s “The Scream”</li><li>Katsushika Hokusai’s “The Great Wave off Kanagawa”</li></ul><h4>James Harden, Houston Rockets</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JX48G6O0VMbSn9_Gok4_0w.jpeg" /><figcaption>“The Creator” inspired by Leonid Afremov’s “Rain Princess”</figcaption></figure><h4>Russell Westbrook, Oklahoma City Thunder</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*PUz1eNTuiJmYLeOdXgF8iQ.jpeg" /><figcaption>“The Triple-Double Threat” inspired by Joseph Mallord William Turner’s “The Shipwreck of the Minotaur”</figcaption></figure><h4>LeBron James, Cleveland Cavaliers</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*gpn3v5Xo0nULqWJt4J6S5w.jpeg" /><figcaption>“The King”, inspired by Leonid Afremov’s “Rain Princess”</figcaption></figure><h4>Isaiah Thomas, Boston Celtics</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2MM8Ohrko2_fWROaSc0msg.jpeg" /><figcaption>“The Little Man” inspired by Pablo Picasso’s “La Muse”</figcaption></figure><h4>Kawhi Leonard, San Antonio Spurs</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-i3yF0pK9h_JJFhAWPV9A.jpeg" /><figcaption>“The Klaw” inspired by Francis Picabia’s “Udnie”</figcaption></figure><h3>BONUS</h3><h4>DeMar DeRozan, Toronto Raptors</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*gDPmium1woEGJQGmv_OQIQ.png" /><figcaption>“The Dagger” inspired by Edvard Munch’s “The Scream”</figcaption></figure><h4>Stephen Curry, Golden State Warriors</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*MWvkvkWlwPVVPzkOMpHAtw.png" /><figcaption>“The Splash Brothers” inspired by Katsushika Hokusai’s “The Great Wave off Kanagawa”</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=17d22fcadc5a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fastbreak-data/mixing-art-and-the-nba-17d22fcadc5a">Mixing Art and the NBA</a> was originally published in <a href="https://medium.com/fastbreak-data">Fastbreak Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Machine Learning to Find the 8 Types of Players in the NBA]]></title>
            <link>https://medium.com/fastbreak-data/classifying-the-modern-nba-player-with-machine-learning-539da03bb824?source=rss-684e7f985e16------2</link>
            <guid isPermaLink="false">https://medium.com/p/539da03bb824</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[sports-analytics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[nba]]></category>
            <category><![CDATA[basketball]]></category>
            <dc:creator><![CDATA[Alex Cheng]]></dc:creator>
            <pubDate>Thu, 02 Mar 2017 10:24:16 GMT</pubDate>
            <atom:updated>2017-03-09T12:16:19.085Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dh0twSUX0MZVGay1VlBWIw.jpeg" /><figcaption><strong><em>What do the axes mean?</em></strong> Using Linear Discriminant Analysis, I reduced over 50 dimensions (i.e. USG%, TS%, 3P%, AST%, BLK%, etc.) into 2 dimensions (i.e. principal components) which make up the (x,y) coordinates. These 2 principal components are essentially linear combinations of the original dimensions, and can be plotted on an XY plane for clustering and analysis.</figcaption></figure><h3><strong>Introduction</strong></h3><p>Inspired by the topological data analysis of Muthu Alagappan in “<a href="http://www.sloansportsconference.com/wp-content/uploads/2012/03/Alagappan-Muthu-EOSMarch2012PPT.pdf">From 5 to 13: Redefining the Positions in Basketball</a>” and the “Periodic Table of NBA Elements” by Stephen Shea in <a href="http://www.basketballanalyticsbook.com/"><em>Basketball Analytics: Spatial Tracking</em></a>, this study proposes an alternative method in which to classify players in today’s NBA.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*43Zhk95B0X78eskCa5LOXA.png" /><figcaption>Traditional 5 positions in basketball (<a href="https://www.myactivesg.com/sports/basketball/how-to-play/basketball-rules/basketball-positions-and-roles">https://www.myactivesg.com/sports/basketball/how-to-play/basketball-rules/basketball-positions-and-roles</a>)</figcaption></figure><p>Both Alagappan and Shea presented a problem statement that still holds true today. The traditional five player positions incorrectly oversimplify the skill sets of NBA players. Simply pigeon-holing players into one of five positions does not accurately define a player’s specific skill set. Moreover, the misclassification of a player’s position may lead teams to waste resources on developing draft picks that do not fit their systems.</p><p>Coaches and scouts in the NBA already recognize players as having skills that exceed their predefined positions and have even come up with alternative position names to describe players such as the <a href="https://en.wikipedia.org/wiki/Combo_guard">combo guard</a> (i.e. a player that combines the attributes of a point guard and shooting guard) or the <a href="https://en.wikipedia.org/wiki/Swingman">swingman</a> (i.e. a player that can play both the shooting guard and small forward positions). Using machine learning, my goal is to uncover the positions that are intrinsic to today’s NBA players and classify players with a position that best encapsulates their skill sets.</p><h3><strong>Methods</strong></h3><p>The methods described below attempt to summarize the variety of applications and machine learning algorithms in layman’s terms. All programming was done in Python 2.7.</p><p><strong>Step 1: Data Acquisition with Selenium</strong></p><p><a href="http://selenium-python.readthedocs.io/">Selenium</a> is a popular web automation application that can be used for web scraping purposes. For this study, I used Selenium to scrape <a href="http://www.basketball-reference.com/">Basketball-Reference.com</a> for my data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6tDALTxPy0bQZUVSIvn7rA.png" /><figcaption>Can you guess who this player is? (<a href="http://www.basketball-reference.com/players/w/westbru01.html">http://www.basketball-reference.com/players/w/westbru01.html</a>)</figcaption></figure><p>To best define a player, I identified a player’s career statistics from <a href="http://www.sports-reference.com/blog/2014/06/introducing-per-100-possessions-statistics/">Per-100 Possessions</a>, <a href="http://bleacherreport.com/articles/1813902-advanced-nba-stats-for-dummies-how-to-understand-the-new-hoops-math">Advanced Metrics</a> and Shooting Metrics. Using rate statistics (i.e. points per game) or cumulative statistics (i.e. total points) can be misleading when it comes to analysis because these statistics tend to inflate players with lengthier careers. To deal with outliers, I instituted a minimum threshold of 40 games played.</p><p>Prior to analysis, my data consisted of 547 players and 56 features (or dimensions) from 2014 to 2017. While this was definitely a small sample size, my goal was to uncover the various positions in today’s NBA rather than comparing today’s NBA players with those from stylistically different generations.</p><p><em>Note: The 2016–2017 data includes everything up until the NBA All-Star Break.</em></p><p><strong>Step 2: Dimensionality Reduction with Linear Discriminant Analysis</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/887/1*5Dbw-vLC6B0CzDFSEdPpdg.png" /><figcaption>As dimensions increase, the available data becomes more and more sparse.(<a href="http://www.visiondummy.com/2014/04/curse-dimensionality-affect-classification/">http://www.visiondummy.com/2014/04/curse-dimensionality-affect-classification/</a>)</figcaption></figure><p>In high-dimensional data, the volume of space increases leading to the available data to become sparse. This is known as the “<a href="http://www.stat.ucla.edu/~sabatti/statarray/textr/node5.html">Curse of Dimensionality</a>” and is problematic for any method that requires statistical significance. In this study, each dimension is represented by a player’s feature statistics (i.e. PER, TS%, 3P%, etc.) and in order to obtain a statistically sound result, the amount of data must be reduced by obtaining a set of principal components.</p><p><a href="http://scikit-learn.org/stable/modules/lda_qda.html">Linear Discriminant Analysis (LDA)</a> is a a method used in statistics and machine learning to find a linear combination of features that characterizes or separates classes of objects. Put simply, LDA attempts to find a feature subspace that maximizes class separability. In this case, I used a player’s current position (i.e. point guard, shooting guard, small forward, power forward, and center) as the prior class. Next LDA found the linear combination of features that best separated the five classes and reduced the dimensions of the data into two dimensions. While Principal Component Analysis (PCA) is also a method for dimensionality reduction, I captured 71.85% of the data in two components with LDA while only capturing 54.46% of the data in two components with PCA.</p><p><strong>Step 3: Cluster the Data with KMeans Clustering</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*4mMckJCPtQNUy7hm8gCLkg.gif" /><figcaption>Here is some R code which generates a data set and implements the algorithm (<a href="http://rossfarrelly.blogspot.com/2012/12/k-means-clustering.html">http://rossfarrelly.blogspot.com/2012/12/k-means-clustering.html</a>)</figcaption></figure><p><a href="http://scikit-learn.org/stable/modules/generated/sklearn.cluster.KMeans.html">KMeans Clustering</a> is a simple and popular clustering algorithm that finds the cluster centers that best represent certain regions of the data. The algorithm alternates between assigning each data point to the closest cluster center and then setting each cluster center as the mean of the data points that are assigned to it. The algorithm finishes when the assignment of instances to clusters no longer changes.</p><p>The decision to have 8 clusters was based on the best <a href="http://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_silhouette_analysis.html">silhouette score</a>, which is a measure of how similar an object is to its own cluster compared to other clusters. The silhouette score ranges from -1 to 1, where a high value indicates that an object is well matched to its own cluster and poorly matched to neighboring clusters. If the clusters have a high value, then the clustering configuration is appropriate.</p><p><strong>Step 4: Feature Extraction with Principal Component Analysis</strong></p><p><a href="http://scikit-learn.org/stable/modules/generated/sklearn.decomposition.PCA.html">Principal Component Analysis (PCA)</a> is a common feature extraction method in machine learning. The algorithm finds the eigenvectors of a covariance matrix with the highest eigenvalues and then uses those values to project the data into a new subspace of equal or less dimensions. In feature extraction, PCA reduces the number of features by constructing a smaller number of variables that capture a significant portion of the data found in the original features. Using PCA, I identified the most important features in order to define each cluster.</p><p><strong>Step 5: Data Visualization with Tableau</strong></p><p>Tableau is a powerful application that renders data in a clean and concise way. In the plots below, I map out the total number of clusters in the NBA and highlight each cluster in detail as well as explore some Advanced Metrics for each cluster.</p><h3><strong>Results</strong></h3><p><em>Note: Due to technological constraints I was unable to include a table of each cluster’s feature importance, but would be happy to provide it. Please message me at @fastbreakdata.</em></p><p><strong>Defensive Centers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hTzCYlSWUaqMB5lWq-bsrQ.jpeg" /></figure><p><em>Notable Players (in no particular order): DeAndre Jordan, Rudy Gobert, Hassan Whiteside, Andre Drummond, Karl-Anthony Towns, DeMarcus Cousins</em></p><p><strong>3-and-D Wings</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-5fJBaXiJltDQf3spDmTkg.jpeg" /></figure><p><em>Notable Players (in no particular order): Kevin Durant, Klay Thompson, Kawhi Leonard, Jae Crowder, Trevor Ariza, Nicolas Batum</em></p><p><strong>Scoring Wings</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YE5Z2dPrm9WpTGrb_M_hCQ.jpeg" /></figure><p><em>Notable Players (in no particular order): LeBron James, James Harden, Dwayne Wade, Lou Williams, Eric Gordon, Manu Ginobili, Joe Johnson</em></p><p><strong>Versatile Forwards</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDRfNmp4b3evEggm1TnN1w.jpeg" /></figure><p><em>Notable Players (in no particular order): Dirk Nowitzki, Giannis Antetokounmpo, Draymond Green, Ryan Anderson, Boris Diaw</em></p><p><strong>Floor Generals</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aqWulqanReuVDzu7BQpqgg.jpeg" /></figure><p><em>Notable Players (in no particular order): Chris Paul, John Wall, Rajon Rondo, Ricky Rubio, Jeff Teague, Dennis Schroder</em></p><p><strong>Shooting Wings</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_kJyZOjlIZr2j4HHX6p4LQ.jpeg" /></figure><p><em>Notable Players (in no particular order): Avery Bradley, Kentavious Caldwell-Pope, Devin Booker, J.J. Redick, Gary Harris</em></p><p><strong>Combo Guards</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PwcDjJmP2WO_C9r0A8GQCQ.jpeg" /></figure><p><em>Notable Players (in no particular order): Russell Westbrook, Stephen Curry, Jrue Holiday, Mike Conley, Kyrie Irving, Damian Lillard, Jeremy Lin</em></p><p><strong>Offensive Centers</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0fsExvVBjIdyddMmYNJTcA.jpeg" /></figure><p><em>Notable Players (in no particular order): Anthony Davis, Kristaps Porzingis, Brook Lopez, Al Horford, Kevin Love, Blake Griffin</em></p><h3>Advanced Metrics by Position</h3><p>Now that we have classified NBA players into their natural positions, let’s take a look at some of the Advanced Metrics by position.</p><p><strong>Average Win Shares by Position</strong></p><p>Offensive Win Share is an estimate of the number of wins contributed by a player due to his offense. Defensive Win Share is the estimate of the number of wins contributed by a player due to his defense. Finally, Win Share is an estimate of the number of wins contributed by a player.</p><p>What’s quite revealing about this graph is the huge drop-off in Win Shares for Offensive Centers. A recent article by <a href="https://fivethirtyeight.com/features/does-jahlil-okafor-have-a-place-in-todays-nba/">FiveThirtyEight</a> questioned whether Jahlil Okafor, an Offensive Center, had a place in today’s NBA as a starting center. So far, it seems as though today’s NBA teams are, in fact, putting less and less value on Offensive Centers who cannot protect the rim.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8P3FQgg_HIGM3vYAstwj9Q.jpeg" /></figure><p><strong>Value Over Replacement Player (VORP) by Position</strong></p><p>Value Over Replacement Player is a statistic spearheaded by <a href="http://www.espn.com/mlb/hotstove06/columns/story?id=2751842&amp;columnist=neyer_rob">Keith Woolner</a>. VORP demonstrates how a “replacement player” performing at a “replacement level” provides a baseline in which to compare how much a player contributes to his team’s success. As seen in the Average Win Shares graph, Offensive Centers suffer the most in the VORP metric while Floor General-type point guards excel with Scoring Wings following right behind.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mit8k8qj2lsoOF1O1X7bOg.jpeg" /></figure><p><strong>Player Efficiency Rating (PER) by Position</strong></p><p>ESPN.com columnist <a href="http://www.basketball-reference.com/about/per.html">John Hollinge</a>r first developed the Player Efficiency Rating (PER), a metric that measures a per-minute rating. In John’s words:</p><blockquote>“The PER sums up all a player’s positive accomplishments, subtracts the negative accomplishments, and returns a per-minute rating of a player’s performance.”</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5SVWLcbngNOGN-R_aHnIJA.jpeg" /></figure><h3>Top 5-Man Lineups</h3><p>This classification method can also determine which 5-man combinations excel in today’s NBA. While exploring the best 5-man combinations deserves more time and consideration, let’s just take a quick look at this season’s top 5-man lineups and see what type of players are in each lineup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j5CxWWNQxo0CKTFFgp24uQ.jpeg" /><figcaption>NBA Lineups (Source: <a href="http://stats.nba.com/lineups/traditional/#!?sort=PLUS_MINUS&amp;dir=1">http://stats.nba.com/lineups/traditional/#!?sort=PLUS_MINUS&amp;dir=1</a>)</figcaption></figure><p><strong>Cleveland Cavaliers</strong></p><ul><li>Kyrie Irving (Combo Guard)</li><li>Lebron James (Scoring Wing)</li><li>DeAndre Liggins (3-and-D Wing)</li><li>Kevin Love (Offensive Center)</li><li>Tristan Thompson (Defensive Center)</li></ul><p><strong>Utah Jazz</strong></p><ul><li>Boris Diaw (Versatile Forward)</li><li>Dante Exum (Scoring Wing)</li><li>Rudy Gobert (Defensive Center)</li><li>Gordon Hayward (Shooting Wing)</li><li>Rodney Hood (Shooting Wing)</li></ul><p><strong>Golden State Warriors</strong></p><ul><li>Stephen Curry (Combo Guard)</li><li>Kevin Durant (3-and-D Wing)</li><li>Zaza Pachulia (Offensive Center)</li><li>Klay Thompson (3-and-D Wing)</li><li>Draymond Green (Versatile Forward)</li></ul><p><strong>Washington Wizards</strong></p><ul><li>Bradley Beal (Shooting Wing)</li><li>Marcin Gortat (Defensive Center)</li><li>Markieff Morris (Versatile Forward)</li><li>Otto Porter (3-and-D Wing)</li><li>John Wall (Floor General)</li></ul><p><strong>Los Angeles Clippers</strong></p><ul><li>Blake Griffin (Offensive Center)</li><li>DeAndre Jordan (Defensive Center)</li><li>Luc Mbah a Moute (Versatile Forward)</li><li>Chris Paul (Floor General)</li><li>J.J. Redick (Shooting Wing)</li></ul><p><strong>Quick Observations</strong></p><p>Just glancing over these lineups, I noticed that teams with Offensive Centers compensate by pairing them with Defensive Centers or defensive players to protect the rim. This season, Warriors have begun using Kevin Durant as a rim protector, hence the compensation for Zaza’s inability to protect the rim. Both Kevin Love and Blake Griffin have Defensive Centers behind them, but have 3-point shooting in their game to keep them on the floor.</p><p>Another thing I noticed was the presence of Versatile Forwards in 4/5 lineups. This invaluable group of players was by far the most interesting position that I uncovered in the classification. They ranged from players that can be referred to as Stretch-4s like Ryan Anderson and Channing Frye to players like Boris Diaw, Giannis Antetokounmpo, and Draymond Green. But again, further investigation will need to be done to learn more about these Versatile Forward players.</p><h3><strong>Conclusion</strong></h3><p>Using machine learning, I classified NBA players by their feature statistics into natural clusters that best match their skill sets. The clusters that the algorithms have constructed identify which features are most important to a player and group them in such a way that is easily interpretable and inherently understood by players, coaches, and fans alike.</p><p>While further investigation into play-by-play data and an analysis of every player in NBA history may also enrich and improve the results, it is evident that the natural clusters in just a three-year timespan immediately define more than five positions in basketball. In addition, a more in-depth exploration into each cluster may reveal insight into how teams can scout and develop the next Manu Ginobili or Draymond Green.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Ut2CdLMdpeVb7PICTKWbzA.png" /><figcaption>Cork Gaines/Business Insider (<a href="http://www.businessinsider.com/nba-three-point-shooting-2016-3">http://www.businessinsider.com/nba-three-point-shooting-2016-3</a>)</figcaption></figure><p>While both Alagappan and Shea brought unique approaches to player classification, I argue that there is not an absolute nor correct number of positions in basketball. Trends in the NBA are constantly changing and this study was intended to provide just a snapshot of today’s NBA players.</p><p>The clusters that the machine learning algorithms created are specifically fit to today’s NBA players and, as recent trends suggest, there will always be new players that completely defy prior expectations of positional roles.</p><iframe src="https://cdn.embedly.com/widgets/media.html?type=text%2Fhtml&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;schema=twitter&amp;url=https%3A//twitter.com/tommybeer/status/830596623164137472&amp;image=https%3A//i.embed.ly/1/image%3Furl%3Dhttps%253A%252F%252Fpbs.twimg.com%252Fprofile_images%252F445550966365224960%252FfP7O4N7h_bigger.jpeg%26key%3D4fce0568f2ce49e8b54624ef71a8a5bd" width="500" height="185" frameborder="0" scrolling="no"><a href="https://medium.com/media/eaef090ed4e7d2732ce60f0c5e787768/href">https://medium.com/media/eaef090ed4e7d2732ce60f0c5e787768/href</a></iframe><p>Conducting this type of analyses at the collegiate level may also present telling results. With collegiate player data, scouts and front office executives may have a better understanding of whom to compare that collegiate player with in the NBA.</p><p>It is my hope that teams incorporate the results of this study to maximize the skill sets of their players and design offensive and defensive schemes that best put players in positions to succeed. I envision the results of this study having the most impact for teams defensively. Teams indubitably are cognizant of the strengths and weaknesses of their players, but during the season, innately knowing whether or not an opponent is going to pass, drive, or shoot may make all the difference in a late game possession.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=539da03bb824" width="1" height="1" alt=""><hr><p><a href="https://medium.com/fastbreak-data/classifying-the-modern-nba-player-with-machine-learning-539da03bb824">Using Machine Learning to Find the 8 Types of Players in the NBA</a> was originally published in <a href="https://medium.com/fastbreak-data">Fastbreak Data</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>