Method · Machine learning
k-means clustering
Unsupervised clustering method
k-means clustering is a method for sorting a collection of items into a fixed number of groups, called clusters, so that items placed together are more alike than items placed apart.
The likeness is measured as distance: each item is treated as a point whose coordinates are its measured features, and the algorithm works to make the distance between points and the center of their own cluster as small as possible. The number of groups, written k, is chosen in advance, and each group is summarized by a centroid, the point at the average position of the items assigned to it. The method belongs to the family of unsupervised learning techniques, meaning it looks for structure in data that carry no labels telling it the right answer.[1]
Key facts
| 0.5614 | Raw-data accuracy on penguin dataset, versus 0.9620 after Z-score scaling (Wongoutong 2024)[2] |
|---|---|
| 0.97 | Correlation between stability and accuracy on one dataset, versus -0.93 on another (Kuncheva & Vetrov 2006)[3] |
| 810 | Simulated datasets showing commercial packages return locally optimal k-means solutions (Steinley 2003)[4] |
Overview
What k-means clustering is and what it does
A concrete case makes the aim clear. A clinic holds records for thousands of patients, each described by age, number of prescriptions, and visits to the emergency department. Nothing in the records says which patients belong together. Running k-means with a chosen k would return that many centroids and a label for every patient, and a clinician could then inspect the groups to see whether they correspond to recognizable kinds of patient, such as the frail elderly or those managing chronic pain.[5] The output is not a diagnosis but a partition, a division of the data into non-overlapping groups that can be examined and interpreted.
The procedure itself is a loop of two steps. Starting from k initial centers, the algorithm assigns every point to whichever center is nearest, then moves each center to the mean of the points now assigned to it, and repeats. Assignment and update alternate until the centers stop moving. The quantity being driven down is the sum of squared distances from each point to its own center, and the algorithm can settle at a locally optimal arrangement rather than the best possible one.[4][1] Two choices shape the result before the loop even begins. The value of k fixes how many groups exist, and the distance metric, the rule for measuring how far apart two points are, decides what counts as similar; Euclidean distance, the straight-line distance familiar from geometry, is the usual choice.[1]
The appeal of the method lies in its simplicity and speed, and it is considered one of the most powerful and popular data mining algorithms in the research community.[6][1] That same directness brings weaknesses. Because the starting centers are typically picked at random, the clustering outcome can differ each time the algorithm is executed, even on the same dataset. Because every decision rests on distance, a feature measured in large numbers, such as body mass in grams, can overwhelm a feature measured in small ones, such as culmen length in mm, unless the data are prepared carefully.[2] The choice of k and the treatment of scale are treated in their own sections; for now it is enough to see that both are built into the logic of the method rather than added on afterward.
k-means partitions points into k groups by repeatedly assigning each point to its nearest center and moving each center to the mean of its group, minimizing total squared distance.
History
Where the algorithm came from
Its standard form is known as Lloyd's algorithm.[7] The core idea is plain: pick starting centers, attach each point to the nearest one, move each center to the mean of its points, and repeat.
Each pass through the data requires computing the distance from every point to every center. A significant advance came with the filtering algorithm, an implementation of Lloyd's method built around a kd-tree, a tree-shaped index that organizes points by position so that whole regions of space can be skipped when their nearest center is already known. The authors showed, both by analysing the running time and by testing on synthetic data and on real problems in color quantization, data compression, and image segmentation, that the algorithm runs faster as the clusters are more widely separated, because distant groups let the index prune more of the search.[7] The lesson is that the same clustering can be computed far more cheaply when the data structure is chosen well.
Speech recognition needed a compact set of reference patterns for each word in a vocabulary, and clustering the recorded examples was a natural way to build them; a modified k-means approach was developed for isolated word recognition that required no hand-tuned parameters from the user and matched or bettered earlier clustering techniques in a speaker-independent system.[8] A segmentation scheme that fused several k-means partitions computed in different color spaces, then reclustered the results, was applied successfully to a standard image database.[9] A half-century synthesis set out the minimum-variance loss function, the alternatives within its class, and the questions of initialization, choice of k, and preprocessing.[10]
How it works
The steps of the algorithm
The standard version of k-means, known as Lloyd's algorithm, is a loop with two moving parts. It begins with k starting centers, usually chosen at random from the data points themselves. Then comes the assignment step: every point is measured against every center, and each point is attached to whichever center lies closest, with closeness judged by Euclidean distance, the straight-line distance between two points in feature space.[1] The update step follows: each center is moved to the average position of the points now assigned to it, so that the center becomes the mean of its own group. Assignment and update then alternate, and the loop stops when the centers in one round are the same as, or very close to, those in the round before.[1]
What the loop is driving down is a single quantity, the objective function: the sum, over all points, of the squared distance from each point to the center of the cluster it belongs to. Written out, it adds up the squared Euclidean distances between every point and its own center across all k groups.[1] This is the number the algorithm tries to make as small as possible. It is worth seeing why the two steps work toward that goal rather than merely shuffling points around. Holding the centers fixed, moving a point to its nearest center can only lower its contribution to the sum, since no other center is closer. Holding the assignments fixed, replacing a center by the mean of its points is the position that minimizes the total squared distance for that group. Each half of the loop therefore takes the objective downhill, and because the objective cannot fall forever, the procedure must come to rest.
That guarantee has a catch. The arrangement the algorithm settles into is only a local optimum, not necessarily the best arrangement that exists for the data [16, 22]. The distinction matters because the landscape of the objective can have many valleys, and where the loop starts decides which one it descends into. The practical consequence, that different starting centers can yield different final groupings, is taken up later.
The cost of the loop is easy to state. Each pass computes the distance from every point to every center, so the work grows with the number of points, the number of dimensions, and k together. Implementations can cut this substantially. The filtering algorithm, built on a kd-tree, runs faster as the separation between clusters increases.[7] A more recent reformulation of the same objective as a trace maximization problem avoids recomputing the centers at every iteration and keeps the same order of computational complexity as Lloyd's method while converging in fewer iterations in experiments on benchmark datasets.[11] The recipe stays the same; only the bookkeeping changes.
A small worked example fixes the mechanics. Suppose points sit along a line at positions 1, 2, 3, 10, 11, and 12, and k is two. If the starting centers land at 2 and 11, the first assignment puts 1, 2, and 3 with the first center and 10, 11, and 12 with the second. The update moves the centers to 2 and 11, the means of those groups, and the next assignment reproduces the same split, so the loop halts with the objective equal to the squared distances within each group.[1] The arithmetic is trivial here, but it shows the two properties that define the method: the centers are always means, and the stopping condition is the absence of change.
The loop alternates assignment and update, each step lowering the total squared distance, until the centers stop moving at a local optimum.
Choosing the number of clusters
The number of groups, k, is not discovered by k-means; it is supplied before the loop begins, and the algorithm has no way to reconsider it. This is the feature that most sharply separates k-means from a fully unsupervised method. Because the starting centers are chosen at random and the number of clusters must be given in advance, the algorithm is always influenced by those two inputs, and its output can differ from run to run even on identical data.[12][2] The choice of k therefore sits upstream of everything the algorithm does: it fixes how many centroids exist, how the objective is computed, and what the final partition can possibly look like.

The difficulty is that the right value is rarely obvious. A user without deep familiarity with the dataset may have no principled basis for picking one number over another, and different values of k produce different cluster shapes and different sensitivity to outliers.[6] Several methods have been proposed to guide the choice, among them a rule of thumb, the elbow method, information-criterion approaches, an information-theoretic approach, the silhouette method, and cross-validation.[2] Each turns some measurable property of the clustering into a score that can be compared across candidate values of k.
The elbow method is a heuristic for choosing k.[13] It runs k-means for a range of k, plots the objective (the total squared distance) against k, and looks for the point where the curve stops falling steeply and begins to flatten, forming a bend like an elbow. The trouble is that the bend is a judgment call, and the method has been argued to lack theoretical support altogether, with better-established alternatives available and educators encouraged to teach those instead.[13]
The silhouette index takes a different route, scoring individual points rather than the whole partition. For each point it compares the average distance to the other members of its own cluster with the average distance to the members of the nearest other cluster, and combines the two into a value between −1 and 1; a high positive score means the point sits much closer to its own group than to the next nearest, while a negative score suggests it has been placed in the wrong group. Averaging these scores across all points gives a single number for the whole clustering result. Because the index needs no labels, it can be computed on real data where the true grouping is unknown.[1]
Other approaches formalize the comparison differently. Among the K-value selection methods analyzed are the elbow method, the gap statistic, the silhouette coefficient, and canopy.[14] Cross-validation is among the methods proposed to address the choice of the number of clusters.[2]
A separate line of work tries to remove the choice from the user's hands. One proposed unsupervised variant of k-means is designed to run without any initialization or parameter selection and to find an optimal number of clusters on its own.[12] Other work has proposed a new measure to assist the selection of K for the K-means algorithm.[15] These methods do not make the question disappear; they relocate the decision into a criterion the algorithm applies internally, which is only as good as the criterion.
k must be fixed before the loop starts, and no single heuristic settles it; the elbow method in particular is widely criticized for lacking theoretical support.
Initialization and local optima
The loop described earlier stops when the centers stop moving, but that stopping point is not unique. Where the centers begin decides which valley of the objective the algorithm descends into, and the objective has many valleys. A local optimum is an arrangement from which no single reassignment or recentering lowers the total squared distance, even though a better arrangement may exist elsewhere in the data. Because the starting centers are usually picked at random, two runs on the same dataset can end with different groupings, and the algorithm is guaranteed only to reach a local optimum, not the best possible partition.[1]

The practical consequence is that a single run is a weak answer. One response is to identify methods for finding good starting values that might lead to the best solutions possible.[4] Another is to choose the starting centers more carefully. A third approach, global k-means, builds the solution incrementally: it adds one center at a time, and for each new center it runs k-means from every candidate starting position in the data, keeping the one that lowers the objective most. The global k-means algorithm proposed by Likas et al. avoids dependence on any initial conditions or parameters and considerably outperforms ordinary k-means, but it has a heavy computational load.[16]
The problem is not confined to hand-written code. An analysis of the k-means implementations in three commercial statistics packages, SPSS, SYSTAT, and SAS, found that the solutions they return are generally only locally optimal, and that none of them offered a reasonable mechanism for beginning the method at alternative starting points. Across two empirical datasets and 810 simulated ones, the results suggested the packages' answers were most likely local optima, pointing to the need for a strategy to probe the local-optima problem for a given dataset or to find good starting values.[4]
Stability can also be improved after the fact, by combining many runs rather than trusting one. An ensemble of k-means clusterers, each started from a random initialization with a randomly chosen number of clusters, was compared with the standard algorithm on ten artificial and ten real datasets. Stability was measured as the agreement between pairs of clusterers in the ensemble (and, separately, as the entropy of the consensus matrix), and the ensembles were generally more stable than single runs, markedly so as k grew. The same study found that the link between stability and accuracy varied sharply with the dataset, ranging from a near-perfect positive correlation of 0.97 on one dataset to a near-perfect negative correlation of −0.93 on another, so a stable answer is not automatically a correct one.[3]
Random starts lead to local optima; multiple restarts, k-means++, global k-means, and ensembles all attack the same weakness from different angles.
Feature scaling and distance
Every decision k-means makes rests on a distance, and distance is not a neutral referee. The Euclidean distance between two points is computed by squaring the difference along each feature, adding those squares, and taking the square root. A feature whose values run into the thousands therefore contributes far more to that sum than a feature whose values run between zero and one, even when the second feature is the more meaningful of the two. The algorithm has no way of knowing which feature matters; it simply follows the arithmetic, and the arithmetic gives the loudest voice to the largest numbers.
A concrete case shows the distortion. A dataset of penguins might record culmen length, culmen depth, and flipper length in millimetres and body mass in grams. Body mass values are three orders of magnitude larger than the others, so when the distance between two birds is computed, the mass difference dominates the sum and the three length measurements barely register. The clustering then effectively groups the birds by weight alone, and the pattern that would have emerged from the lengths is buried. This is not a flaw in the data but a mismatch between the units in which the data happen to be recorded and the way the algorithm compares them.
The remedy is feature scaling, a preprocessing step that transforms each feature onto a comparable range before clustering begins. Several standard transformations exist. Z-score standardization subtracts each feature's mean and divides by its standard deviation, so every feature ends up centred on zero with a spread of one. Min-Max normalization rescales each feature to a fixed interval, usually between zero and one. Percentile transformation replaces each value with its rank or percentile within the feature. Maximum absolute scaling divides each feature by its largest absolute value. RobustScaler centres and scales using the median and the interquartile range rather than the mean and standard deviation, which makes it less disturbed by extreme values. Each method brings the features onto a common footing, though they do so in different ways and can therefore produce different clusterings.
The question of whether this step actually matters was tested directly by comparing raw data against data scaled by each of those five methods before running k-means, on ten real datasets split into two groups: five in which the features were measured in different units, and five in which all features shared the same unit.[2] The comparison used four standard measures of agreement with the known true grouping: accuracy, precision, recall, and F-score, each of which scores how closely the clusters recovered by the algorithm match the correct labels.
The results divided cleanly along the line of whether the features shared the same units. When the features had different units, scaling beforehand improved all four measures over using the raw data, and the gap was large. On one dataset of three penguin species, raw data reached an accuracy of 0.5614, while Z-score scaling reached 0.9620 and the other methods landed between 0.8538 and 0.9327. Averaged across the mixed-unit datasets, the raw data scored an accuracy of 0.6621, while even the weakest scaling method, Min-Max normalization, reached 0.8855. For the penguin dataset, a statistical test of homogeneity showed the raw-data clusters differed significantly from the true groups (Chi-square 19.829, p < 0.001), while the scaled clusters did not, and the same trend held for the other mixed-unit datasets.[2]
When the features already shared a unit, the picture changed. Scaling produced results similar to using the raw data; Maximum absolute scaling was slightly ahead, but the improvement was not significant.[2] The practical rule that follows is conditional rather than universal: scaling is essential when units differ, and largely optional when they do not.
Among the five methods, Z-score standardization performed best overall on the mixed-unit data, with an average accuracy of 0.9142; Percentile transformation was the only method to exceed it on any measure, having the highest average precision at 0.9202.[2] The choice among scaling methods is thus a secondary decision, but not an arbitrary one.
Scaling features before k-means is essential when they are measured in different units, and makes little difference when they are not.
Choosing k with the silhouette index
The silhouette index answers a question that the objective function cannot: not how tight the clusters are overall, but whether each individual point looks as though it belongs where it was placed. For a single point, the index compares two distances. The first is the average distance from the point to all the other members of its own cluster, called the within dissimilarity. The second is the average distance from the point to all the members of the nearest other cluster, the between dissimilarity, taken as the smallest such average over every cluster the point does not belong to. The silhouette width combines them by subtracting the within value from the between value and dividing by whichever of the two is larger.[1]

The resulting number runs between −1 and 1, and its sign carries the interpretation. A positive width means the point sits closer, on average, to its own group than to the next nearest one, and the value reaches its maximum of 1 when the point's average distance to the other members of its own cluster is zero.[1] A negative width means the reverse: the point is nearer to another cluster than to its own, which is the signature of a point that has been placed in the wrong group.
Averaging the widths of all the points in a cluster gives a score for that cluster, and averaging across every cluster gives a single number for the whole partition, the average silhouette width. The silhouette coefficient is among the methods proposed for choosing the number of clusters.[14] The reasoning is that a partition in which points sit comfortably inside their own groups, rather than stranded between groups, is the one that best matches the structure actually present in the data.
The index has a practical advantage that explains much of its use. Because it is computed entirely from the distances between points, it needs no labels and no training set, so it can be applied to real data where the true grouping is unknown, which is precisely the situation in which clustering is normally used.[1] This is not true of every validation measure. Some, such as normalized mutual information, require a set of known labels to score a clustering, and so cannot serve when no answer key exists.[1]
How the silhouette compares with other indices was examined in a study that used eight well-known clustering validity measures as the fitness functions of a swarm-intelligence clustering method, testing them on both synthetic and real datasets. The silhouette statistic stood out on most of the datasets examined. The same study cautioned that the choice of index can critically affect the quality of the clusters obtained, and advised against drawing conclusions from a single index, recommending that several be considered together to reach a reliable picture of the structure.[17]
That caution fits the role the silhouette plays in choosing k. It measures separation and cohesion, and a partition can score well on both while still being shaped by the algorithm's own preferences rather than by the data, a tendency examined earlier in this chapter. Read alongside other evidence, the average silhouette is a useful signal. Read alone, it is one question put to the partition, answered well or badly depending on what the partition happens to look like.
The silhouette width scores each point by comparing its distance to its own cluster with its distance to the nearest other cluster; averaging it across all points gives a label-free way to compare candidate values of k.
Research
Evidence on clustering quality
A clustering method can be judged only against something outside itself. When the true grouping of the data is known, the clusters the algorithm returns can be compared with it directly, and the comparison can be scored. This is the setting of the scaling study described earlier, and its numbers serve as a measure of how much the quality of a k-means result depends on preparation rather than on the algorithm. The same pattern held for precision, recall, and F-score, and a test of homogeneity found the raw-data clusters significantly different from the true groups while the scaled clusters were not.[2] The lesson is not that k-means is weak but that its output is only as good as the representation it is given; the loop itself was unchanged between those two outcomes.
Ground truth of this kind is a luxury. Most real datasets arrive without labels, and the analyst must judge a partition by its usefulness rather than its correctness. A large clinical study shows what that judgment looks like in practice. Researchers at Kaiser Permanente Northern California set out to characterize the most medically complex patients in a large integrated care system, a group that consumes a disproportionate share of health care spending yet responds unevenly to care-management programs. Starting from more than 5,000 clinical variables, they used clinical judgment and analytic methods to reduce the set to 97 informative covariates, then grouped 104,869 patients, representing 3.3 percent of the adult population, using two independent methods: latent class analysis and k-means clustering.[5]
The latent class analysis produced a seven-class solution, and a panel of clinical stakeholders examined the groups and gave them names: high acuity, older patients with cardiovascular complications, frail elderly, pain management, psychiatric illness, cancer treatment, and a large group of less engaged patients.[5] The profiles were not merely statistical artifacts. One-year mortality differed sharply across them, from 3.0 percent in the psychiatric illness profile to 23.4 percent in the frail elderly profile, a risk ratio of 7.9.[5] That spread is the evidence that the grouping captured something real: a partition is useful when the groups it creates differ in ways that matter outside the analysis.
The role of k-means in that study is instructive. It was run as a check on the latent class result, and it returned qualitatively similar groupings.[5] Two methods resting on different assumptions, one a model-based approach and the other the distance-based procedure described in this chapter, converged on the same broad picture of the patient population. Agreement of that kind is a form of validation available even without labels: when independent methods recover the same structure, the structure is less likely to be an accident of one algorithm's quirks. The authors treated the overlap as construct validity, one of three domains of validity they examined, alongside face validity (the recognizability of the profiles to clinicians) and criterion validity (their differing one-year outcomes).[5]
What such studies cannot supply is a general benchmark. The clinical result says nothing about how k-means will behave on a different dataset with different features, and the scaling result says nothing about patient profiles. Each evaluation is local to its data and its purpose. This is why the choice of validation measure deserves as much care as the choice of algorithm, and why the measures themselves are treated in their own section. For now the point is narrower: k-means has been checked against known answers and against an independent method, and in both cases the quality of the result depended heavily on decisions made before the loop ran, whether scaling the features or selecting which variables to include.
K-means has been validated both against known labels, where scaling lifted average accuracy from 0.66 to 0.91, and against an independent method, which recovered similar patient profiles.[2]
In practice
Using k-means in practice
The applications of k-means are easiest to understand as variations on one pattern: a problem supplies a pile of unlabeled records, someone decides what a record's features should be and how many groups are wanted, and the algorithm returns a partition that a person then interprets. The preparation and the choice of k change from field to field, but the shape of the work does not.

Retail is a natural fit because the goal is already a partition. An e-commerce business wants to divide its customers into groups that share purchasing behavior, so that the right offer reaches the right segment and the least profitable segments are not mistaken for the most profitable ones. One study applied k-means to customer purchase behavior data, examining the relationship between three clusters, event type, products, and categories, to help vendors identify and focus on the high profitable segment to the least profitable segment.[18] Nothing in the data said which customer belonged where; the clusters supplied the division, and the business meaning was attached afterward.
Images offer a second variation, where the "items" are pixels and the features are colors. A segmentation scheme computed several k-means partitions of the same image in different color spaces and then fused them with a final clustering pass, an approach tested on a standard image database.[9] The choice of color space turns out to matter: running k-means on two-, three-, and higher-cluster color images, one comparison found model accuracy between 30 and 55 percent in RGB space and between 30 and 65 percent in L\*a\b\ space, with silhouette analysis used to check the chosen k.[19] Here the preparation step is the choice of representation, and it shifts the result as surely as scaling does.
Remote sensing uses the same machinery for a different question. Change detection compares two satellite images of the same area and asks which pixels changed. One method projects small blocks of the difference image onto principal components, then partitions the resulting feature vectors into two clusters with k fixed at 2, assigning each pixel by minimum Euclidean distance to the cluster means.[20] A later approach to radar imagery likewise fixes k at 2, clustering a combined difference map into changed and unchanged areas.[21] The number of groups is not estimated because the problem defines it: there are exactly two answers.
Medical and agricultural imaging follow the same logic with the classes set by the task. White blood cell segmentation combines color-space decomposition with k-means to separate a cell's nucleus and cytoplasm from the surrounding smear, reaching 95.7 percent overall accuracy for nucleus segmentation and 91.3 percent for cytoplasm across 300 microscopic images.[22] A diagnosis system for grape leaves used k-means to separate diseased tissue from healthy leaf before a support vector machine classified the disease, reaching 98.71 percent accuracy with texture features and 98.97 percent after principal component reduction.[23] In both cases k-means is not the final answer; it is the step that isolates the region of interest so that the next model has something clean to work on.
That supporting role is common enough to count as a pattern of its own. A network anomaly detector cascaded k-means with a decision tree: k-means first partitioned the training instances into clusters using Euclidean distance, a tree was built on each cluster to refine the boundaries, and the two decisions were combined by nearest-neighbor and nearest-consensus rules, reaching detection accuracy as high as 96.24 percent at a false-positive rate of 0.03 percent on network data.[24] The clustering supplies a coarse map of density; the supervised model supplies the fine distinctions.
Large engineering systems have adopted the method at scale. A review of more than 440 articles published through 2022 described k-means as a widely recognized and frequently used clustering algorithm in modern power systems, applied to load forecasting, fault detection, power quality analysis, and security assessment, and noted that the number of publications employing clustering algorithms in the field is following an exponential upward trend.[25] The breadth is the point: once a domain accumulates multivariate records, the question of which records resemble which arises on its own, and k-means is a fast way to answer it.
Across retail, imaging, remote sensing, medicine, and power systems, the pattern is constant: prepare the features, fix k to match the question, and interpret the groups.
Speeding up k-means for large datasets
The cost of k-means is easiest to see by counting distance calculations. Each pass through the data computes the distance from every point to every center, so the work grows with the number of points, the number of dimensions, and k together. The practical question is how to obtain the same partition while computing fewer distances.
The filtering algorithm answers that question with a data structure rather than a new objective. It is an implementation of Lloyd's method built around a kd-tree, a tree-shaped index that organizes points by their position along each dimension, so that nearby points sit in the same branch and whole regions of space can be summarized by a single bounding box.[7] When the algorithm needs the nearest center for a point, it can first compare the point against these boxes. If the closest possible member of a box is already farther away than a center the search has found, nothing inside the box needs to be examined, and an entire subtree is skipped. The algorithm runs faster as the separation between clusters increases.[7]
That dependence is the interesting part. The efficiency of the filtering algorithm was established in two ways: a data-sensitive analysis of its running time, and empirical studies on synthetically generated data and on real datasets drawn from color quantization, data compression, and image segmentation. The analysis shows that the algorithm runs faster as the separation between clusters increases, because well-separated groups let the tree discard more of the search.[7] The intuition is direct: when clusters are far apart, a point's nearest center is usually obvious from the coarse geometry, and the fine comparisons can be avoided. Speed, in other words, is a property of the data as much as of the code.
A second line of work attacks the same cost by remembering what earlier iterations already established. The enhanced k-means algorithm keeps a small amount of information in each iteration for use in the next, so that some of the distance computations can be ruled out before they are performed. This scheme can improve the computational speed of k-means in the total number of distance calculations and in overall computation time. The scheme can improve the computational speed of k-means in the total number of distance calculations and in overall computation time.[26]
A third approach reformulates the problem rather than accelerating the search. The classical objective can be rewritten as a trace maximization problem, and one proposed algorithm replaces it with a new formulation that does not require the cluster centers to be calculated at each iteration at all, and that carries fewer intermediate variables through the optimization.[11] Because the centers are the quantities that must be recomputed and compared against every point, removing them from the inner loop removes much of the work. The computational complexity stays at the same order as Lloyd's algorithm, O(ndk), but a faster convergence rate was observed in experiments, so that fewer iterations are needed to reach the stopping condition.[11] Fewer iterations at the same cost per iteration compounds into a shorter run.
These three strategies are complementary rather than competing. The filtering algorithm reduces the cost of each distance search by exploiting geometry; the enhanced algorithm reduces the number of searches by reusing information across iterations; the reformulation reduces the per-iteration work by changing what is computed. What they share is a refusal to accept the naive cost as fixed. The clustering k-means produces is defined by its objective, and any procedure that reaches the same objective by a shorter route is a legitimate substitute for the plain loop.
The plain loop's cost is set by distance calculations; kd-tree filtering, reuse of earlier iterations, and center-free reformulations each cut that cost without changing the partition.
Handling data with missing values and multiple views
The standard k-means loop assumes a tidy table: every item described by every feature, all features describing the same objects. Real datasets often break both assumptions at once, and two families of extensions adapt the algorithm to each failure.
When entries are missing
A missing value is not a small inconvenience for a distance-based method. The Euclidean distance between two points is built from the differences along each feature, and a difference cannot be computed when one of the two values is absent. The usual workarounds are to delete the incomplete rows, which throws away data, or to fill the gaps first and cluster afterward, which treats the filled values as if they had been measured. The second approach at least keeps the records, but it separates two decisions that are entangled: the best guess for a missing entry depends on which cluster the record belongs to, and the cluster assignment depends on the filled-in values.
One variant resolves the entanglement by folding both tasks into a single objective function, so that clustering and imputation, the filling-in of missing entries, are adjusted against each other until they agree.[27] Rather than fixing the guesses in advance, the method lets the current partition inform the estimates and the estimates inform the partition, alternating between them in the same spirit as the assign-and-update loop itself. The authors designed an alternate optimization procedure to solve the combined problem and proved that it converges, then tested it on nine benchmark datasets from the UCI repository and on real applications against several established methods for incomplete data.[27] The clustering results favored the unified approach over those alternatives. The design principle is the one worth carrying away: when two unknowns depend on each other, solving for them jointly can beat solving for them in sequence.
When the data arrive in several tables
The second failure is structural. Sometimes the same objects are described by separate sets of features that were never meant to be pasted into one table: a set of customers might be characterized by purchase history in one view and by demographic records in another, with each view carrying its own scale, its own noise, and its own irrelevant columns. Multi-view k-means refers to variants built for this situation, where each view is a distinct block of features describing the same items.[28]
The plain algorithm has no way to discount a useless feature. Every column enters every distance with equal weight, so a view full of irrelevant variation can drown out a view that carries the real structure. The feature-reduction multi-view variant addresses this by constructing a learning mechanism that computes an individual weight for each feature within each view, built directly into a new objective function for the multi-view problem. Features that contribute little to the clustering are driven toward small weights, and a schema then eliminates features whose weights fall below a threshold, so that dimension is reduced during the clustering rather than in a separate step beforehand. The authors analyzed the computational complexity of the resulting algorithm and compared it with other feature-weighted multi-view methods on numerical and real datasets, where the results demonstrated its effectiveness.[28]
Both extensions leave the core of k-means recognizable. Points are still assigned by distance and centers are still means, but the distance is computed over a repaired table in the first case and over a reweighted one in the second. The pattern matches the variants discussed earlier in this chapter: the loop survives, and what changes is the definition of the point or the rule for measuring similarity.
Missing entries and multiple views both break the plain distance calculation; unifying imputation with clustering, or learning a weight per feature, repairs the input rather than the loop.
k-means in image segmentation and change detection
Pixels as points

An image is a table of numbers in disguise. Each pixel carries a small set of measurements, typically three intensities for red, green, and blue, and those measurements can be treated as coordinates in the same way that a patient's age and prescription count are. Segmenting an image means dividing its pixels into regions that share some property, and k-means is a natural fit because the task is already a partition: every pixel must end up in exactly one region. The features are the color channels, the items are the pixels, and the centroids are the average colors of the regions the algorithm discovers.
The choice of color space is a preparation decision of the same kind as feature scaling, and it shifts the result. One comparison ran k-means on two-cluster, three-cluster, and higher-cluster color images in both RGB and L\*a\b\ space, using ground-truth images to check the output and silhouette analysis to check the chosen k. Model accuracy fell between 30 and 55 percent in RGB space and between 30 and 65 percent in L\*a\b\ space, so the same algorithm on the same pictures segmented them better in L\*a\b\ than in RGB.[19] The lesson echoes the earlier discussion of scale: distance is only as meaningful as the coordinates it is computed over.
Setting k from the task
In many image problems the number of regions is not estimated at all, because the question being asked defines it. Change detection compares two images of the same place taken at different times and asks, pixel by pixel, whether anything changed. There are exactly two answers, changed and unchanged, so k is fixed at 2 and the algorithm's job is to decide which side of the boundary each pixel falls on.[21]
One method built for satellite imagery takes this route. The difference between two multitemporal images is divided into small non-overlapping blocks, and principal component analysis is applied to the set of blocks to extract a small number of orthonormal eigenvectors, which span a compact space describing local image structure. Each pixel is then represented by its projection onto that space, and k-means with k set to 2 partitions the resulting feature vectors, with every pixel assigned to whichever cluster mean lies nearer in Euclidean distance.[20] The clustering is the final step; the work of making the pixels comparable was done beforehand.
A later approach to radar imagery reaches the same two-way split by a different preparation. Two multitemporal synthetic aperture radar images are first denoised, then combined into change maps using both a subtraction operator and a log ratio operator, and the maps are smoothed with a mean filter and a median filter, the first to keep local areas consistent and the second to preserve edges. The two filtered maps are merged into a single difference image, and k-means with k equal to 2 divides it into changed and unchanged areas.[21] In both cases the algorithm is unchanged from its plain form; what varies is how the image was turned into points worth clustering.
Fusion and refinement
Where a single partition is unreliable, several can be combined. A segmentation scheme computed k-means partitions of the same image in different color spaces, then fused them by running a final clustering pass whose input features were the local histograms of the class labels assigned in the earlier partitions. The framework was kept deliberately simple to implement and fast to run, and it was tested on the Berkeley image database, where it was compared with segmentation methods recently proposed in the literature.[9] The idea is that a region boundary that several independent partitions agree on is more trustworthy than one that a single partition draws.
K-means also serves as the isolating step in a longer pipeline, where its output feeds a supervised model. A diagnosis system for grape leaves separated the area of disease symptoms from the healthy parts of the leaf using k-means clustering, then extracted features in three color models, reduced them with principal component analysis, and classified the disease with a support vector machine. Texture features from the gray-level co-occurrence matrix gave an accuracy of 98.71 percent, and feature reduction by principal component analysis raised it to 98.97 percent, while two deep learning models compared in the same study reached 86.82 and 94.05 percent, with the proposed method's processing time significantly shorter than theirs.[23] The clustering did not diagnose anything; it handed the classifier a cleaner region to describe.
Medical imaging follows the same pattern with the classes set by anatomy. White blood cell segmentation combines color-space decomposition with k-means to separate a cell's nucleus and cytoplasm from the surrounding blood smear, after a color adjustment step applied before segmentation. Across a database of 300 microscopic images, the method reached 95.7 percent overall accuracy for nucleus segmentation and 91.3 percent for cytoplasm segmentation.[22] Here the number of regions is fixed by the structures being sought, and the algorithm's contribution is to draw the boundary between them.
In image work k is usually dictated by the question, two for change detection and a handful for tissue or leaf regions, and the real design effort goes into the color space, the filters, and the fusion that make the pixels comparable before the loop runs.
Alternatives
Variants and extensions
The plain k-means loop has one fixed shape: straight-line distance, hard assignment of each point to a single cluster, one view of the data, and a complete table of numbers. Each of those assumptions has been relaxed by a variant, and the variants are best understood as answers to the question of which assumption fails for a given problem.
The first failure is geometric. Ordinary k-means can only find clusters that are linearly separable, meaning groups that a straight boundary could cut apart in feature space.[1] When one group wraps around another, as a ring of points surrounds a central blob, no set of centroids separates them. Kernel k-means handles this by projecting every point into a higher-dimensional space through a nonlinear function, chosen so that the groups become separable there, and then running the same assign-and-update procedure in that transformed space.[1] The distance computations are done through a kernel function that compares pairs of points without ever writing out the transformed coordinates. The catch is that the result depends on which kernel is used: Gaussian, polynomial, and hyperbolic tangent kernels give different clusterings of the same data, and picking the right one for an unfamiliar dataset is not obvious.[1]
A second assumption is that each point belongs wholly to one group. Fuzzy k-means replaces the hard assignment with a membership degree, so a point can sit partly in several clusters, with the degree of certainty recorded in a membership matrix.[29] This suits data where boundaries are genuinely gradual, such as measurements of disease severity, though the extra flexibility costs computation: a comparison of fuzzy c-means with ordinary k-means found the fuzzy version produced close results but required more computation time.[30]
Two further variants address the shape of the data table itself. Multi-view k-means applies when the same objects are described by several separate sets of features, and it builds a weight for each feature into the objective so that irrelevant features can be shrunk toward zero and dropped, reducing dimension during the clustering rather than before it.[28] Incomplete data raises a different problem: rows with missing entries cannot be placed by distance in the usual way. One approach folds the clustering and the filling-in of missing values into a single objective function, so that the two processes are adjusted against each other until they agree, and it was tested on nine benchmark datasets against several methods for incomplete data.[27] The pattern across these variants is consistent: the core loop survives, and what changes is the rule for measuring similarity or the definition of what a point is.
Scale brings its own extensions. The cost of each pass grows with the number of points, and for very large datasets that cost becomes the obstacle. A coreset is a small weighted summary of the data, constructed so that clustering the summary gives nearly the same answer as clustering the whole set; coresets for k-means in Euclidean space lead to approximation algorithms whose running time depends on the dimension and the desired accuracy rather than on the number of points, and they can maintain an approximate clustering over a stream of arriving points using bounded memory.[31] A complementary line of work reduces the number of features instead: random projections can map points into a much lower-dimensional space while preserving the optimal partition within a small factor, a claim verified in experiments on a large face-image dataset.[32] Feature selection methods with provable accuracy guarantees for k-means have also been developed alongside these projection techniques.[33]
Finally, the centroid itself can be replaced. K-medoids chooses an actual data point, called a medoid, as the representative of each cluster rather than an average position, which keeps the representative a real record and makes the method usable when a mean is meaningless, such as with categorical values. A comparison of the two on normally and uniformly distributed data found that k-medoids took less average time than k-means in both cases.[34] The automatic selection of k, treated earlier as a difficulty of the standard method, has also been built into a variant designed to run without initialization or parameter selection and to find an optimal number of clusters on its own.[12]
Variants relax one assumption at a time: kernel k-means the shape of clusters, fuzzy k-means the hard assignment, multi-view and incomplete-data methods the data table, coresets and projections the scale, and k-medoids the centroid.
Criticism
Limitations and criticism
The weaknesses of k-means are not accidents of a poor implementation. They follow from the shape of the objective and the way distance is measured, and each has been documented in its own right. The need to fix k in advance and the dependence on random starting centers have already been described; what remains is a set of criticisms that bear on the results even when those two choices are made carefully.

The most consequential is a bias in the sizes of the groups the algorithm returns. Because the objective sums squared distances, a large cluster with points far from its center contributes heavily to the total, and the algorithm can lower that total by splitting such a group or by evening out the groups. A formal study of the effect found that k-means tends to produce clusters of relatively uniform size even when the input data have genuinely varied cluster sizes. Measured by the coefficient of variation, a standardized measure of how much cluster sizes differ, the algorithm pulled the variation of its output into a band of roughly 0.3 to 1.0: datasets whose true clusters varied more widely than that were compressed toward uniformity, and datasets whose true clusters were more even than that were pushed apart. The same work showed that some validation measures, the entropy measure among them, fail to register this evening-out and can therefore report a clustering as good when it has quietly distorted the group structure.[35] A partition that looks tidy may simply be one the algorithm has made tidy.
A related assumption is geometric. Ordinary k-means divides the data with straight boundaries, so it can only recover clusters that are linearly separable, groups a flat cut could separate in feature space.[1] Elongated clusters that cross one another, or a ring of points surrounding a central blob, cannot be represented by centroids placed at means. The algorithm will still return an answer, and the answer will look like a partition, but the groups will not correspond to the structure that generated the data.
The method is also sensitive to how the features are expressed, in a subtler way than the scaling problem described earlier. K-means is not invariant to linear transformations of the data: stretching or rotating the feature space changes the distances, and therefore changes the clustering, even though the transformation has not added or removed any information.[36] This means the result depends on the coordinate system in which the data happen to arrive, a dependence that is easy to overlook because the arithmetic runs without complaint.
Which features are included matters for the same reason. A variable that carries no cluster structure still contributes to every distance, and can mask the structure that other variables would reveal. A variable-selection heuristic built for k-means, tested across more than 2,200 datasets with known cluster structure, was found to be effective at eliminating such masking variables, and applying it to real financial services data before clustering produced greater cluster stability.[37] The finding cuts both ways: it shows that irrelevant features can degrade a partition, and that the choice of variables is a decision the analyst must make rather than one the algorithm makes.
Finally, the tools used to judge a clustering are themselves open to criticism. The elbow method, the most familiar way of choosing k, has been argued to lack theoretical support, with a call for it to be abandoned in favor of better-established alternatives.[13] And as the study of cluster sizes showed, a validation measure can miss a systematic distortion and report a misleading score.[35] The limitations of k-means are therefore not confined to the algorithm; they extend to the means by which its output is judged.
K-means tends toward evenly sized, linearly separable groups, depends on how features are expressed and which are included, and can be misjudged by the very measures used to validate it.
How k-means behaves when clusters differ in size
The pull toward equal groups

The objective k-means minimizes is a sum of squared distances, and a sum is not indifferent to how its parts are distributed. A cluster holding many points, or points far from its center, adds a large amount to the total; a small, tight cluster adds little. When the algorithm searches for an arrangement that lowers the sum, it therefore has an incentive to break up large, spread-out groups and to leave small ones alone, because the largest contributions offer the most to gain. The result is a systematic tendency for the clusters it returns to be more similar in size than the groups that actually generated the data. This is not a bug in any particular implementation. It follows from the arithmetic of the objective, and it appears even when the algorithm is run correctly and reaches a good local optimum.
A formal analysis of the effect made the tendency precise. The authors showed that k-means tends to produce clusters of relatively uniform size even when the input data have genuinely varied cluster sizes, and they proposed measuring the spread of cluster sizes with the coefficient of variation, a standardized number obtained by dividing the standard deviation of the cluster sizes by their mean.[35] A coefficient near zero means the clusters are nearly equal in size; larger values mean they differ more. Across their analyses, k-means tended to produce clusters whose variation in size, as measured by CV, fell in a range of about 0.3 to 1.0. For datasets with large variation in true cluster sizes (CV > 1.0), k-means reduced the variation in resultant cluster sizes to less than 1.0, and for datasets with small variation (CV < 0.3), it increased variation to greater than 0.3.[35] In both directions the returned partition moved away from the distribution that generated the data.
The practical meaning is easiest to see in a lopsided example. A clustering that respects the data would return one big cluster and one small one. K-means tends to produce clusters of relatively uniform size, so a lopsided population may be returned as groups of more similar size than the true groups.[35] The rare cases may still be found, but the ordinary majority arrives divided into segments that reflect the algorithm's preference for balance rather than any real distinction among those patients. An analyst reading the output sees several groups of comparable size and may take that evenness as evidence of structure, when it is partly an artifact of the objective.
Why the usual score can miss it
The distortion would be less troubling if the standard tools for judging a clustering caught it. They often do not. The reason is that these measures ask how well each point sits with its own kind of point, and a partition produced by splitting a large homogeneous group can answer that question well: the pieces are internally similar, because they were cut from similar material. What the measure does not ask is whether the number and relative sizes of the groups match anything real. A tidy-looking partition may simply be one the algorithm has made tidy.
The broader lesson connects to the earlier discussion of validation. A clustering index is a question put to a partition, and each question can be answered well by a partition that is wrong in some other respect. When the true group sizes are unknown, as they usually are, no single number settles whether the algorithm has respected them. The uniform effect is a standing reason to treat a clean validation score as one piece of evidence rather than a verdict, and to ask separately whether the sizes of the returned groups are plausible for the problem at hand.
K-means tends to return clusters of similar size regardless of the true group sizes, and common validation measures can score such a partition highly without noticing the distortion.
The local optima problem in practice
The gap between the algorithm on paper and the algorithm in a software package is easy to underestimate. On paper, k-means is a loop that descends the objective until the centers stop moving; the descent is guaranteed, but the stopping point is not. The question for anyone using a commercial package is therefore not whether the loop works but where it begins, since a single start gives the loop one chance to find a good valley and no way to know whether a deeper one exists.
That question was put to the test directly. To probe the problem, separate routines were written that could be initialized randomly, and these were compared against the packages across two empirical datasets and 810 simulated ones. The results suggested the packages' answers were most likely local optima, pointing to the need for a strategy to study the local-optima problem for a given dataset or to find good starting values that might lead to the best solutions possible.[4]
The finding matters because it locates the weakness in the ordinary workflow rather than in exotic cases. A user who opens a statistics package, supplies a data table and a value of k, and reads the output has done nothing wrong, yet the partition returned may be an accident of whichever starting configuration the software chose internally. The output will look like a finished answer: every point has a label, every cluster has a center, and the objective has a value. Nothing in that output announces that a different start might have produced a lower objective and a different partition. The local-optima problem is invisible from the inside, which is what makes it worth naming as a practical hazard rather than a theoretical footnote.
The remedies all attack the same point, the choice of starting configuration. One is to run the algorithm many times from different random starts and keep the partition with the lowest objective, on the reasoning that the best of several descents is more likely to land in a deep valley. Another is to use an extension of k-means such as k-means++.[1] A third builds the solution incrementally, adding one center at a time and running k-means from every candidate starting position for each new center, which removes the dependence on random starts at the cost of a heavy computational load.[16] Each remedy accepts the same premise the simulation study established: a single start is a single sample from a landscape with many valleys, and the only way to improve the odds is to sample more than once or to sample more wisely.
What the study cannot say is how often a given package will fail on a given dataset. Its conclusion is about the mechanism, not a failure rate, and the two empirical datasets and 810 simulated ones were chosen to expose the problem rather than to estimate its prevalence in ordinary use.[4] The practical response follows from the mechanism: treat any single k-means result as one descent among many, check whether repeated runs with different starts agree, and prefer implementations that expose the initialization rather than hiding it.
A single run from one starting configuration can return a locally optimal partition that looks finished; repeated starts or deliberate initialization are the only way to tell.
Key studies
| Year | Study | Sample | Design | Finding |
|---|---|---|---|---|
| 2001 | Brusco & Cradit[37] | more than 2200 datasets with known cluster structure | Brusco and Cradit tested a variable-selection heuristic for k-means, based on the adjusted Rand index, on more than 2200 simulated data sets with known cluster structure. | The heuristic was extremely effective at eliminating masking variables. |
| 2003 | Steinley[4] | 2 empirical data sets and 810 simulated data sets | Steinley analyzed 2 empirical data sets and 810 simulated data sets to test whether the solutions returned by 3 commercial software packages are locally optimal. | Results from commercial packages were most likely locally optimal. |
| 2006 | Kuncheva & Vetrov[3] | 10 artificial and 10 real data sets | Kuncheva and Vetrov measured the stability of k-means cluster ensembles across random numbers of clusters and random initializations on 10 artificial and 10 real data sets. | Ensembles were generally more stable than standard k-means, markedly so for larger k. |
| 2007 | Gaddam et al.[24] | network anomaly data, Duffing equation data and mechanical system data | cascaded k-means and decision tree experiment | Detection accuracy reached 96.24% at a false-positive rate of 0.03% on the network anomaly data. |
| 2012 | Rui Xu et al.[17] | synthetic and real data sets | comparison of eight clustering validity indices | The silhouette statistic index stood out in most data sets examined. |
| 2014 | Zhang et al.[22] | 300 microscopic blood smear images with 690 white blood cells | Zhang, Xiao, Li, Chen, Zhen, Chang and colleagues segmented white blood cell nuclei and cytoplasm in 300 blood smear images by combining color space decomposition with k-means clustering. | The method reached 95.7% accuracy for nucleus segmentation and 91.3% for cytoplasm segmentation. |
| 2014 | M.AqilBurney & Tariq[19] | 2-cluster, 3-cluster and k-cluster color images | image segmentation with ground truth validation | Model accuracy was 30% to 55% in RGB space and 30% to 65% in L*a*b* color space. |
| 2020 | Grant et al.[5] | Grant, McCloskey, Hatfield, Uratsu, Ralston, Bayliss and colleagues ran a cohort study of medically complex patients, grouping them by latent class analysis and, in a parallel analysis, by k-means clustering. | Clustering gave seven patient profiles, and one-year mortality ranged from 3.0% to 23.4% across profiles. | |
| 2023 | Javidan et al.[23] | grape leaf images with three diseases | Javidan, Banakar, Vakilian and Ampatzidis built an image processing pipeline that separated diseased leaf area with k-means, extracted color and texture features, and classified three grape leaf diseases with a support vector machine. | The k-means method with PCA reached 98.97% accuracy, compared with 86.82% for CNN and 94.05% for GoogleNet. |
See also
References
- Shutaywi, M., & Kachouie, N. N. (2021). Silhouette Analysis for Performance Evaluation in Machine Learning with Applications to Clustering. Entropy, 23(6), 759. doi:10.3390/e23060759
- Wongoutong, C. (2024). The impact of neglecting feature scaling in k-means clustering. PLOS ONE, 19(12), e0310839. doi:10.1371/journal.pone.0310839
- Kuncheva, L. I., & Vetrov, D. P. (2006). Evaluation of Stability of k-Means Cluster Ensembles with Respect to Random Initialization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 28(11), 1798-1808. doi:10.1109/tpami.2006.226
- Steinley, D. (2003). Local Optima in K-Means Clustering: What You Don't Know May Hurt You. Psychological Methods, 8(3), 294-304. doi:10.1037/1082-989x.8.3.294
- Grant, R. W., McCloskey, J., Hatfield, M., Uratsu, C., Ralston, J. D., Bayliss, E., & Kennedy, C. J. (2020). Use of Latent Class Analysis and k-Means Clustering to Identify Complex Patient Profiles. JAMA Network Open, 3(12), e2029068. doi:10.1001/jamanetworkopen.2020.29068
- Ahmed, M., Seraj, R., & Islam, S. M. S. (2020). The k-means Algorithm: A Comprehensive Survey and Performance Evaluation. Electronics, 9(8), 1295. doi:10.3390/electronics9081295
- Kanungo, T., Mount, D. M., Netanyahu, N. S., Piatko, C. D., Silverman, R., & Wu, A. Y. (2002). An efficient k-means clustering algorithm: analysis and implementation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 24(7), 881-892. doi:10.1109/tpami.2002.1017616
- Wilpon, J., & Rabiner, L. (1985). A modified K-means clustering algorithm for use in isolated work recognition. IEEE Transactions on Acoustics, Speech, and Signal Processing, 33(3), 587-594. doi:10.1109/tassp.1985.1164581
- Mignotte, M. (2008). Segmentation by Fusion of Histogram-Based $K$-Means Clusters in Different Color Spaces. IEEE Transactions on Image Processing, 17(5), 780-787. doi:10.1109/tip.2008.920761
- Steinley, D. (2006). K‐means clustering: A half‐century synthesis. British Journal of Mathematical and Statistical Psychology, 59(1), 1-34. doi:10.1348/000711005x48266
- Nie, F., Li, Z., Wang, R., & Li, X. (2023). An Effective and Efficient Algorithm for K-Means Clustering With New Formulation. IEEE Transactions on Knowledge and Data Engineering, 35(4), 3433-3443. doi:10.1109/tkde.2022.3155450
- Sinaga, K. P., & Yang, M. S. (2020). Unsupervised K-Means Clustering Algorithm. IEEE Access, 8, 80716-80727. doi:10.1109/access.2020.2988796
- Schubert, E. (2023). Stop using the elbow criterion for k-means and how to choose the number of clusters instead. ACM SIGKDD Explorations Newsletter, 25(1), 36-42. doi:10.1145/3606274.3606278
- Yuan, C., & Yang, H. (2019). Research on K-Value Selection Method of K-Means Clustering Algorithm. J, 2(2), 226-235. doi:10.3390/j2020016
- Pham, D. T., Dimov, S. S., & Nguyen, C. D. (2005). Selection of K in K -means clustering. Proceedings of the Institution of Mechanical Engineers, Part C: Journal of Mechanical Engineering Science, 219(1), 103-119. doi:10.1243/095440605x8298
- Xie, J., Jiang, S., Xie, W., & Gao, X. (2011). An Efficient Global K-means Clustering Algorithm. Journal of Computers, 6(2). doi:10.4304/jcp.6.2.271-279
- Rui Xu, Jie Xu, & Wunsch, D. C. (2012). A Comparison Study of Validity Indices on Swarm-Intelligence-Based Clustering. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 42(4), 1243-1256. doi:10.1109/tsmcb.2012.2188509
- Tabianan, K., Velu, S., & Ravi, V. (2022). K-Means Clustering Approach for Intelligent Customer Segmentation Using Customer Purchase Behavior Data. Sustainability, 14(12), 7243. doi:10.3390/su14127243
- M.AqilBurney, S., & Tariq, H. (2014). K-Means Cluster Analysis for Image Segmentation. International Journal of Computer Applications, 96(4), 1-8. doi:10.5120/16779-6360
- Turgay Celik (2009). Unsupervised Change Detection in Satellite Images Using Principal Component Analysis and $k$-Means Clustering. IEEE Geoscience and Remote Sensing Letters, 6(4), 772-776. doi:10.1109/lgrs.2009.2025059
- Yaoguo Zheng, Xiangrong Zhang, Biao Hou, & Ganchao Liu (2014). Using Combined Difference Image and $k$ -Means Clustering for SAR Image Change Detection. IEEE Geoscience and Remote Sensing Letters, 11(3), 691-695. doi:10.1109/lgrs.2013.2275738
- Zhang, C., Xiao, X., Li, X., Chen, Y. J., Zhen, W., Chang, J., Zheng, C., & Liu, Z. (2014). White Blood Cell Segmentation by Color-Space-Based K-Means Clustering. Sensors, 14(9), 16128-16147. doi:10.3390/s140916128
- Javidan, S. M., Banakar, A., Vakilian, K. A., & Ampatzidis, Y. (2023). Diagnosis of grape leaf diseases using automatic K-means clustering and machine learning. Smart Agricultural Technology, 3, 100081. doi:10.1016/j.atech.2022.100081
- Gaddam, S. R., Phoha, V. V., & Balagani, K. S. (2007). K-Means+ID3: A Novel Method for Supervised Anomaly Detection by Cascading K-Means Clustering and ID3 Decision Tree Learning Methods. IEEE Transactions on Knowledge and Data Engineering, 19(3), 345-354. doi:10.1109/tkde.2007.44
- Miraftabzadeh, S. M., Colombo, C. G., Longo, M., & Foiadelli, F. (2023). K-Means and Alternative Clustering Methods in Modern Power Systems. IEEE Access, 11, 119596-119633. doi:10.1109/access.2023.3327640
- Fahim, A. M., Salem, A. M., Torkey, F. A., & Ramadan, M. A. (2006). An efficient enhanced k-means clustering algorithm. Journal of Zhejiang University-SCIENCE A, 7(10), 1626-1633. doi:10.1631/jzus.2006.a1626
- Wang, S., Li, M., Hu, N., Zhu, E., Hu, J., Liu, X., & Yin, J. (2019). K-Means Clustering With Incomplete Data. IEEE Access, 7, 69162-69171. doi:10.1109/access.2019.2910287
- Yang, M. S., & Sinaga, K. P. (2019). A Feature-Reduction Multi-View k-Means Clustering Algorithm. IEEE Access, 7, 114472-114486. doi:10.1109/access.2019.2934179
- Nie, F., Zhao, X., Wang, R., Li, X., & Li, Z. (2022). Fuzzy K-Means Clustering With Discriminative Embedding. IEEE Transactions on Knowledge and Data Engineering, 34(3), 1221-1230. doi:10.1109/tkde.2020.2995748
- Ghosh, S., & Kumar, S. (2013). Comparative Analysis of K-Means and Fuzzy C-Means Algorithms. International Journal of Advanced Computer Science and Applications, 4(4). doi:10.14569/ijacsa.2013.040406
- Chen, K. (2009). On Coresets for k -Median and k -Means Clustering in Metric and Euclidean Spaces and Their Applications. SIAM Journal on Computing, 39(3), 923-947. doi:10.1137/070699007
- Boutsidis, C., Zouzias, A., & B, P. D. (2010). Random Projections for $k$-means Clustering. arXiv. doi:10.48550/arxiv.1011.4632 Free full text
- Boutsidis, C., Zouzias, A., Mahoney, M. W., & Drineas, P. (2015). Randomized Dimensionality Reduction for $k$ -Means Clustering. IEEE Transactions on Information Theory, 61(2), 1045-1062. doi:10.1109/tit.2014.2375327
- Velmurugan (2010). Computational Complexity between K-Means and K-Medoids Clustering Algorithms for Normal and Uniform Distributions of Data Points. Journal of Computer Science, 6(3), 363-368. doi:10.3844/jcssp.2010.363.368
- Hui Xiong, Junjie Wu, & Jian Chen (2009). K-Means Clustering Versus Validation Measures: A Data-Distribution Perspective. IEEE Transactions on Systems, Man, and Cybernetics, Part B (Cybernetics), 39(2), 318-331. doi:10.1109/tsmcb.2008.2004559
- Tarpey, T. (2007). Linear Transformations and the k -Means Clustering Algorithm: Applications to Clustering Curves. The American Statistician, 61(1), 34-40. doi:10.1198/000313007x171016
- Brusco, M. J., & Cradit, J. D. (2001). A Variable-Selection Heuristic for K-means Clustering. Psychometrika, 66(2), 249-270. doi:10.1007/bf02294838
Cite this page: Atlas Nova editors. (2026). k-means clustering. Atlas Nova. https://velocer.io/atlas/k-means-clustering/