# K-means

In statistics and machine learning, k-means clustering is a method of cluster analysis which aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean. It is similar to the expectation-maximization algorithm for mixtures of Gaussians in that they both attempt to find the centers of natural clusters in the data as well as in the iterative refinement approach employed by both algorithms.

Given a set of observations (**x**_{1}, **x**_{2}, …, **x**_{n}), where each observation is a *d*-dimensional real vector, *k*-means clustering aims to partition the *n* observations into *k* sets (*k* ≤ *n*) **S** = {*S*_{1}, *S*_{2}, …, *S*_{k}} so as to minimize the within-cluster sum of squares (WCSS):

where **μ**_{i} is the mean of points in *S*_{i}.

For more detail information, please visit WIKI: http://en.wikipedia.org/wiki/K-means