IA 360
Artificial Intelligence Glossary

Partitional Clustering Algorithms

Partitional clustering splits data into K non-overlapping groups in a single pass, with K-means as its flagship method. We cover how it works, how to choose K, and why it struggles with irregularly shaped clusters.

Admin IA360 AI-generated Leer en español
Partitional Clustering Algorithms

Partitional clustering splits a dataset into a fixed number of non-overlapping groups, K, assigning every observation to a single cluster in one pass. It is the counterpart of hierarchical clustering, which instead of a flat split builds a nested tree of groups within groups (a dendrogram). Both belong to unsupervised learning, where there are no labels and the algorithm must uncover the latent structure of the data on its own.

The archetypal partitional method is K-means, which looks for the K groups that minimize within-cluster variance, that is, the summed squared distance between each point and the center of its group.

K-means step by step, and its variants

The classic procedure, known as Lloyd's algorithm, is a simple loop. First, K initial centroids are set. Then two steps repeat until the assignment stops changing: assign each point to its nearest centroid, and recompute each centroid as the mean of the points assigned to it. The loop always converges, though to a local minimum rather than necessarily the best possible partition. Popularized by MacQueen in 1967, it remains a staple of libraries such as scikit-learn.

Several variants patch its weak spots. K-medoids (or PAM, from Kaufman and Rousseeuw) uses actual data points as centers instead of means, making it more robust to outliers. K-means++ (Arthur and Vassilvitskii, 2007) improves initialization by picking seeds that are spread apart, which lessens the reliance on luck and speeds up convergence.

How to choose K

The main catch of these methods is that K must be decided in advance. Two tools help estimate it. The elbow method plots within-cluster variance against different values of K and looks for the point where adding groups stops yielding a meaningful gain. The silhouette coefficient (Rousseeuw, 1987) measures, for each point, how well it fits its own group compared with the nearest neighboring one; the K with the best average silhouette is usually a sensible pick. Neither gives a single answer: they are guides, not verdicts.

Limits: initialization and cluster shape

K-means carries three assumptions worth keeping in mind. It depends on initialization: starting from different centroids can lead to different results, which is why k-means++ or running the fit several times matters. It also assumes roughly convex groups of similar size and density; when the data form elongated, nested, or unevenly dense structures, the split into spheres breaks down. In those cases, density-based algorithms such as DBSCAN (Ester and colleagues, 1996) tend to work better, because they find arbitrarily shaped groups and isolate noise without fixing K in advance. For more, see the entries on clustering and on unsupervised learning.

This article was produced with artificial intelligence under human editorial oversight.

Share this article

This website uses cookies to improve the browsing experience. Cookie policy.

↑↓ navigate ↵ open esc close