Docsity

Machine Learning CS 5350/6350: Clustering Unsupervised Learning, Study notes of Computer Science

Toggle sidebar
bg1
Machine Learning (CS 5350/CS 6350) 13 Feb 2007
Clustering
Now begins our foray into unsupervised learning. Most unsupervised learning problems deal only with input
data, typically considered as a matrix X∈RN×Dover Ndata points and Ddimensions. There are no
labels.
Clustering is the problem of grouping data according to similarity.
Typically one uses a distance metric to judge similarity (though this is not always required). A metric d
must satisfy:
1. d(x, y) = 0 iff x=y– isolation
2. d(x, y) = d(y, x) – distance is symmetric
3. d(x, y) + d(y, z )≥d(x, z) – triangle inequality
If (1) doesn’t hold, it is a pseudo-metric.
All of our favorite norms are metrics. Non-real metrics include things like string edit distance.
Basically two types of clustering:
1. Hierarchical
2. Flat
Hierarchical tries to build a tree over the data (Nleaves). Typically binary. Flat just tries to find Kclusters
of the data.
Hierarchical Clustering
Bottom-up strategy:
1. Put every element into its own cluster
2. Merge two most similar clusters
3. If >1 cluster exists, go to (2)
How to measure “similar.” For individual data points, just use the metric d. What about sim({x1, x2},{x3, x4, x5})?
1. Min-link (aka “single link”):
sim(R, S) = min
xR∈R,xS∈Sd(xR, xS)
2. Max-link (aka “complete”):
sim(R, S) = max
xR∈R,xS∈Sd(xR, xS)
3. Average-link:
sim(R, S) = 1
|R| |S|X
xR∈R,xS∈S
d(xR, xS)
1
pf3

Partial preview of the text

Download Machine Learning CS 5350/6350: Clustering Unsupervised Learning and more Study notes Computer Science in PDF only on Docsity!

Machine Learning (CS 5350/CS 6350) 13 Feb 2007

Clustering

Now begins our foray into unsupervised learning. Most unsupervised learning problems deal only with input data, typically considered as a matrix X ∈ RN^ ×D^ over N data points and D dimensions. There are no labels. Clustering is the problem of grouping data according to similarity. Typically one uses a distance metric to judge similarity (though this is not always required). A metric d must satisfy:

  1. d(x, y) = 0 iff x = y – isolation
  2. d(x, y) = d(y, x) – distance is symmetric
  3. d(x, y) + d(y, z) ≥ d(x, z) – triangle inequality

If (1) doesn’t hold, it is a pseudo-metric. All of our favorite norms are metrics. Non-real metrics include things like string edit distance. Basically two types of clustering:

  1. Hierarchical
  2. Flat

Hierarchical tries to build a tree over the data (N leaves). Typically binary. Flat just tries to find K clusters of the data.

Hierarchical Clustering Bottom-up strategy:

  1. Put every element into its own cluster
  2. Merge two most similar clusters
  3. If > 1 cluster exists, go to (2)

How to measure “similar.” For individual data points, just use the metric d. What about sim({x 1 , x 2 }, {x 3 , x 4 , x 5 })?

  1. Min-link (aka “single link”): sim(R, S) = (^) xR ∈minR,xS ∈S d(xR, xS )
  2. Max-link (aka “complete”): sim(R, S) = (^) xR ∈maxR,xS ∈S d(xR, xS )
  3. Average-link: sim(R, S) = (^) |R| |^1 S|^ ∑ xR ∈R,xS ∈S

d(xR, xS )

Clustering 2

These have very different properties. Min-link results in chaining. Max-link results in very “round” clusters. Average-link is an intermediary. Top-down strategy:

  1. Put every element into a single cluster
  2. Remove the “outsider” (or outsiders) from the group
  3. If a cluster of size > 1 exists, go to (2)

Same story as bottom up with linkage. Here, if we remove a single element, we get a funny tree. If we want to split clusters in half, it can be very computationally expensive. Typically bottom-up is prefered.

Flat Clustering Want to break N elements into K groups. How to choose the groups?

  1. Want high intercluster similarity: ∑ k^ ∑ n 6 =m∈k d(xn, xm) should be low.
  2. Want low intracluster similarity: ∑ k 6 =k′^ ∑ n∈k^ ∑ m∈k′ d(xn, xm) should be high.

Too hard to optimize a linear combination of these... there are (^) K^1!^ ∑ k(−1)K−k(Kk^ )kN^ possible clusters (for N = 19, K = 4, this is over 10^10. Idea: propose clusters, then iteratively fix errors.

  1. Initialize cluster centers
  2. Assign each data point to the closest center
  3. Recompute the centers as the means of the data points
  4. If assignments have changed, go to (2)

This is the k-means algorithm. It is highly sensitive to initialization, but converges quite quickly. (There are various ways to speed it up, as well.) Initializing means:

  1. Random points drawn from a “reasonable” input space
  2. Random data points
  3. First a random data point, then a second data point as far away as possible, then a third data point again as far away as possible, etc.

In general, it’s a good idea to do a few runs of k-means. k-mediods is similar, but forces each centroid to be a data point. This is advantageous for non-real-valued data.