K - Means Clustering
K - Means is a classical clustering algorithm, targeting intra-cluster close resemblance and inter-cluster difference.
Without loss of generality, the procedure of assigning \(n\) samples to \(k\) clusters can be listed as follows.
- Initialize the cluster centers: Randomly select \(k\) different samples as cluster centers.
- Assign samples: For each sample, compute its distance to each cluster center, and assign the sample to its closest cluster.
- Update cluster centers: For each cluster, update the mean value of intra-cluster samples as the new cluster center.
- Repeat steps 2 and 3 until cluster centers do not change anymore or a maximum/expected number of iterations are reached.