liveBook · Manning

Within-cluster sum of squares

As explained in Data Without Labels

Within-cluster sum of squares measures the summed squared distances of observations from the centroids of their assigned clusters.

Within-cluster sum of squares (WCSS), also called cohesion or inertia, measures how far observations lie from the centroids of their assigned clusters. Lower WCSS indicates more compact, homogeneous clusters; higher WCSS indicates greater spread. section 2.3.2

Use WCSS to compare candidate cluster counts, but interpret it alongside practical constraints:

  • Calculate WCSS for several values of k and plot each value against k. section 2.3.3
  • Look for an elbow, or sharp kink, where adding clusters produces diminishing improvement. section 2.3.3
  • Check business logic, cluster sizes, computation cost, and maintainability before finalizing the number of clusters. section 2.3.3
Figure 2.10 The elbow method to find the optimal number of clusters. The circle shows the kink. However, the final number of clusters is dependent on business logic, and often we merge/split clusters based on this. The ease of maintaining the clusters also plays a crucial role.
figure

The elbow plot shows how WCSS changes as k increases and highlights the kink used to propose a cluster count. section 2.3.3

How Data Without Labels covers it

How deep it goes
Defines centroid-distance interpretation and applies WCSS through the elbow method, without detailing implementation code.
Examples
Plots WCSS across candidate k values and identifies a sharp elbow as a proposed cluster count.
What it assumes
Assumes familiarity with clusters, centroids, distances, and k-means while explaining the practical choice of k.
What you can do after
Evaluate candidate cluster counts and balance compactness against business logic, computation cost, and maintainability.
How it connects
Connects WCSS with k-means clustering, inertia, intercluster sum of squares, silhouette coefficient, and the elbow method.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Data Without Labels. The section links point to the parts of the book it draws on.