kmeans clustering is a method of vector quantization, originally from signal processing, that is popular for cluster analysis in data mining. kmeans clustering aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. This results in a partitioning of the data space into Voronoi cells.
The problem is computationally difficult (NPhard); however, there are efficient heuristic algorithms that are commonly employed and converge quickly to a local optimum. These are usually similar to the expectationmaximization algorithm for mixtures of Gaussian distributions via an iterative refinement approach employed by both algorithms. Additionally, they both use cluster centers to model the data; however, kmeans clustering tends to find clusters of comparable spatial extent, while the expectationmaximization mechanism allows clusters to have different shapes.
The algorithm has a loose relationship to the knearest neighbor classifier, a popular machine learning technique for classification that is often confused with kmeans because of the k in the name. One can apply the 1nearest neighbor classifier on the cluster centers obtained by kmeans to classify new data into the existing clusters. This is known as nearest centroid classifier or Rocchio algorithm.
Description
Given a set of observations (x_{1}, x_{2}, ..., x_{n}), where each observation is a ddimensional real vector, kmeans clustering aims to partition the n observations into k (n) sets S = {S_{1}, S_{2}, ..., S_{k}} so as to minimize the withincluster sum of squares (WCSS) (i.e. variance). Formally, the objective is to find:
${\underset {\mathbf {S} }{\operatorname {arg\,min} }}\sum _{i=1}^{k}\sum _{\mathbf {x} \in S_{i}}\left\\mathbf {x} {\boldsymbol {\mu }}_{i}\right\^{2}={\underset {\mathbf {S} }{\operatorname {arg\,min} }}\sum _{i=1}^{k}S_{i}\operatorname {Var} S_{i}$
where ?_{i} is the mean of points in S_{i}. This is equivalent to minimizing the pairwise squared deviations of points in the same cluster:^{[1]}
$\sum _{{\text{Cluster }}C_{i}}\,\sum _{{\text{Dimension }}d}\,\sum _{x,y\,\in \,C_{i}}(x_{d}y_{d})^{2}$
Because the total variance is constant, this is also equivalent to maximizing the squared deviations between points in different clusters (betweencluster sum of squares, BCSS).^{[1]}
History
The term "kmeans" was first used by James MacQueen in 1967,^{[2]} though the idea goes back to Hugo Steinhaus in 1957.^{[3]} The standard algorithm was first proposed by Stuart Lloyd in 1957 as a technique for pulsecode modulation, though it wasn't published outside of Bell Labs until 1982.^{[4]} In 1965, E. W. Forgy published essentially the same method, which is why it is sometimes referred to as LloydForgy.^{[5]}
Algorithms
Standard algorithm
The most common algorithm uses an iterative refinement technique. Due to its ubiquity it is often called the kmeans algorithm; it is also referred to as Lloyd's algorithm, particularly in the computer science community.
Given an initial set of k means m_{1}^{(1)},...,m_{k}^{(1)} (see below), the algorithm proceeds by alternating between two steps:^{[6]}
 Assignment step: Assign each observation to the cluster whose mean yields the least withincluster sum of squares (WCSS). Since the sum of squares is the squared Euclidean distance, this is intuitively the "nearest" mean.^{[7]} (Mathematically, this means partitioning the observations according to the Voronoi diagram generated by the means).
 $S_{i}^{(t)}={\big \{}x_{p}:{\big \}x_{p}m_{i}^{(t)}{\big \}^{2}\leq {\big \}x_{p}m_{j}^{(t)}{\big \}^{2}\ \forall j,1\leq j\leq k{\big \}},$
 where each $x_{p}$ is assigned to exactly one $S^{(t)}$, even if it could be assigned to two or more of them.
 Update step: Calculate the new means to be the centroids of the observations in the new clusters.
 $m_{i}^{(t+1)}={\frac {1}{S_{i}^{(t)}}}\sum _{x_{j}\in S_{i}^{(t)}}x_{j}$
 Since the arithmetic mean is a leastsquares estimator, this also minimizes the withincluster sum of squares (WCSS) objective.
The algorithm has converged when the assignments no longer change. Since both steps optimize the WCSS objective, and there only exists a finite number of such partitionings, the algorithm must converge to a (local) optimum. There is no guarantee that the global optimum is found using this algorithm.
The algorithm is often presented as assigning objects to the nearest cluster by distance. The standard algorithm aims at minimizing the WCSS objective, and thus assigns by "least sum of squares", which is exactly equivalent to assigning by the smallest Euclidean distance. Using a different distance function other than (squared) Euclidean distance may stop the algorithm from converging.^{[]} Various modifications of kmeans such as spherical kmeans and kmedoids have been proposed to allow using other distance measures.
Initialization methods
Commonly used initialization methods are Forgy and Random Partition.^{[8]} The Forgy method randomly chooses k observations from the data set and uses these as the initial means. The Random Partition method first randomly assigns a cluster to each observation and then proceeds to the update step, thus computing the initial mean to be the centroid of the cluster's randomly assigned points. The Forgy method tends to spread the initial means out, while Random Partition places all of them close to the center of the data set. According to Hamerly et al.,^{[8]} the Random Partition method is generally preferable for algorithms such as the kharmonic means and fuzzy kmeans. For expectation maximization and standard kmeans algorithms, the Forgy method of initialization is preferable. A comprehensive study by Celebi et al.,^{[9]} however, found that popular initialization methods such as Forgy, Random Partition, and Maximin often perform poorly, whereas the approach by Bradley and Fayyad^{[10]} performs "consistently" in "the best group" and Kmeans++ performs "generally well".
 Demonstration of the standard algorithm

1. k initial "means" (in this case k=3) are randomly generated within the data domain (shown in color).

2. k clusters are created by associating every observation with the nearest mean. The partitions here represent the Voronoi diagram generated by the means.

3. The centroid of each of the k clusters becomes the new mean.

4. Steps 2 and 3 are repeated until convergence has been reached.
As it is a heuristic algorithm, there is no guarantee that it will converge to the global optimum, and the result may depend on the initial clusters. As the algorithm is usually very fast, it is common to run it multiple times with different starting conditions. However, in the worst case, kmeans can be very slow to converge: in particular it has been shown that there exist certain point sets, even in 2 dimensions, on which kmeans takes exponential time, that is 2^{?(n)}, to converge.^{[11]} These point sets do not seem to arise in practice: this is corroborated by the fact that the smoothed running time of kmeans is polynomial.^{[12]}
The "assignment" step is also referred to as expectation step, the "update step" as maximization step, making this algorithm a variant of the generalized expectationmaximization algorithm.
Complexity
Regarding computational complexity, finding the optimal solution to the kmeans clustering problem for observations in d dimensions is:
 NPhard in general Euclidean space d even for 2 clusters^{[13]}^{[14]}^{[15]}^{[16]}
 NPhard for a general number of clusters k even in the plane^{[17]}
 If k and d (the dimension) are fixed, the problem can be exactly solved in time $O(n^{dk+1})$, where n is the number of entities to be clustered^{[18]}
Thus, a variety of heuristic algorithms such as Lloyd's algorithm given above are generally used.
The running time of Lloyd's algorithm is naively $O(nkdi)$,^{[19]} where n is the number of ddimensional vectors, k the number of clusters and i the number of iterations needed until convergence. On data that does have a clustering structure, the number of iterations until convergence is often small, and results only improve slightly after the first dozen iterations. Lloyd's algorithm is therefore often considered to be of "linear" complexity in practice, although it is in the worst case superpolynomial.^{[20]}
Following are some of the recent insights into this algorithm complexity behavior.
 In the worstcase, Lloyd's algorithm needs $i=2^{\Omega ({\sqrt {n}})}$ iterations, so that the worstcase complexity of Lloyd's algorithm is superpolynomial.^{[20]}
 Lloyd's kmeans algorithm has polynomial smoothed running time. It is shown that^{[12]} for arbitrary set of n points in $[0,1]^{d}$, if each point is independently perturbed by a normal distribution with mean 0 and variance $\sigma ^{2}$, then the expected running time of kmeans algorithm is bounded by $O(n^{34}k^{34}d^{8}\log ^{4}(n)/\sigma ^{6})$, which is a polynomial in n, k, d and $1/\sigma$.
 Better bounds are proven for simple cases. For example,^{[21]} showed that the running time of kmeans algorithm is bounded by $O(dn^{4}M^{2})$ for n points in an integer lattice $\{1,\dots ,M\}^{d}$.
Lloyd's algorithm is the standard approach for this problem, However, it spends a lot of processing time computing the distances between each of the k cluster centers and the n data points. Since points usually stay in the same clusters after a few iterations, much of this work is unnecessary, making the naive implementation very inefficient. Some implementations use the triangle inequality in order to create bounds and accelerate Lloyd's algorithm.^{[22]}^{[23]}^{[24]}
Variations
 Jenks natural breaks optimization: kmeans applied to univariate data
 kmedians clustering uses the median in each dimension instead of the mean, and this way minimizes $L_{1}$ norm (Taxicab geometry).
 kmedoids (also: Partitioning Around Medoids, PAM) uses the medoid instead of the mean, and this way minimizes the sum of distances for arbitrary distance functions.
 Fuzzy CMeans Clustering is a soft version of Kmeans, where each data point has a fuzzy degree of belonging to each cluster.
 Gaussian mixture models trained with expectationmaximization algorithm (EM algorithm) maintains probabilistic assignments to clusters, instead of deterministic assignments, and multivariate Gaussian distributions instead of means.
 kmeans++ chooses initial centers in a way that gives a provable upper bound on the WCSS objective.
 The filtering algorithm uses kdtrees to speed up each kmeans step.^{[25]}
 Some methods attempt to speed up each kmeans step using the triangle inequality.^{[22]}^{[23]}^{[24]}^{[26]}
 Escape local optima by swapping points between clusters.^{[27]}
 The Spherical kmeans clustering algorithm is suitable for textual data.^{[28]}
 Hierarchical variants such as Bisecting kmeans,^{[29]}Xmeans clustering^{[30]} and Gmeans clustering^{[31]}repeatedly split clusters to build a hierarchy, and can also try to automatically determine the optimal number of clusters in a dataset.
 Internal cluster evaluation measures such as cluster silhouette can be helpful at determining the number of clusters.
 Minkowski weighted kmeans automatically calculates cluster specific feature weights, supporting the intuitive idea that a feature may have different degrees of relevance at different features.^{[32]} These weights can also be used to rescale a given data set, increasing the likelihood of a cluster validity index to be optimized at the expected number of clusters.^{[33]}
 Minibatch Kmeans: Kmeans variation using "mini batch" samples for data sets that do not fit into memory.^{[34]}
Discussion
A typical example of the kmeans convergence to a local minimum. In this example, the result of kmeans clustering (the right figure) contradicts the obvious cluster structure of the data set. The small circles are the data points, the four ray stars are the centroids (means). The initial configuration is on the left figure. The algorithm converges after five iterations presented on the figures, from the left to the right. The illustration was prepared with the Mirkes Java applet.
^{[35]}
kmeans clustering result for the
Iris flower data set and actual species visualized using
ELKI. Cluster means are marked using larger, semitransparent symbols.
kmeans clustering and
EM clustering on an artificial dataset ("mouse"). The tendency of
kmeans to produce equalsized clusters leads to bad results, while EM benefits from the Gaussian distribution present in the data set
Three key features of kmeans which make it efficient are often regarded as its biggest drawbacks:
 Euclidean distance is used as a metric and variance is used as a measure of cluster scatter.
 The number of clusters k is an input parameter: an inappropriate choice of k may yield poor results. That is why, when performing kmeans, it is important to run diagnostic checks for determining the number of clusters in the data set.
 Convergence to a local minimum may produce counterintuitive ("wrong") results (see example in Fig.).
A key limitation of kmeans is its cluster model. The concept is based on spherical clusters that are separable in a way so that the mean value converges towards the cluster center. The clusters are expected to be of similar size, so that the assignment to the nearest cluster center is the correct assignment. When for example applying kmeans with a value of $k=3$ onto the wellknown Iris flower data set, the result often fails to separate the three Iris species contained in the data set. With $k=2$, the two visible clusters (one containing two species) will be discovered, whereas with $k=3$ one of the two clusters will be split into two even parts. In fact, $k=2$ is more appropriate for this data set, despite the data set containing 3 classes. As with any other clustering algorithm, the kmeans result relies on the data set to satisfy the assumptions made by the clustering algorithms. It works well on some data sets, while failing on others.
The result of kmeans can also be seen as the Voronoi cells of the cluster means. Since data is split halfway between cluster means, this can lead to suboptimal splits as can be seen in the "mouse" example. The Gaussian models used by the Expectationmaximization algorithm (which can be seen as a generalization of kmeans) are more flexible here by having both variances and covariances. The EM result is thus able to accommodate clusters of variable size much better than kmeans as well as correlated clusters (not in this example).
Applications
kmeans clustering is rather easy to implement and apply even on large data sets, particularly when using heuristics such as Lloyd's algorithm . It has been successfully used in various topics, including market segmentation, computer vision, geostatistics,^{[36]}astronomy and agriculture. It often is used as a preprocessing step for other algorithms, for example to find a starting configuration.
Vector quantization
Twochannel (for illustration purposes  red and green only) color image.
Vector quantization of colors present in the image above into Voronoi cells using
kmeans.
kmeans originates from signal processing, and still finds use in this domain. For example, in computer graphics, color quantization is the task of reducing the color palette of an image to a fixed number of colors k. The kmeans algorithm can easily be used for this task and produces competitive results. A use case for this approach is image segmentation. Other uses of vector quantization include nonrandom sampling, as kmeans can easily be used to choose k different but prototypical objects from a large data set for further analysis.
Cluster analysis
In cluster analysis, the kmeans algorithm can be used to partition the input data set into k partitions (clusters).
However, the pure kmeans algorithm is not very flexible, and as such is of limited use (except for when vector quantization as above is actually the desired use case!). In particular, the parameter k is known to be hard to choose (as discussed above) when not given by external constraints. Another limitation of the algorithm is that it cannot be used with arbitrary distance functions or on nonnumerical data. For these use cases, many other algorithms have been developed since.
Feature learning
kmeans clustering has been used as a feature learning (or dictionary learning) step, in either (semi)supervised learning or unsupervised learning.^{[37]} The basic approach is first to train a kmeans clustering representation, using the input training data (which need not be labelled). Then, to project any input datum into the new feature space, we have a choice of "encoding" functions, but we can use for example the thresholded matrixproduct of the datum with the centroid locations, the distance from the datum to each centroid, or simply an indicator function for the nearest centroid,^{[37]}^{[38]} or some smooth transformation of the distance.^{[39]} Alternatively, by transforming the samplecluster distance through a Gaussian RBF, one effectively obtains the hidden layer of a radial basis function network.^{[40]}
This use of kmeans has been successfully combined with simple, linear classifiers for semisupervised learning in NLP (specifically for named entity recognition)^{[41]} and in computer vision. On an object recognition task, it was found to exhibit comparable performance with more sophisticated feature learning approaches such as autoencoders and restricted Boltzmann machines.^{[39]} However, it generally requires more data than the sophisticated methods, for equivalent performance, because each data point only contributes to one "feature" rather than multiple.^{[37]}
Relation to other statistical machine learning algorithms
Gaussian Mixture Model
kmeans clustering, and its associated expectationmaximization algorithm, is a special case of a Gaussian mixture model, specifically, the limit of taking all covariances as diagonal, equal, and small. It is often easy to generalize a kmeans problem into a Gaussian mixture model.^{[42]} Another generalization of the kmeans algorithm is the KSVD algorithm, which estimates data points as a sparse linear combination of "codebook vectors". Kmeans corresponds to the special case of using a single codebook vector, with a weight of 1.^{[43]}
Principal component analysis (PCA)
It was proven ^{[44]}^{[45]} that the relaxed solution of kmeans clustering, specified by the cluster indicators, is given by principal component analysis (PCA), and the PCA subspace spanned by the principal directions is identical to the cluster centroid subspace. The intuition is that kmeans describe spherically shaped (balllike) clusters. If the data have 2 clusters, the line connecting the two centroids is the best 1dimensional projection direction, which is also the first PCA direction. Cutting the line at the center of mass separates the clusters (this is the continuous relaxation of the discrete cluster indicator). If the data have three clusters, the 2dimensional plane spanned by three cluster centroids is the best 2D projection. This plane is also defined by the first two PCA dimensions. Wellseparated clusters are effectively modeled by ballshaped clusters and thus discovered by Kmeans. Nonballshaped clusters are hard to separate when they are close. For example, two halfmoon shaped clusters intertwined in space do not separate well when projected onto PCA subspace. But kmeans should not be expected to do well on this data. However, PCA's being a useful relaxation of kmeans clustering was not a new result,^{[46]} and it is straightforward to produce counterexamples to the statement that the cluster centroid subspace is spanned by the principal directions.^{[47]}
Mean shift clustering
Basic mean shift clustering algorithms maintain a set of data points the same size as the input data set. Initially, this set is copied from the input set. Then this set is iteratively replaced by the mean of those points in the set that are within a given distance of that point. By contrast, kmeans restricts this updated set to k points usually much less than the number of points in the input data set, and replaces each point in this set by the mean of all points in the input set that are closer to that point than any other (e.g. within the Voronoi partition of each updating point). A mean shift algorithm that is similar then to kmeans, called likelihood mean shift, replaces the set of points undergoing replacement by the mean of all points in the input set that are within a given distance of the changing set.^{[48]} One of the advantages of mean shift over kmeans is that there is no need to choose the number of clusters, because mean shift is likely to find only a few clusters if indeed only a small number exist. However, mean shift can be much slower than kmeans, and still requires selection of a bandwidth parameter. Mean shift has soft variants much as kmeans does.
Independent component analysis (ICA)
It has been shown in ^{[49]} that under sparsity assumptions and when input data is preprocessed with the whitening transformation kmeans produces the solution to the linear Independent component analysis task. This aids in explaining the successful application of kmeans to feature learning.
Bilateral filtering
kmeans implicitly assumes that the ordering of the input data set does not matter. The bilateral filter is similar to Kmeans and mean shift in that it maintains a set of data points that are iteratively replaced by means. However, the bilateral filter restricts the calculation of the (kernel weighted) mean to include only points that are close in the ordering of the input data.^{[48]} This makes it applicable to problems such as image denoising, where the spatial arrangement of pixels in an image is of critical importance.
Similar problems
The set of squared error minimizing cluster functions also includes the kmedoids algorithm, an approach which forces the center point of each cluster to be one of the actual points, i.e., it uses medoids in place of centroids.
Software implementations
Different implementations of the same algorithm were found to exhibit enormous performance differences, with the fastest on a test data set finishing in 10 seconds, the slowest taking 25988 seconds.^{[1]} The differences can be attributed to implementation quality, language and compiler differences, and the use of indexes for acceleration.
Free Software/Open Source
the following implementations are available under Free/Open Source Software licenses, with publicly available source code.
 Accord.NET contains C# implementations for kmeans, kmeans++ and kmodes.
 CrimeStat implements two spatial kmeans algorithms, one of which allows the user to define the starting locations.
 ELKI contains kmeans (with Lloyd and MacQueen iteration, along with different initializations such as kmeans++ initialization) and various more advanced clustering algorithms.
 Julia contains a kmeans implementation in the JuliaStats Clustering package.
 KNIME contains nodes for for kmeans and kmedoids.
 Mahout contains a MapReduce based kmeans.
 MLPACK contains a C++ implementation of kmeans.
 Octave contains kmeans.
 OpenCV contains a kmeans implementation.
 PSPP contains kmeans, The QUICK CLUSTER command performs kmeans clustering on the dataset.
 R contains three kmeans variations.
 SciPy and scikitlearn contain multiple kmeans implementations.
 Spark MLlib implements a distributed kmeans algorithm.
 Torch contains an unsup package that provides kmeans clustering.
 Weka contains kmeans and xmeans.
Proprietary
The following implementations are available under proprietary license terms, and may not have publicly available source code.
See also
References
 ^ ^{a} ^{b} ^{c} Kriegel, HansPeter; Schubert, Erich; Zimek, Arthur (2016). "The (black) art of runtime evaluation: Are we comparing algorithms or implementations?". Knowledge and Information Systems. ISSN 02191377. doi:10.1007/s1011501610042.
 ^ MacQueen, J. B. (1967). Some Methods for classification and Analysis of Multivariate Observations. Proceedings of 5th Berkeley Symposium on Mathematical Statistics and Probability. 1. University of California Press. pp. 281297. MR 0214227. Zbl 0214.46201. Retrieved .
 ^ Steinhaus, H. (1957). "Sur la division des corps matériels en parties". Bull. Acad. Polon. Sci. (in French). 4 (12): 801804. MR 0090073. Zbl 0079.16403.
 ^ Lloyd, S. P. (1957). "Least square quantization in PCM". Bell Telephone Laboratories Paper. Published in journal much later: Lloyd., S. P. (1982). "Least squares quantization in PCM" (PDF). IEEE Transactions on Information Theory. 28 (2): 129137. doi:10.1109/TIT.1982.1056489. Retrieved .
 ^ E.W. Forgy (1965). "Cluster analysis of multivariate data: efficiency versus interpretability of classifications". Biometrics. 21: 768769. JSTOR 2528559.
 ^ MacKay, David (2003). "Chapter 20. An Example Inference Task: Clustering" (PDF). Information Theory, Inference and Learning Algorithms. Cambridge University Press. pp. 284292. ISBN 0521642981. MR 2012999.
 ^ Since the square root is a monotone function, this also is the minimum Euclidean distance assignment.
 ^ ^{a} ^{b} Hamerly, G.; Elkan, C. (2002). "Alternatives to the kmeans algorithm that find better clusterings" (PDF). Proceedings of the eleventh international conference on Information and knowledge management (CIKM).
 ^ Celebi, M. E., Kingravi, H. A., and Vela, P. A. (2013). "A comparative study of efficient initialization methods for the kmeans clustering algorithm". Expert Systems with Applications. 40 (1): 200210. arXiv:1209.1960 . doi:10.1016/j.eswa.2012.07.021.
 ^ Bradley, Paul S.; Fayyad, Usama M. (1998). "Refining Initial Points for KMeans Clustering". Proceedings of the Fifteenth International Conference on Machine Learning.
 ^ Vattani., A. (2011). "kmeans requires exponentially many iterations even in the plane" (PDF). Discrete and Computational Geometry. 45 (4): 596616. doi:10.1007/s0045401193401.
 ^ ^{a} ^{b} Arthur, D.; Manthey, B.; Roeglin, H. (2009). "kmeans has polynomial smoothed complexity". Proceedings of the 50th Symposium on Foundations of Computer Science (FOCS).
 ^ Garey, M.; Johnson, D.; Witsenhausen, H. (19820301). "The complexity of the generalized Lloyd  Max problem (Corresp.)". IEEE Transactions on Information Theory. 28 (2): 255256. ISSN 00189448. doi:10.1109/TIT.1982.1056488.
 ^ Kleinberg, Jon; Papadimitriou, Christos; Raghavan, Prabhakar (19981201). "A Microeconomic View of Data Mining". Data Mining and Knowledge Discovery. 2 (4): 311324. ISSN 13845810. doi:10.1023/A:1009726428407.
 ^ Aloise, D.; Deshpande, A.; Hansen, P.; Popat, P. (2009). "NPhardness of Euclidean sumofsquares clustering". Machine Learning. 75 (2): 245249. doi:10.1007/s1099400951030.
 ^ Dasgupta, S.; Freund, Y. (July 2009). "Random Projection Trees for Vector Quantization". Information Theory, IEEE Transactions on. 55 (7): 32293242. arXiv:0805.1390 . doi:10.1109/TIT.2009.2021326.
 ^ Mahajan, M.; Nimbhorkar, P.; Varadarajan, K. (2009). "The Planar kMeans Problem is NPHard". Lecture Notes in Computer Science. Lecture Notes in Computer Science. 5431: 274285. ISBN 9783642002014. doi:10.1007/9783642002021_24.
 ^ Inaba, M.; Katoh, N.; Imai, H. (1994). Applications of weighted Voronoi diagrams and randomization to variancebased kclustering. Proceedings of 10th ACM Symposium on Computational Geometry. pp. 332339. doi:10.1145/177424.178042.
 ^ D., Manning, Christopher (2008). Introduction to information retrieval. Raghavan, Prabhakar., Schütze, Hinrich. New York: Cambridge University Press. ISBN 0521865719. OCLC 190786122.
 ^ ^{a} ^{b} Arthur, David; Vassilvitskii, Sergei (20060101). "How Slow is the Kmeans Method?". Proceedings of the Twentysecond Annual Symposium on Computational Geometry. SCG '06. New York, NY, USA: ACM: 144153. ISBN 1595933409. doi:10.1145/1137856.1137880.
 ^ Arthur; Abhishek Bhowmick (2009). A theoretical analysis of Lloyd's algorithm for kmeans clustering (PDF) (Thesis).
 ^ ^{a} ^{b} Phillips, Steven J. (20020104). Mount, David M.; Stein, Clifford, eds. Acceleration of KMeans and Related Clustering Algorithms. Lecture Notes in Computer Science. Springer Berlin Heidelberg. pp. 166177. ISBN 9783540439776. doi:10.1007/3540456430_13.
 ^ ^{a} ^{b} Elkan, C. (2003). "Using the triangle inequality to accelerate kmeans" (PDF). Proceedings of the Twentieth International Conference on Machine Learning (ICML).
 ^ ^{a} ^{b} Hamerly, Greg. "Making kmeans even faster". citeseerx.ist.psu.edu. Retrieved .
 ^ Kanungo, T.; Mount, D. M.; Netanyahu, N. S.; Piatko, C. D.; Silverman, R.; Wu, A. Y. (2002). "An efficient kmeans clustering algorithm: Analysis and implementation" (PDF). IEEE Trans. Pattern Analysis and Machine Intelligence. 24 (7): 881892. doi:10.1109/TPAMI.2002.1017616. Retrieved .
 ^ Drake, Jonathan (2012). "Accelerated kmeans with adaptive distance bounds" (PDF). The 5th NIPS Workshop on Optimization for Machine Learning, OPT2012.
 ^ Hartigan, J. A.; Wong, M. A. (1979). "Algorithm AS 136: A KMeans Clustering Algorithm". Journal of the Royal Statistical Society, Series C. 28 (1): 100108. JSTOR 2346830.
 ^ Dhillon, I. S.; Modha, D. M. (2001). "Concept decompositions for large sparse text data using clustering". Machine Learning. 42 (1): 143175. doi:10.1023/a:1007612920971.
 ^ Steinbach, M., Karypis, G., & Kumar, V. (2000, August). A comparison of document clustering techniques. In KDD workshop on text mining (Vol. 400, No. 1, pp. 525526).
 ^ Pelleg, D., & Moore, A. W. (2000, June). Xmeans: Extending Kmeans with Efficient Estimation of the Number of Clusters. In ICML (Vol. 1).
 ^ Hamerly, G., & Elkan, C. (2004). Learning the k in kmeans. Advances in neural information processing systems, 16, 281.
 ^ Amorim, R.C.; Mirkin, B. (2012). "Minkowski Metric, Feature Weighting and Anomalous Cluster Initialisation in KMeans Clustering". Pattern Recognition. 45 (3): 10611075. doi:10.1016/j.patcog.2011.08.012.
 ^ Amorim, R.C.; Hennig, C. (2015). "Recovering the number of clusters in data sets with noise features using feature rescaling factors". Information Sciences. 324: 126145. doi:10.1016/j.ins.2015.06.039.
 ^ Sculley, David (2010). "Webscale kmeans clustering". Proceedings of the 19th international conference on World wide web. ACM. pp. 11771178. Retrieved .
 ^ Mirkes, E.M. "Kmeans and Kmedoids applet.". Retrieved 2016.
 ^ Honarkhah, M; Caers, J (2010). "Stochastic Simulation of Patterns Using DistanceBased Pattern Modeling". Mathematical Geosciences. 42 (5): 487517. doi:10.1007/s1100401092767.
 ^ ^{a} ^{b} ^{c} Coates, Adam; Ng, Andrew Y. (2012). "Learning feature representations with kmeans" (PDF). In G. Montavon, G. B. Orr, K.R. Müller. Neural Networks: Tricks of the Trade. Springer.
 ^ Csurka, Gabriella; Dance, Christopher C.; Fan, Lixin; Willamowski, Jutta; Bray, Cédric (2004). Visual categorization with bags of keypoints (PDF). ECCV Workshop on Statistical Learning in Computer Vision.
 ^ ^{a} ^{b} Coates, Adam; Lee, Honglak; Ng, Andrew Y. (2011). An analysis of singlelayer networks in unsupervised feature learning (PDF). International Conference on Artificial Intelligence and Statistics (AISTATS).
 ^ Schwenker, Friedhelm; Kestler, Hans A.; Palm, Günther (2001). "Three learning phases for radialbasisfunction networks". Neural Networks. 14 (45): 439458. CiteSeerX 10.1.1.109.312 . doi:10.1016/s08936080(01)000272.
 ^ Lin, Dekang; Wu, Xiaoyun (2009). Phrase clustering for discriminative learning (PDF). Annual Meeting of the ACL and IJCNLP. pp. 10301038.
 ^ Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007). "Section 16.1. Gaussian Mixture Models and kMeans Clustering". Numerical Recipes: The Art of Scientific Computing (3rd ed.). New York: Cambridge University Press. ISBN 9780521880688.
 ^ Aharon, Michal; Elad, Michael; Bruckstein, Alfred (2006). "KSVD: An Algorithm for Designing Overcomplete Dictionaries for Sparse Representation" (PDF). IEEE Transactions on Signal Processing. 54 (11): 4311. Bibcode:2006ITSP...54.4311A. doi:10.1109/TSP.2006.881199.
 ^ H. Zha, C. Ding, M. Gu, X. He and H.D. Simon (Dec 2001). "Spectral Relaxation for Kmeans Clustering" (PDF). Neural Information Processing Systems vol.14 (NIPS 2001). Vancouver, Canada: 10571064.
 ^ Chris Ding and Xiaofeng He (July 2004). "Kmeans Clustering via Principal Component Analysis" (PDF). Proc. of Int'l Conf. Machine Learning (ICML 2004): 225232.
 ^ Drineas, P.; A. Frieze; R. Kannan; S. Vempala; V. Vinay (2004). "Clustering large graphs via the singular value decomposition" (PDF). Machine learning. 56: 933. doi:10.1023/b:mach.0000033113.59016.96. Retrieved .
 ^ Cohen, M.; S. Elder; C. Musco; C. Musco; M. Persu (2014). "Dimensionality reduction for kmeans clustering and low rank approximation (Appendix B)". arXiv:1410.6801 [cs.DS].
 ^ ^{a} ^{b} Little, M.A.; Jones, N.S. (2011). "Generalized Methods and Solvers for Piecewise Constant Signals: Part I" (PDF). Proceedings of the Royal Society A. 467 (2135): 30883114. Bibcode:2011RSPSA.467.3088L. doi:10.1098/rspa.2010.0671.
 ^ Alon Vinnikov and Shai ShalevShwartz (2014). "Kmeans Recovers ICA Filters when Independent Components are Sparse" (PDF). Proc. of Int'l Conf. Machine Learning (ICML 2014).