Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8
Slides by Tan, Steinbach, Kumar adapted by Michael Hahsler Look for accompanying R code on the course web site.
Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for - - PowerPoint PPT Presentation
Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Slides by Tan, Steinbach, Kumar adapted by Michael Hahsler Look for accompanying R code on the course web site. Topics Introduction Types of Clustering
Slides by Tan, Steinbach, Kumar adapted by Michael Hahsler Look for accompanying R code on the course web site.
Inter-cluster distances are maximized Intra-cluster distances are minimized
for browsing, group genes and proteins that have similar functionality, or group stocks with similar price fluctuations
data sets
Discovered Clusters Industry Group
Applied-Matl-DOWN,Bay-Network-Down,3-COM-DOWN, Cabletron-Sys-DOWN,CISCO-DOWN,HP-DOWN, DSC-Comm-DOWN,INTEL-DOWN,LSI-Logic-DOWN, Micron-Tech-DOWN,Texas-Inst-Down,Tellabs-Inc-Down, Natl-Semiconduct-DOWN,Oracl-DOWN,SGI-DOWN, Sun-DOWN
Technology1-DOWN
Apple-Comp-DOWN,Autodesk-DOWN,DEC-DOWN, ADV-Micro-Device-DOWN,Andrew-Corp-DOWN, Computer-Assoc-DOWN,Circuit-City-DOWN, Compaq-DOWN, EMC-Corp-DOWN, Gen-Inst-DOWN, Motorola-DOWN,Microsoft-DOWN,Scientific-Atl-DOWN
Technology2-DOWN
Fannie-Mae-DOWN,Fed-Home-Loan-DOWN, MBNA-Corp-DOWN,Morgan-Stanley-DOWN
Financial-DOWN
Baker-Hughes-UP,Dresser-Inds-UP,Halliburton-HLD-UP, Louisiana-Land-UP,Phillips-Petro-UP,Unocal-UP, Schlumberger-UP
Oil-UP
Clustering precipitation in Australia
How many clusters?
How many clusters? Four Clusters Two Clusters Six Clusters
Original Points A Partitional Clustering
A cluster is a set of objects such that an object in a cluster is closer (more similar) to the “center” of a cluster, than to the center of any other cluster The center of a cluster is often a centroid, the average of all the points in the cluster, or a medoid, the most “representative” point of a cluster
Well separated Not well separated (overlapping)
High density
is a data point in cluster C
i ,
m
i is the center for cluster C i
as the mean of all points in the cluster and | | . | | is the L2 norm (= Euclidean distance).
Problem: Enumerate all possible ways of dividing the points into clusters and evaluate the `goodness' of each potential set of clusters by using the given objective function. (NP Hard)
i=1 K
x∈C i
2
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
1
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
2
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
3
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
4
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
5
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
6
See visualization on course web site
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
1
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
2
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
3
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
4
. 5
5 . 5 1 1 . 5 2 . 5 1 1 . 5 2 2 . 5 3
x y
I t e r a t i
5
center
is a data point in cluster C
i ,
m
i is the center for cluster C i
as the mean of all points in the cluster and | | . | | is the L2 norm (= Euclidean distance).
error
reduce SSE is to increase K, the number of clusters
i=1 K
x∈C i
2
1 2 3 4 5 6 1 2 3 4 5
1 3 2 5 4 6 . 5 . 1 . 1 5 . 2
distance
(or k clusters) left
there are k clusters)
p1 p3 p5 p4 p2 p1 p2 p3 p4 p5
. . .
. . .
Proximity Matrix
C1 C4 C2 C5 C3 C2 C1 C1 C3 C5 C4 C2 C3 C4 C5
Proximity Matrix
C2 C5 C3
C1 C4 C2 C5 C3 C2 C1 C1 C3 C5 C4 C2 C3 C4 C5
Proximity Matrix
C2 C5 C3
C1 C4 C2 U C5 C3 ? ? ? ? ? ? ? C2 U C5 C1 C1 C3 C4 C2 U C5 C3 C4
Proximity Matrix
C2 C5 C3
p1 p3 p5 p4 p2 p1 p2 p3 p4 p5
. . . . . .
Proximity Matrix
Similarity?
p1 p3 p5 p4 p2 p1 p2 p3 p4 p5
. . . . . .
Proximity Matrix
p1 p3 p5 p4 p2 p1 p2 p3 p4 p5
. . . . . .
Proximity Matrix
p1 p3 p5 p4 p2 p1 p2 p3 p4 p5
. . . . . .
Proximity Matrix
p1 p3 p5 p4 p2 p1 p2 p3 p4 p5
. . . . . .
Proximity Matrix
2
3
2
2
MinPts = 4
DBSCAN(D, eps, MinPts) C = 0 for each unvisited point P in dataset D mark P as visited NeighborPts = regionQuery(P, eps) if sizeof(NeighborPts) < MinPts mark P as NOISE else C = next cluster expandCluster(P, NeighborPts, C, eps, MinPts) expandCluster(P, NeighborPts, C, eps, MinPts) add P to cluster C for each point P' in NeighborPts if P' is not visited mark P' as visited NeighborPts' = regionQuery(P', eps) if sizeof(NeighborPts') >= MinPts NeighborPts = NeighborPts joined with NeighborPts' if P' is not yet member of any cluster add P' to cluster C
Original Points Point types: core, border and noise Eps = 10, MinPts = 4
Clusters
Point types: core, border and noise
Original Points
(MinPts=4, Eps=9.75). (MinPts=4, Eps=9.92)
Medoids)
(EM) algorithm
Representatives): shrinks points toward center
reducing and clustering using hierarchies)
sparsified proximity graph
(SNN graph)
usinf the spectrum of the similarity, and cluster in this space.
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y
Random Points
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y
K-means
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y
DBSCAN
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y
Complete Link
1.
2.
3.
4.
5.
Entropy, Purity, Rand index
Sum of Squared Error (SSE), Silhouette coefficient
Often an external or internal index is used for this function, e.g., SSE
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y
Corr = -0.9235 Corr = -0.5810
Note: Correlation is negative between distance matrix and incidence matrix
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y P
n t s P
n t s
2 4 6 8 1 1 2 3 4 5 6 7 8 9 1 S i m i l a r i t y . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
P
n t s P
n t s
2 4 6 8 1 1 2 3 4 5 6 7 8 9 1 S i m i l a r i t y . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
P
n t s P
n t s
2 4 6 8 1 1 2 3 4 5 6 7 8 9 1 S i m i l a r i t y . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
. 2 . 4 . 6 . 8 1 . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
x y
P
n t s P
n t s
2 4 6 8 1 1 2 3 4 5 6 7 8 9 1 S i m i l a r i t y . 1 . 2 . 3 . 4 . 5 . 6 . 7 . 8 . 9 1
Look for the knee
i=1 K
x∈C i
2
i ∑
x∈Ci
2
i
2
Where |Ci| is the size of cluster i
1 2 3 4 5
m
K=2 clusters:
K=1 cluster: 1 2 3 4 5
m1 m2
– Cluster cohesion is the sum of the weight of all links within a cluster. – Cluster separation is the sum of the weights between nodes in the cluster and nodes outside the cluster.
cohesion separation
for individual points. For an individual point i:
Cohersion Separation