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:
---cognitive-computing---machine-intelligence/ai---subfields/machine-learning-(ml)---pattern-recognition/ml---models/clustering/hard-clustering/k-means-clustering/k-means-algorithm.png)
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
}