1 answer
With initial means 2 and 4, K-Means gives K1 = {2, 3, 4, 10, 11, 12} (mean 7) and K2 = {20, 23, 25, 30, 56} (mean 30.8).
K-Means algorithm
- Choose the number of clusters \(k\) and initial means (here the first two values, 2 and 4).
- Assign each item to the cluster whose mean is nearest (\(|x - m|\)).
- Recalculate each mean from its members.
- Repeat until the clusters (means) do not change.
Solution for {2, 4, 10, 12, 3, 20, 30, 11, 25, 56, 23}, \(k = 2\):
| Iter. | Means | K1 | K2 | New means |
|---|---|---|---|---|
| 1 | 2, 4 | {2, 3} | {4, 10, 11, 12, 20, 23, 25, 30, 56} | 2.5, 21.22 |
| 2 | 2.5, 21.22 | {2, 3, 4, 10, 11} | {12, 20, 23, 25, 30, 56} | 6, 27.67 |
| 3 | 6, 27.67 | {2, 3, 4, 10, 11, 12} | {20, 23, 25, 30, 56} | 7, 30.8 |
| 4 | 7, 30.8 | {2, 3, 4, 10, 11, 12} | {20, 23, 25, 30, 56} | no change |
Working of the means: iteration 1, K2 sum \(= 191\), so mean \(= 191/9 = 21.22\); iteration 2, K1 \(= 30/5 = 6\), K2 \(= 166/6 = 27.67\); iteration 3, K1 \(= 42/6 = 7\), K2 \(= 154/5 = 30.8\).
Close cases: in iteration 1, item 3 is equally far from 2 and 4 and is placed in K1; in iteration 2, item 12 is 9.5 from 2.5 and 9.22 from 21.22, so it is in K2, but in iteration 3 it is 6 from 6 and 15.67 from 27.67, so it moves to K1.
Final clusters: K1 = {2, 3, 4, 10, 11, 12}, mean 7; K2 = {20, 23, 25, 30, 56}, mean 30.8. (A different choice of initial means can give a different final result, which is a known limitation of K-Means.)
Your answer
Log in or create a free account to answer this question.