The Elbow method
One of the questions that may have arisen when implementing K-means could have been "how do I know that the target number of clusters is the best or most representative for the dataset?"
For this task, we have the Elbow method. It consists of a unique statistical measure of the total group dispersion in a grouping. It works by repeating the K-means procedure, using an increasing number of initial clusters, and calculating the total intra-cluster internal distance for all the groups.
Normally, the method will start with a very high value (except if we start with the right number of centroids), and then we will observe that the total intra-cluster distance drops quite quickly, until we reach a point where it doesn't change ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access