Docsity

Clustering-Introduction to Machine Learning-Lecture 22-Computer Science, Lecture notes of Introduction to Machine Learning

Partial preview of the text

Download Clustering-Introduction to Machine Learning-Lecture 22-Computer Science and more Lecture notes Introduction to Machine Learning in PDF only on Docsity!

Lecture 22: Clustering

TTIC 31020: Introduction to Machine Learning

Instructor: Greg Shakhnarovich

TTI–Chicago

November 15, 2010

Vector Quantization

We can use the cluster mean as a prototype representing all the examples assigned to the cluster. Vector quantization: construct a codebook using k-means.

(^10 2 4 6 8 ) 23

45

67

89

(^10 2 4 6 8 ) 23

45

67

89

(^10 2 4 6 8 ) 23

45

67

89

Whenever need to transmit x, transmit instead the closest codebook.

  • The bits to transmit: log kd once + log k for every message.

Setting k

How can we set k? Cross-validation doesn’t work (why?)

Setting k

How can we set k? Cross-validation doesn’t work (why?) The relevant statistic: within-class dissimilarity

Wk =

∑^ k

c=

yi=yj =c

‖xi − xj ‖^2.

A popular (heuristic) strategy: look for an “elbow” in Wk

0 2 4 6 8 10 12 14 16 18 20 1 0 2 4 6 8 10

23

45

67

89

Mixture of Gaussians EM versus k-means

k-means:

  • No probabilistic model ⇒ no estimated density.
  • (^) faster to compute (only a single explanation for each data point).
  • (^) Limited by the underlying assumption of spherical clusters We can bring back the covariance–get “hard EM”.
  • (^) Still limited by the shape of the covariance (ellipsoid). Both EM and k-means depend on initialization (can get stuck in local optima).
  • Useful trick: run k-means and use the result to initialize EM.

Practical aspects

Can have empty clusters

  • (^) Take the example with highest distance to its mean, and create a new cluster.

Many strategies for initialization

  • Start with a random example as μ 1 ; then,

μc = argmax x

min j=1,...,c

‖x − μj ‖.

Robustness: we want to diminish the influence of outliers

  • Set a threshold on the distance;
  • (^) Ignore top percentile of distances in the M-step.

Hierarchical structure discovery

In some cases we want to explore the structure of the similarities in the data beyond partitioning to k groups.

E.g., a hierarchical structure (subclusters,sub-subclusters etc.)

Hierarchical structure discovery

In some cases we want to explore the structure of the similarities in the data beyond partitioning to k groups.

E.g., a hierarchical structure (subclusters,sub-subclusters etc.)

Hierarchical clustering: produce hierarchical representation, that can be depicted as a tree–dendrogram.

Bottom-up agglomeration

Bottom-up agglomeration

Bottom-up agglomeration

Bottom-up agglomeration

Bottom-up agglomeration

Agglomerative hierarchical clustering

Denote by Cin the i-th cluster at level n.

Initialize CiN = {xi}.

At level n = N − 1 , N − 2 ,... , 1:

  • (^) Find two closest clusters Cn i +1, Cn j +1:

D(C in +1, C jn +1) = max l,m

D(C ln +1, C mn+1 )

  • (^) Merge them: C 1 n = Cn i+

C jn +1. For the rest of the clusters, Cln = C ln+