cs221-lecture12
cs221-lecture12
Lecture 11:
Unsupervised Machine Learning
3
K-Means
2
x j i
iclusters
jelements of i'th cluster
* From Marc Pollefeys COMP 256 2003
K-Means
K-Means
p ( x xi | j )
E-Step E[ zij ] k
p ( x x |
n 1
i n )
1 2
2
( xi j )
2
e
k 1 2
( x )
e
2 i n
2
n 1
1 m
M-Step j E[ zij ] xi
m i 1
Expectation Maximization
Converges!
Proof [Neal/Hinton, McLachlan/Krishnan]:
E/M step does not decrease data likelihood
Converges at local minimum or saddle point
But subject to local minima
EM Clustering: Results
http://www.ece.neu.edu/groups/rpl/kmeans/
Practical EM
Number of Clusters unknown
Suffers (badly) from local minima
Algorithm:
Start new cluster center if many points
“unexplained”
Kill cluster center that doesn’t contribute
(Use AIC/BIC criterion for all this, if you want
to be formal)
15
Spectral Clustering
16
Spectral Clustering
17
The Two Spiral Problem
18
Spectral Clustering: Overview
* Slides from Dan Klein, Sep Kamvar, Chris Manning, Natural Language Group Stanford University
Eigenvectors and Blocks
Block matrices have block eigenvectors:
1= 2 =2
2 =0
3 =0
4
1 1 0 0 .71 0
1 1 0 0 .71 0
0 0 1 1 eigensolver 0 .71
0 0 1 1 0 .71
1 1 .2 0 .71 0
1 1 0 -.2 .69 -.14
.2 0 1 1 eigensolver .14 .69
0 -.2 1 1 0 .71
* Slides from Dan Klein, Sep Kamvar, Chris Manning, Natural Language Group Stanford University
Spectral Space
Can put items into blocks by eigenvectors: e1
1 1 .2 0 .71 0
1 1 0 -.2 .69 -.14
.2 0 1 1 .14 .69 e2
0 -.2 1 1 0 .71
e1 e2
Resulting clusters independent of row ordering:
e1
1 .2 1 0 .71 0
.2 1 0 1 .14 .69
1 0 1 -.2 .69 -.14 e2
0 1 -.2 1 0 .71
e1 e2
* Slides from Dan Klein, Sep Kamvar, Chris Manning, Natural Language Group Stanford University
The Spectral Advantage
The key advantage of spectral clustering is the spectral space
representation:
* Slides from Dan Klein, Sep Kamvar, Chris Manning, Natural Language Group Stanford University
Measuring Affinity
Intensity
1
aff x, y exp
2 2
i
2
I x I y
Distance
2
aff x, yexp 1 2 x y
2 d
Texture
2
aff x, yexp 1 2 cx cy
2 t
* From Marc Pollefeys COMP 256 2003
Scale affects affinity
26
Slide credit: Santiago Serrano
Eigenfaces
27
Slide credit: Santiago Serrano
Scape (Drago Anguelov et al)
28