Unsupervised Learning
Unsupervised Learning
Machine Learning
Unsupervised learning
2
Disclaimer Statement
In preparation of these slides, materials have been taken
from different online sources in the shape of books, websites,
research papers and presentations etc. However, the author
does not have any intention to take any benefit of these in
her/his own name. This lecture (audio, video, slides etc) is
prepared and delivered only for educational purposes and is
not intended to infringe upon the copyrighted material.
Sources have been acknowledged where applicable. The
views expressed are presenter’s alone and do not necessarily
represent actual author(s) or the institution.
Unsupervised Learning
Training data:“examples” x.
x1 , . . . , x n , x i ∈ X ⊂ Rn
• Clustering/segmentation:
f : R d − → {C 1 , . . . C k } (set of clusters).
Feature 2
Feature 1
Find clusters in the population feature 1 and feature 2.
Unsupervised learning
Feature 2
Feature 1
Methods: K-means, gaussian mixtures, hierarchical agglomerative clustering,
spectral clustering, DBScan, etc.
Clustering examples
• Clustering of the population by their demographics.
Clustering of stars
K-Means: example
Clustering of stars
K-Means: example
Clustering of stars
K-Means: example
Clustering of stars
Clustering: K-Means
• Goal: Assign each example (x 1 , . . . , x n ) to one of the k clusters
{C1, . . . Ck}.
Clustering: K-Means
• Goal: Assign each example (x 1 , . . . , x n ) to one of the k clusters
{C1, . . . Ck}.
• Minimize: Σk Σ
2
J = ||x i − µ j ||
j=1 x i ∈C j
Clustering: K-Means
Algorithm K-Means:
Initialize randomly µ 1 , · · · µ k .
Clustering: K-Means
Algorithm K-Means: Initialize
randomly µ 1 , · · · µ k . Repeat
Assign each point x i to
the cluster with the closest µ j .
Clustering: K-Means
Algorithm K-Means: Initialize
randomly µ 1 , · · · µ k . Repeat
Assign each point x i to the cluster with the closest µ j .
Calculate the new mean for each cluster as follows:
1 Σ
µj = xi
|Cj |
x i ∈C j
Until convergence∗.
Clustering: K-Means
Algorithm K-Means: Initialize
randomly µ 1 , · · · µ k . Repeat
Assign each point x i to the cluster with the closest µ j .
Calculate the new mean for each cluster as follows:
1 Σ
µj = xi
|Cj |
x i ∈C j
Until convergence∗.
BUT...
-Need to know K
-Suffer from the curse of dimensionality
-No theoretical foundation
K-Means: questions
There are other methods: spectral clustering, DBSCAN, BIRCH, etc. that
handle other shapes.