Download presentation
Presentation is loading. Please wait.
Published byClement Summers Modified over 9 years ago
1
Clustering Unsupervised learning introduction Machine Learning
2
Andrew Ng Supervised learning Training set:
3
Andrew Ng Unsupervised learning Training set:
4
Andrew Ng Applications of clustering Organize computing clusters Social network analysis Image credit: NASA/JPL-Caltech/E. Churchwell (Univ. of Wisconsin, Madison) Astronomical data analysis Market segmentation
5
Clustering K-means algorithm Machine Learning
6
Andrew Ng
15
Input: - (number of clusters) -Training set (drop convention) K-means algorithm
16
Andrew Ng Randomly initialize cluster centroids K-means algorithm Repeat { for = 1 to := index (from 1 to ) of cluster centroid closest to for = 1 to := average (mean) of points assigned to cluster }
17
Andrew Ng K-means for non-separated clusters T-shirt sizing Height Weight
18
Clustering Optimization objective Machine Learning
19
Andrew Ng K-means optimization objective = index of cluster (1,2,…, ) to which example is currently assigned = cluster centroid ( ) = cluster centroid of cluster to which example has been assigned Optimization objective:
20
Andrew Ng Randomly initialize cluster centroids K-means algorithm Repeat { for = 1 to := index (from 1 to ) of cluster centroid closest to for = 1 to := average (mean) of points assigned to cluster }
21
Clustering Random initialization Machine Learning
22
Andrew Ng Randomly initialize cluster centroids K-means algorithm Repeat { for = 1 to := index (from 1 to ) of cluster centroid closest to for = 1 to := average (mean) of points assigned to cluster }
23
Andrew Ng Random initialization Should have Randomly pick training examples. Set equal to these examples.
24
Andrew Ng Local optima
25
Andrew Ng For i = 1 to 100 { Randomly initialize K-means. Run K-means. Get. Compute cost function (distortion) } Pick clustering that gave lowest cost Random initialization
26
Clustering Choosing the number of clusters Machine Learning
27
Andrew Ng What is the right value of K?
28
Andrew Ng Choosing the value of K Elbow method: Cost function (no. of clusters) Cost function (no. of clusters)
29
Andrew Ng Choosing the value of K Sometimes, you’re running K-means to get clusters to use for some later/downstream purpose. Evaluate K-means based on a metric for how well it performs for that later purpose. E.g. T-shirt sizing Height Weight T-shirt sizing Height Weight
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.