

















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


















So far, our data has beenin this form:
We will be looking at unlabeled data:
x
1 ,x
1 , x 2
1 ,…, x 3
(^1) m
x
2 x
2
x
2
x^
2
(^1) y (^2) y
in this form:
x
1 ,x
1 , x 2
1 ,…, x 3
(^1) m
x
2 x
2
x
2
x^
2
unlabeled
data:
x^1
,x
, x
,…, xm (^) … …
y^
x
,x
, x
,…, xm (^) … …
x
n,x
n, x 2
n,…, x 3
nm
ny
x
n,x
n, x 2
n,…, x 3
nm
What do we expect to learn from such data? I have tons of data and need to:
organize it better – e.g., find subgroupsunderstand it better – e.g., understand interrelationshipsfind regular trends in it – e.g., If A and B, then C
Finding association patterns in data …
Dimension reduction for visualization
Monthly spending
Monthly income
What is ClusteringWhat
is Clustering
all
given examples into
disjoint
subsets
of
clusters such that:
subsets
of
clusters
, such that:
Examples in different clusters are (very) different
Vector quantization for image
compression
127,292 bytes
701,554 bytes
Important components in clusteringImportant
components in clustering
objects?
distance/similarity measures
good
Common distance/similarity measuresCommon
distance/similarity measures
-^
Euclidean distance
∑=
′ −
= ′^
d i
i
i^
x
x
L
1
2
2
)
(
) , (^
x x
-^
City block distance (Manhattan distance)
-^
Cosine similarity
-^
More flexible measures:
2
1
)
(
) , (^
i
d i
i i^
x x w
D
′ −
= ′^
x x
one can learn the appropriate weights given user guidance
Note: We can always transform between distance and similarity using aNote: We can always transform between distance and similarity using a
monotonically decreasing function
How to decide which to use?
-^
Usually need to consider the application domain, youneed to ask questions such as:– What does it mean for two consumers to be similar to each
other? Or for two genes to be similar to each other?
-^
Ideally we’d like to learn a distance ftn from user input– Ask users to provide things like object A is similar to object B,
dissimilar to object C
but nonetheless important
-^
When we can not afford to learn a distance measure,and don’t have a clue about which distance function isappropriate, what should we do?
-^
Remember, clustering is an exploratory procedure and itRemember, clustering is an exploratory procedure and itis important to explore – i.e., try different options
Hierarchical and non-hierarchical
ClusteringClustering
-^
Hierarchical clustering
builds a tree-based hierarchical
taxonomy (
dendrogram
)^
i^
l
animal
vertebrate
invertebrate
fish reptile
L
mammal
worm
L
insect
-^
A non-hierarchical (flat) clustering
produces a single
partition of the unlabeled datap
-^
Choosing a particular level in the hierarchy produces aflat clustering
f f
-^
Recursive application of flat clustering can also producea hierarchical clustering.
Hierarchical Agglomerative Clustering
Assumes a
distance function
for determining the
similarity of two instances.– One can also assume a similarity function, and
reverse many of the operations in the algorithm tomake it work for similarities St
t^
ith
h
bj
t i
t^
l^
t^
d
Starts with each object in a separate cluster andthen repeatedly joins the two closest clustersuntil only one cluster is leftuntil only one cluster is left
-^
The history of merging forms a binary tree (or ahierarchy)hierarchy).
HAC AlgorithmHAC
Algorithm
St
t^
ith
ll
bj
t^
i^
th i
l^
t
St
art with all objects in their own cluster. Until there is only one cluster:
Among the current clusters determine the twoAmong the current clusters, determine the two
clusters,
c
and i
c
, that are closest j
Replace
c
and i
c
with a single cluster j
c
∪ i
c
j
Problem
: our distance function computes
distance between instances, but we also needto compute distance between clusters.to co
pute d sta ce bet
ee
c uste s
How?
Distance Between ClustersDistance
Between Clusters
Assume a distance function that determinesthe distance of two objects:
( x
x
the
distance of two objects:
( x
, x
There are multiple way to turn a distance
p
y
function into a cluster distance function:– Single Link: distance of two closest members of
clusters
clusters
Average Link: average distance