Artificial intelligence · Unsupervised learning and clustering

Inertia (k-means)

In Spanish: Inercia (k-means)
Sound like a pro →
See in the galaxyCopy linkCite
Cite this definition
Updated: 18/11/2026Reading: 2 min⚑ Report a mistake

Description

Inertia in K-means is a fundamental metric in the context of K-means clustering, an algorithm widely used in data analysis and Big Data. This metric measures the dispersion of data points within each cluster formed by the algorithm. In essence, it is calculated as the sum of squared distances between each data point and the centroid of the cluster to which it belongs. A low inertia value indicates that the points within a cluster are closer to each other, suggesting greater clustering cohesion. Conversely, high inertia may indicate that the clusters are poorly defined. Inertia is crucial for evaluating cluster compactness and is used in the elbow method to help determine an appropriate number of clusters. Additionally, this metric is used to compare different clustering configurations on the same dataset. In summary, inertia is not only a tool for measuring cluster cohesion but also plays a vital role in optimizing data analysis processes.

History

The K-means algorithm was first proposed by Hugo Steinhaus in 1956 and later formalized by James MacQueen in 1967. Since then, it has evolved and become one of the most popular methods for data analysis, using the sum of squared errors (inertia) as the objective to minimize during iterations.

Uses

Inertia is primarily used in data analysis to evaluate the quality and compactness of the clusters generated by the K-means algorithm. It is applied implicitly or explicitly in various areas, such as marketing, where customers are segmented into homogeneous groups, and in biology, to classify data. It is also useful in image compression and anomaly detection in large datasets.

Examples

A practical example of the use of inertia can be observed when applying the elbow method in the analysis of online store customers, plotting inertia values for different numbers of clusters to identify the optimal inflection point. Another case is in image segmentation, where the compactness of groups of similar pixels formed by the algorithm is evaluated.