Inertia

The inertia of K-means is the sum of squared distances between each point and the centroid of its cluster. The lower it is, the more compact the clusters. It always decreases as k increases, so it cannot be used alone to choose k.

Example

KMeans(n_clusters=4).fit(X_s).inertia_

Related concepts

The whole glossary