| Purpose: The k-means algorithm for partitioning based on the mean value of the objects in the cluster. |
| Input: A database of N objects, number of clusters k. |
| Output: A set of k clusters. |
| Method: |
| (1) Arbitrarily choose k objects as the initial cluster centers. |
| (2) (Re) Assign each object to the cluster to which the object is the most similar based on the mean value of objects in the cluster. |
| (3) Update the cluster means, that is, calculate the mean value of the objects for each cluster. |
| (4) Repeat steps 2 and 3 until no changes. |