Elbow method (clustering): Difference between revisions

Content deleted Content added
OAbot (talk | contribs)
m Open access bot: url-access updated in citation with #oabot.
 
(15 intermediate revisions by 14 users not shown)
Line 1:
{{Short description|Heuristic used in computer science}}
[[Image:DataClustering ElbowCriterion.JPG|thumb|right|300px|Explained variance. The "elbow" is indicated by the red circle. The number of clusters chosen should therefore be 4.]]
In [[cluster analysis]], the '''elbow method''' is a [[heuristic]] used in [[determining the number of clusters in a data set]]. The method consists of plotting the [[explained variation]] as a function of the number of clusters, and picking the [[elbow of the curve]] as the number of clusters to use. The same method can be used to choose the number of parameters in other data-driven models, such as the number of [[principal component]]s to describe a data set.
 
The method can be traced to speculation by [[Robert L. Thorndike]] in 1953.<ref>{{Cite journal
Line 11 ⟶ 12:
| date = December 1953
| doi = 10.1007/BF02289263
| s2cid = 120467216
}}</ref>
 
== Intuition ==
Line 18 ⟶ 20:
The intuition is that increasing the number of clusters will naturally improve the fit (explain more of the variation), since there are more parameters (more clusters) to use, but that at some point this is [[over-fitting]], and the elbow reflects this. For example, given data that actually consist of ''k'' labeled groups – for example, ''k'' points sampled with noise – clustering with more than ''k'' clusters will "explain" more of the variation (since it can use smaller, tighter clusters), but this is over-fitting, since it is subdividing the labeled groups into multiple clusters. The idea is that the first clusters will add much information (explain a lot of variation), since the data actually consist of that many groups (so these clusters are necessary), but once the number of clusters exceeds the actual number of groups in the data, the added information will drop sharply, because it is just subdividing the actual groups. Assuming this happens, there will be a sharp elbow in the graph of explained variation versus clusters: increasing rapidly up to ''k'' ([[under-fitting]] region), and then increasing slowly after ''k'' (over-fitting region).
 
== Criticism ==
In practice there may not be a sharp elbow, and as a heuristic method, such an "elbow" cannot always be unambiguously identified.<ref>See, e.g., {{Cite journal
The elbow method is considered both subjective and unreliable.
|first=David J. |last=Ketchen, Jr |first2=Christopher L. |last2=Shook | title = The application of cluster analysis in Strategic Management Research: An analysis and critique
In many practical applications, the choice of an "elbow" is highly ambiguous as the plot does not contain a sharp elbow.<ref>See, e.g., {{Cite journal
|firstfirst1=David J. |lastlast1=Ketchen, Jr |first2=Christopher L. |last2=Shook | title = The application of cluster analysis in Strategic Management Research: An analysis and critique
| journal = [[Strategic Management Journal]]
| volume = 17
Line 27 ⟶ 31:
| url = http://www3.interscience.wiley.com/cgi-bin/fulltext/17435/PDFSTART
| doi = 10.1002/(SICI)1097-0266(199606)17:6<441::AID-SMJ819>3.0.CO;2-G
| url-access = subscription
}}{{dead link|date=February 2019|bot=medic}}{{cbignore|bot=medic}}</ref> To overcome this, a quantity called "elbow strength" was introduced in 2021 and its success in determining the number of clusters in an automated way was demonstrated.<ref>{{Cite journal
}}{{dead link|date=February 2019|bot=medic}}{{cbignore|bot=medic}}</ref>
|author1=Pavel V. Kolesnichenko |author2=Qianhui Zhang |author3=Changxi Zheng |author4=Michael S. Fuhrer |author5=Jeffrey A. Davis | title = Multidimensional analysis of excitonic spectra of monolayers of tungsten disulphide: toward computer-aided identification of structural and environmental perturbations of 2D materials
This can even hold in cases where all other methods for [[determining the number of clusters in a data set]] (as mentioned in that article) agree on the number of clusters.
| journal = [[Machine Learning: Science and Technology]]
 
| volume = 2
[[File:Elbow in Inertia on uniform data.png|thumb|alt=Plot of the sum of squared errors (SSE) as k increases, following a typical 1/k shape.|Example of the typical "elbow" pattern used for choosing the number of clusters even emerging on uniform data.]]
| issue = 2
Even on uniform random data (with no meaningful clusters) the curve follows approximately the ratio ''1/k'' where ''k'' is the number of clusters parameter, causing users to see an "elbow" to mistakenly choose some "optimal" number of clusters.<ref name=":0" />
| pages = 025021
 
| year = 2021
Because the two axes (the number of clusters and the remaining variance) have no semantic relationship, various attempt to capture the elbow by "slope" are ill-defined and sensitive to the parameter range.<ref name=":0">{{Cite journal |last=Schubert |first=Erich |date=2023-07-05 |title=Stop using the elbow criterion for k-means and how to choose the number of clusters instead |url=https://doi.org/10.1145/3606274.3606278 |journal=ACM SIGKDD Explorations Newsletter |volume=25 |issue=1 |pages=36–42 |doi=10.1145/3606274.3606278 |issn=1931-0145|arxiv=2212.12189 }}</ref> Increasing the maximum number of clusters can change the ___location of the perceived "elbow", and in many cases alternate heuristics such as the [[Calinski–Harabasz index|variance-ratio-criterion]] or the [[Silhouette (clustering)|average silhouette width]] are considered to be more reliable.<ref name=":0" /> But even with such measures, the results may depend much on the data preprocessing (feature selection and scaling) and users may come to very different clustering results on the same data.
| url = https://iopscience.iop.org/article/10.1088/2632-2153/abd87c
| doi = 10.1088/2632-2153/abd87c
}}</ref>
 
== Measures of variation ==
There are various measures of "[[explained variation]]" used in the elbow method. Most commonly, varia''tion''variation is quantified by ''[[variance|]]''variance'']], and the ratio used is the ratio of between-group variance to the total variance. Alternatively, one uses the ratio of between-group variance to within-group variance, which is the one-way [[ANOVA]] [[F-test statistic|''F''-test statistic]].<ref>See, e.g., Figure 6 in
* {{Cite journal
| firstfirst1 = Cyril | lastlast1 = Goutte
| first2 = Peter | last2 = Toft
| first3 = Egill | last3 = Rostrup
Line 55 ⟶ 57:
| pmid = 10075900
| citeseerx = 10.1.1.29.2679
| s2cid = 14147564
}}</ref>