Let

In this problem we will use

Goal: Find member and centroid of each cluster

Step

  1. Choose K-centroid randomly (It can be any points)
  1. Find the nearest centroid for each point and assign each point to those centroid

In this problem we use Euclidean Distance

Let assume that we have assigned each point to its nearest centroid using Euclidean distance as a matric distance and get this result.

  • j1 has [A1, A3, A7, A9]
  • j2 has [A4, A6, A8]
  • j3 has [A2, A5]
  1. Find new centroid and see if cluster member change or not
  • If cluster member remain the same : Finish!
  • If cluster member change : Find new centroid again!

from j = 1 to K

where

Example

jcentroid
1
2
3
  • j1 has [A1, A3, A7, A9]
  • j2 has [A4, A6, A8]
  • j3 has [A2, A5]

Member of cluster is not changed so FINISH!

Result