k-Means Clustering is a type ofΒ Hard Clustering that aims to partition 𝑛 observations into π‘˜ clusters

We note 𝑐(𝑖) the cluster of data point 𝑖 and πœ‡π‘— the center of cluster 𝑗

Algorithm ― After randomly initializing the cluster centroids πœ‡1, πœ‡2, …, πœ‡π‘˜ ∈ ℝ𝑛, the k-means clustering repeats the following step until convergence:

K-Means - General Algorithm

iterative-clustering-algorithm(points, k) {
	cluster-centers = k random points (means)
	do until convergence:
		for each point in points:
		assign point to closest cluster-center
		change each cluster-center to the average of its assigned points
}

K-Means - Other