Input //set of n data items.
K // Number of desired clusters Output: A set of K clusters, : The center of each cluster and Steps: Repeat · Calculate the distance between each data point and cluster centers using:
· Assign the data point to the cluster center whose distance from the cluster center is minimum of all the cluster centers. · Recalculate the new cluster center using:
Until the centers don’t change. |