MerQuR+Statistics Glossary

Statistics Glossary → Elbow method and k-distance plot

Elbow method and k-distance plotconcept

A visual method for choosing clustering parameters that looks for the 'elbow', the point where the curve of a criterion plotted against the parameter clearly bends.

In k-means clustering the within-cluster sum of squares (WSS) always decreases as the number of clusters K grows, reaching zero at K = n, so choosing the smallest WSS is meaningless. In the elbow method WSS is plotted against K; the point where the curve passes from a steep drop to a gentle one is chosen as the place where extra clusters bring little further gain. For DBSCAN a k-distance plot is used instead: each point's distance to its k-th nearest neighbour is sorted and plotted; the point where the curve rises sharply gives a suitable value for the neighbourhood radius ε (k is usually set equal to the 'minimum samples' parameter).

The elbow is not always clear; if the curve declines smoothly, different people may pick different points. The elbow method should therefore be used together with numerical criteria such as the silhouette coefficient, the Calinski-Harabasz index or the gap statistic, and with subject knowledge. In data with clusters of very different density a single ε may not be suitable; HDBSCAN is more flexible in that case.

An everyday example

A supermarket chain wants to group its customers by spending behaviour. For K = 1 to 8, WSS is 1000, 620, 380, 300, 270, 250, 235 and 225. The drop is steep up to K = 3 and slow after that, so the elbow appears at K = 3, and the chain decides to work with three customer segments.

In MerQur

In k-means clustering the 'K-selection criteria table and Chart' option gives the within-cluster sum of squares (elbow) for K = 2-10 together with silhouette and Calinski-Harabasz. In DBSCAN / HDBSCAN the 'Chart' option includes the k-distance (elbow) plot and the automatic ε is the 90th percentile of the k-distances; in DBSCAN spatial clustering the k-distance (k = 4) knee point is written as the radius suggestion when the form opens.

Analyses where this concept appears

K-Means ClusteringDBSCAN / HDBSCANDBSCAN Spatial Clustering

Related concepts

Choosing the number of clustersε-neighbourhood and minimum points (DBSCAN)