1 answer
With initial means 2 and 4, K-Means gives K1 = {2, 3, 4, 10, 11, 12} (mean 7) and K2 = {20, 25, 30} (mean 25).
Clustering is unsupervised learning that groups data so that items in the same cluster are similar to each other and different from items in other clusters (no class labels are given). Types: partitioning (K-Means), hierarchical, density-based (DBSCAN), grid-based and model-based.
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}, \(k = 2\):
| Iter. | Means | K1 | K2 | New means |
|---|---|---|---|---|
| 1 | 2, 4 | {2, 3} | {4, 10, 11, 12, 20, 25, 30} | 2.5, 16 |
| 2 | 2.5, 16 | {2, 3, 4} | {10, 11, 12, 20, 25, 30} | 3, 18 |
| 3 | 3, 18 | {2, 3, 4, 10} | {11, 12, 20, 25, 30} | 4.75, 19.6 |
| 4 | 4.75, 19.6 | {2, 3, 4, 10, 11, 12} | {20, 25, 30} | 7, 25 |
| 5 | 7, 25 | {2, 3, 4, 10, 11, 12} | {20, 25, 30} | no change |
Notes on close cases: in iteration 1, item 3 is equally far (1) from 2 and 4 and is put in K1; in iteration 3, item 10 is 7 from 3 and 8 from 18, so it joins K1; in iteration 4, item 12 is 7.25 from 4.75 and 7.6 from 19.6, so it joins K1.
Final clusters: K1 = {2, 3, 4, 10, 11, 12} with mean 7, K2 = {20, 25, 30} with mean 25.
Your answer
Log in or create a free account to answer this question.