Choosing k
As stated in the previous subsection, choosing a good value of k is vital to the success of the k-means clustering algorithm. The number of clusters can be anywhere between 1 and the total number of data points (where each point is assigned to its own cluster).
Data in the real world is seldom of the type explored previously, where the points formed well defined, visually separable clusters on a two-dimensional plane. There are several methods available to determine a good value of K. In this section, we will explore the Elbow method of determining k.
The Elbow method computes the sum of squares for each value of k and chooses the elbow point of the sum-of-squares v/s K plot as the best value for k. The elbow point is defined as ...
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