CLARA CLARANS Example
CLARA CLARANS Example
Problem Setup:
We have a dataset with 10 points in 2D space, and we need to cluster them into 2 clusters.
| | P1 | P4 | P6 | P7 | P9 |
|--------|-----|-----|-----|-----|-----|
| **P1** | 0 | 5 | 10 | 9 | 12 |
| **P4** | 5 | 0 | 5 | 10 | 7 |
| **P6** | 10 | 5 | 0 | 9 | 4 |
| **P7** | 9 | 10 | 9 | 0 | 5 |
| **P9** | 12 | 7 | 4 | 5 | 0 |
Using PAM, we identify the medoids. Suppose we pick P4 and P9 as initial medoids. Now,
we assign the remaining points to the closest medoid:
- P1 → P4
- P6 → P9
- P7 → P9
Conclusion:
- CLARA optimizes by sampling and using PAM, but it can miss the global optimum because
it only evaluates a small subset of data.
- CLARANS uses a randomized search approach, allowing it to explore more medoids and
find a better clustering solution.