Algorithm 2 Hartigan’s K-means |
---|
1: Initialize centroids and label for each point; |
2: repeat |
3: For each point, find a new centroid via mostly decreasing Eq. (1) after label switching; |
4: Recompute the old and new centroids by this point; |
5: until The centroids do not change. |