Cluster Analysis� (Basic Concepts and Methods)
1
Cluster Analysis: Basic Concepts and Methods
2
2
What is Cluster Analysis?
3
Clustering for Data Understanding and Applications
4
Clustering as a Preprocessing Tool (Utility)
5
Quality: What Is Good Clustering?
6
Measure the Quality of Clustering
7
Considerations for Cluster Analysis
8
Requirements and Challenges
9
Major Clustering Approaches (I)
10
Major Clustering Approaches (II)
11
Cluster Analysis: Basic Concepts and Methods
12
12
Partitioning Algorithms: Basic Concept
13
The K-Means Clustering Method
14
An Example of K-Means Clustering
K=2
Arbitrarily partition objects into k groups
Update the cluster centroids
Update the cluster centroids
Reassign objects
Loop if needed
15
The initial data set
Comments on the K-Means Method
16
Variations of the K-Means Method
17
What Is the Problem of the K-Means Method?
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
18
PAM: A Typical K-Medoids Algorithm
19
Total Cost = 20
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
K=2
Arbitrary choose k object as initial medoids
Assign each remaining object to nearest medoids
Randomly select a nonmedoid object,Oramdom
Compute total cost of swapping
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
Total Cost = 26
Swapping O and Oramdom
If quality is improved.
Do loop
Until no change
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
The K-Medoid Clustering Method
20
Chapter 10. Cluster Analysis: Basic Concepts and Methods
21
21
Hierarchical Clustering
Step 0
Step 1
Step 2
Step 3
Step 4
b
d
c
e
a
a b
d e
c d e
a b c d e
Step 4
Step 3
Step 2
Step 1
Step 0
agglomerative
(AGNES)
divisive
(DIANA)
22
AGNES (Agglomerative Nesting)
23
Dendrogram: Shows How Clusters are Merged
Decompose data objects into a several levels of nested partitioning (tree of clusters), called a dendrogram
A clustering of the data objects is obtained by cutting the dendrogram at the desired level, then each connected component forms a cluster
24
DIANA (Divisive Analysis)
25
Distance between Clusters
X
X
26
Centroid, Radius and Diameter of a Cluster (for numerical data sets)
27
Extensions to Hierarchical Clustering
28
BIRCH (Balanced Iterative Reducing and Clustering Using Hierarchies)
29
Clustering Feature Vector in BIRCH
Clustering Feature (CF): CF = (N, LS, SS)
N: Number of data points
LS: linear sum of N points:
SS: square sum of N points
CF = (5, (16,30),(54,190))
(3,4)
(2,6)
(4,5)
(4,7)
(3,8)
30
CF-Tree in BIRCH
31
The CF Tree Structure
CF1
child1
CF3
child3
CF2
child2
CF6
child6
CF1
child1
CF3
child3
CF2
child2
CF5
child5
CF1
CF2
CF6
prev
next
CF1
CF2
CF4
prev
next
B = 7
L = 6
Root
Non-leaf node
Leaf node
Leaf node
32
The Birch Algorithm
33
CHAMELEON: Hierarchical Clustering Using Dynamic Modeling (1999)
34
Overall Framework of CHAMELEON
Construct (K-NN)
Sparse Graph
Partition the Graph
Merge Partition
Final Clusters
Data Set
K-NN Graph
P and q are connected if q is among the top k closest neighbors of p
Relative interconnectivity: connectivity of c1 and c2 over internal connectivity
Relative closeness: closeness of c1 and c2 over internal closeness
35
CHAMELEON (Clustering Complex Objects)
36
Probabilistic Hierarchical Clustering
37
Generative Model
the maximum likelihood
38
A Probabilistic Hierarchical Clustering Algorithm
where P() is the maximum likelihood
Input: D = {o1, ..., on}: a data set containing n objects
Output: A hierarchy of clusters
Method
Create a cluster for each object Ci = {oi}, 1 ≤ i ≤ n;
For i = 1 to n {
Find pair of clusters Ci and Cj such that
Ci,Cj = argmaxi ≠ j {log (P(Ci∪Cj )/(P(Ci)P(Cj ))};
If log (P(Ci∪Cj )/(P(Ci)P(Cj )) > 0 then merge Ci and Cj }
39
Cluster Analysis: Basic Concepts and Methods
40
40
Density-Based Clustering Methods
41
Density-Based Clustering: Basic Concepts
|NEps (q)| ≥ MinPts
MinPts = 5
Eps = 1 cm
p
q
42
Density-Reachable and Density-Connected
p
q
p1
p
q
o
43
DBSCAN: Density-Based Spatial Clustering of Applications with Noise
Core
Border
Outlier
Eps = 1cm
MinPts = 5
44
DBSCAN: The Algorithm
45
DBSCAN: Sensitive to Parameters
46
OPTICS: A Cluster-Ordering Method (1999)
47
OPTICS: Some Extension from DBSCAN
D
p2
MinPts = 5
ε = 3 cm
Max (core-distance (o), d (o, p))
r(p1, o) = 2.8cm. r(p2,o) = 4cm
o
o
p1
48
Reachability-distance
Cluster-order
of the objects
undefined
‘
49
Density-Based Clustering: OPTICS & Its Applications
50
DENCLUE: Using Statistical Density Functions
influence of y on x
total influence on x
gradient of x in the direction of xi
51
Denclue: Technical Essence
52
Density Attractor
53
Center-Defined and Arbitrary
54
Chapter 10. Cluster Analysis: Basic Concepts and Methods
55
55
Grid-Based Clustering Method
56
STING: A Statistical Information Grid Approach
57
The STING Clustering Method
58
STING Algorithm and Its Analysis
59
CLIQUE (Clustering In QUEst)
60
CLIQUE: The Major Steps
61
62
Salary (10,000)
20
30
40
50
60
age
5
4
3
1
2
6
7
0
20
30
40
50
60
age
5
4
3
1
2
6
7
0
Vacation(week)
age
Vacation
Salary
30
50
τ = 3
Strength and Weakness of CLIQUE
63
Cluster Analysis: Basic Concepts and Methods
64
64
Assessing Clustering Tendency
65
Determine the Number of Clusters
66
Measuring Clustering Quality
67
Measuring Clustering Quality: Extrinsic Methods
68
Cluster Analysis: Basic Concepts and Methods
69
69
Summary
70
CS512-Spring 2011: An Introduction
71
References (1)
72
References (2)
73
References (3)
74
Slides unused in class
75
A Typical K-Medoids Algorithm (PAM)
76
Total Cost = 20
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
K=2
Arbitrary choose k object as initial medoids
Assign each remaining object to nearest medoids
Randomly select a nonmedoid object,Oramdom
Compute total cost of swapping
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
Total Cost = 26
Swapping O and Oramdom
If quality is improved.
Do loop
Until no change
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
PAM (Partitioning Around Medoids) (1987)
77
PAM Clustering: Finding the Best Cluster Center
78
What Is the Problem with PAM?
where n is # of data,k is # of clusters
CLARA(Clustering LARge Applications)
79
CLARA (Clustering Large Applications) (1990)
80
CLARANS (“Randomized” CLARA) (1994)
81
ROCK: Clustering Categorical Data
82
Similarity Measure in ROCK
83
Link Measure in ROCK
84
Rock Algorithm
85
Aggregation-Based Similarity Computation
4
5
10
12
13
14
a
b
ST2
ST1
11
0.2
0.9
1.0
0.8
0.9
1.0
For each node nk ∈ {n10, n11, n12} and nl ∈ {n13, n14}, their path-based similarity simp(nk, nl) = s(nk, n4)·s(n4, n5)·s(n5, nl).
After aggregation, we reduce quadratic time computation to linear time computation.
takes O(3+2) time
86
Computing Similarity with Aggregation
To compute sim(na,nb):
sim(na, nb) = avg_sim(na,n4) x s(n4, n5) x avg_sim(nb,n5)
= 0.9 x 0.2 x 0.95 = 0.171
sim(na, nb) can be computed from aggregated similarities
Average similarity
and total weight
4
5
10
12
13
14
a
b
a:(0.9,3)
b:(0.95,2)
11
0.2
87
Chapter 10. Cluster Analysis: Basic Concepts and Methods
88
88
Link-Based Clustering: Calculate Similarities Based On Links
Jeh & Widom, KDD’2002: SimRank
Two objects are similar if they are linked with the same or similar objects
Tom
sigmod03
Mike
Cathy
John
sigmod04
sigmod05
vldb03
vldb04
vldb05
sigmod
vldb
Mary
aaai04
aaai05
aaai
Authors
Proceedings
Conferences
89
Observation 1: Hierarchical Structures
All
electronics
grocery
apparel
DVD
camera
TV
A hierarchical structure of products in Walmart
Articles
Words
Relationships between articles and words (Chakrabarti, Papadimitriou, Modha, Faloutsos, 2004)
90
Observation 2: Distribution of Similarity
Distribution of SimRank similarities among DBLP authors
91
A Novel Data Structure: SimTree
Each leaf node represents an object
Each non-leaf node represents a group of similar lower-level nodes
Similarities between siblings are stored
Consumer electronics
Apparels
Canon A40 digital camera
Sony V3 digital camera
Digital Cameras
TVs
92
Similarity Defined by SimTree
n1
n2
n4
n5
n6
n3
0.9
1.0
0.9
0.8
0.2
n7
n9
0.3
n8
0.8
0.9
Similarity between two sibling nodes n1 and n2
Adjustment ratio for node n7
Average similarity between x and all other nodes
Average similarity between x’s parent and all other nodes
93
LinkClus: Efficient Clustering via Heterogeneous Semantic Links
Method
For details: X. Yin, J. Han, and P. S. Yu, “LinkClus: Efficient Clustering via Heterogeneous Semantic Links”, VLDB'06
94
Initialization of SimTrees
n1
1
2
3
4
5
n2
The tightness of {n1, n2} is 3
Nodes
Leaf nodes in another SimTree
95
Finding Tight Groups by Freq. Pattern Mining
Reduced to
g1
g2
{n1}
{n1, n2}
{n2}
{n1, n2}
{n1, n2}
{n2, n3, n4}
{n4}
{n3, n4}
{n3, n4}
Transactions
n1
1
2
3
4
5
6
7
8
9
n2
n3
n4
The tightness of a group of nodes is the support of a frequent pattern
96
Adjusting SimTree Structures
n1
n2
n4
n5
n6
n3
n7
n9
n8
0.8
0.9
n7
97
Complexity
| Time | Space |
Updating similarities | O(M(logN)2) | O(M+N) |
Adjusting tree structures | O(N) | O(N) |
| | |
LinkClus | O(M(logN)2) | O(M+N) |
SimRank | O(M2) | O(N2) |
For two types of objects, N in each, and M linkages between them.
98
Experiment: Email Dataset
Approach | Accuracy | time (s) |
LinkClus | 0.8026 | 1579.6 |
SimRank | 0.7965 | 39160 |
ReCom | 0.5711 | 74.6 |
F-SimRank | 0.3688 | 479.7 |
CLARANS | 0.4768 | 8.55 |
99
WaveCluster: Clustering by Wavelet Analysis (1998)
100
The WaveCluster Algorithm
101
Quantization�& Transformation
a) scale 1: high resolution
b) scale 2: medium resolution
c) scale 3: low resolution
102