0
Upcoming SlideShare
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Standard text messaging rates apply

# Kmeans initialization

1,727

Published on

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

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total Views
1,727
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
37
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Transcript

• 1. K-Means Clustering Problem Ahmad Sabiq Febri Maspiyanti Indah Kuntum Khairina Wiwin Farhania Yonatan
• 2. What is k-means?&#x2022; To partition n objects into k clusters, based on attributes. &#x2013; Objects of the same cluster are close their attributes are related to each other. &#x2013; Objects of different clusters are far apart their attributes are very dissimilar.
• 3. Algorithm&#x2022; Input: n objects, k (integer k &#x2264; n)&#x2022; Output: k clusters&#x2022; 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&#x2019;t change, stop (convergence). Otherwise, back to step 2.&#x2022; Complexity: O(k.n.d.total_iteration)
• 4. Initialization&#x2022; Why is it important? What does it affect? &#x2013; Clustering result local optimum! &#x2013; Total iteration / complexity
• 5. Good Initialization3 clusters with 2 iterations&#x2026;
• 6. Bad Initialization3 clusters with 4 iterations&#x2026;
• 7. Initialization Methods1. Random2. Forgy3. Macqueen4. Kaufman
• 8. Random&#x2022; Algorithm: 1. Assigns each object to a random cluster. 2. Computes the initial centroid of each cluster.
• 9. Random
• 10. Random
• 11. Random9876543210 0 5 10 15 20 25 30 35
• 12. Forgy&#x2022; Algorithm: 1. Chooses k objects at random and uses them as the initial centroids.
• 13. Forgy9876543210 0 5 10 15 20 25 30 35
• 14. MacQueen&#x2022; 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. MacQueen9876543210 0 5 10 15 20 25 30 35
• 16. MacQueen
• 17. MacQueen
• 18. MacQueen
• 19. MacQueen
• 20. MacQueen
• 21. MacQueen
• 22. MacQueen
• 23. MacQueen
• 24. MacQueen
• 25. Kaufman
• 26. Kaufman
• 27. Kaufman
• 28. Kaufman
• 29. Kaufman
• 30. Kaufman
• 31. Kaufman
• 32. Kaufman
• 33. Kaufman C=0d = 24,33 D = 15,52
• 34. Kaufman C=0 C=0 C=0 C=0 C=0
• 35. Kaufman C=0 C=0 C=0 C=0&#x2211;C1 = 2,74 C=0
• 36. Kaufman &#x2211;C5 = 52,55 &#x2211;C6 = 55,88 &#x2211;C9 = 42,69 &#x2211;C7 = 53,77&#x2211;C1 = 2,74 &#x2211;C8 = 51,16 &#x2211;C2 = 12,,21 &#x2211;C3 = 12,36 &#x2211;C3 = 8,38
• 37. Kaufman &#x2211;C5 = 52,55 &#x2211;C6 = 55,88 &#x2211;C9 = 42,69 &#x2211;C7 = 53,77&#x2211;C1 = 2,74 &#x2211;C8 = 51,16 &#x2211;C2 = 12,,21 &#x2211;C3 = 12,36 &#x2211;C3 = 8,38
• 38. Reference1. J.M. Pe&#xF1;a, J.A. Lozano, and P. Larra&#xF1;aga. An Empirical Comparison of Four Initialization Methods for the K- Means Algorithm. Pattern Recognition Letters, vol. 20, pp. 1027&#x2013;1040. 1999.2. J.R. Cano, O. Cord&#xF3;n, F. Herrera, and L. S&#xE1;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 &#x2013; 242. 2002.3. L. Kaufman and P.J. Rousseeuw. Finding Groups in Data: An Introduction to Cluster Analysis. Wiley. 1990.
• 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.