Upcoming SlideShare
×

# Kmeans initialization

4,715 views

Published on

Published in: Technology
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

• Be the first to like this

Views
Total views
4,715
On SlideShare
0
From Embeds
0
Number of Embeds
1,308
Actions
Shares
0
103
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Kmeans initialization

1. 1. K-Means Clustering Problem Ahmad Sabiq Febri Maspiyanti Indah Kuntum Khairina Wiwin Farhania Yonatan
2. 2. What is k-means?• To partition n objects into k clusters, based on attributes. – Objects of the same cluster are close their attributes are related to each other. – Objects of different clusters are far apart their attributes are very dissimilar.
3. 3. Algorithm• Input: n objects, k (integer k ≤ n)• Output: k clusters• Steps: 1. Select k initial centroids. 2. Calculate the distance between each object and each centroid. 3. Assign each object to the cluster with the nearest centroid. 4. Recalculate each centroid. 5. If the centroids don’t change, stop (convergence). Otherwise, back to step 2.• Complexity: O(k.n.d.total_iteration)
4. 4. Initialization• Why is it important? What does it affect? – Clustering result local optimum! – Total iteration / complexity
5. 5. Good Initialization3 clusters with 2 iterations…
6. 6. Bad Initialization3 clusters with 4 iterations…
7. 7. Initialization Methods1. Random2. Forgy3. Macqueen4. Kaufman
8. 8. Random• Algorithm: 1. Assigns each object to a random cluster. 2. Computes the initial centroid of each cluster.
9. 9. Random
10. 10. Random
11. 11. Random9876543210 0 5 10 15 20 25 30 35
12. 12. Forgy• Algorithm: 1. Chooses k objects at random and uses them as the initial centroids.
13. 13. Forgy9876543210 0 5 10 15 20 25 30 35
14. 14. MacQueen• Algorithm: 1. Chooses k objects at random and uses them as the initial centroids. 2. Assign each object to the cluster with the nearest centroid. 3. After each assignment, recalculate the centroid.
15. 15. MacQueen9876543210 0 5 10 15 20 25 30 35
16. 16. MacQueen
17. 17. MacQueen
18. 18. MacQueen
19. 19. MacQueen
20. 20. MacQueen
21. 21. MacQueen
22. 22. MacQueen
23. 23. MacQueen
24. 24. MacQueen
25. 25. Kaufman
26. 26. Kaufman
27. 27. Kaufman
28. 28. Kaufman
29. 29. Kaufman
30. 30. Kaufman
31. 31. Kaufman
32. 32. Kaufman
33. 33. Kaufman C=0d = 24,33 D = 15,52
34. 34. Kaufman C=0 C=0 C=0 C=0 C=0
35. 35. Kaufman C=0 C=0 C=0 C=0∑C1 = 2,74 C=0
36. 36. Kaufman ∑C5 = 52,55 ∑C6 = 55,88 ∑C9 = 42,69 ∑C7 = 53,77∑C1 = 2,74 ∑C8 = 51,16 ∑C2 = 12,,21 ∑C3 = 12,36 ∑C3 = 8,38
37. 37. Kaufman ∑C5 = 52,55 ∑C6 = 55,88 ∑C9 = 42,69 ∑C7 = 53,77∑C1 = 2,74 ∑C8 = 51,16 ∑C2 = 12,,21 ∑C3 = 12,36 ∑C3 = 8,38
38. 38. Reference1. J.M. Peña, J.A. Lozano, and P. Larrañaga. An Empirical Comparison of Four Initialization Methods for the K- Means Algorithm. Pattern Recognition Letters, vol. 20, pp. 1027–1040. 1999.2. J.R. Cano, O. Cordón, F. Herrera, and L. Sánchez. A Greedy Randomized Adaptive Search Procedure Applied to the Clustering Problem as an Initialization Process Using K-Means as a Local Search Procedure. Journal of Intelligent and Fuzzy Systems, vol. 12, pp. 235 – 242. 2002.3. L. Kaufman and P.J. Rousseeuw. Finding Groups in Data: An Introduction to Cluster Analysis. Wiley. 1990.
39. 39. Questions1. Kenapa inisialisasi penting pada k-means?2. Metode inisialisasi apa yang memiliki greedy choice property?3. Jelaskan kompleksitas O(nkd) pada metode Random.