Chapter 8�Cluster Analysis: Basic Concepts and Methods
Outline
Outline
Cluster Analysis: A Quick Overview
The Value of Cluster Analysis
Broad Applications of Cluster Analysis
What Is Cluster Analysis?
Cluster Analysis: Applications
Considerations for Cluster Analysis
Requirements and Challenges
Cluster Analysis: A Multi-Dimensional Categorization
Typical Clustering Methodologies
High-dimensional Dlustering
Clustering Different Types of Data (I)
Clustering Different Types of Data (II)
Clustering Different Types of Data (III)
User Insights and Interactions in Clustering
Outline
Partitioning Algorithms: Basic Concepts
The K-Means Clustering Method
Example: K-Means Clustering
The original data points & randomly select K = 2 centroids
Select K points as initial centroids
Repeat
Until convergence criterion is satisfied
Assign points to clusters
Recompute cluster centers
Redo point assignment
Execution of the K-Means Clustering Algorithm
Discussion on the K-Means Method
Variations of K-Means
Initialization of K-Means
Example: Poor Initialization May Lead to Poor Clustering
Recompute cluster centers
Assign points to clusters
Another random selection of k centroids for the same data points
Handling Outliers: From K-Means to K-Medoids
PAM: A Typical K-Medoids Algorithm
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
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
Swapping O and Oramdom
If quality is improved
Select initial K medoids randomly
Repeat
Object re-assignment
Swap medoid m with oi if it improves the clustering quality
Until convergence criterion is satisfied
Randomly select a non-medoid object,Oramdom
0
1
2
3
4
5
6
7
8
9
10
0
1
2
3
4
5
6
7
8
9
10
Discussion on K-Medoids Clustering
K-Medians: Handling Outliers by Computing Medians
K-Modes: Clustering Categorical Data
Kernel K-Means Clustering
Kernel Functions and Kernel K-Means Clustering
Example: Kernel Functions and Kernel K-Means Clustering
Example: Kernel Functions and Kernel K-Means Clustering
| | |
x1 | | |
x2 | | |
x3 | | |
x4 | | |
x5 | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
Original Space
Example: Kernel K-Means Clustering
The original data set
The result of K-Means clustering
The result of Gaussian Kernel K-Means clustering
Outline
Hierarchical Clustering: Basic Concepts
Agglomerative vs. Divisive 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)
Dendrogram: How Clusters are Merged
Hierarchical clustering generates a dendrogram (a hierarchy of clusters)
Agglomerative Clustering Algorithm
Agglomerative Clustering Algorithm
Single Link vs. Complete Link in Hierarchical Clustering
X
X
X
X
Agglomerative Clustering: Average vs. Centroid Links
X
X
X
X
Ca: Na
Cb: Nb
Agglomerative Clustering with Ward’s Criterion
Divisive Clustering
Divisive Clustering Is a Top-down Approach
More on Algorithm Design for Divisive Clustering
Extensions to Hierarchical Clustering
BIRCH: A Multi-Phase Hierarchical Clustering Method
Clustering Feature Vector
CF1 = <5, (16,30), 244>
(3,4)
(2,6)
(4,5)
(4,7)
(3,8)
n = 5; LS = ((3+2+4+4+3), (4+6+5+7+8)) = (16, 30);
SS=(32+22+42+42+32) + (42+62+52+72+82)= 54+190=244
Clustering Feature: a Summary of the Statistics for the Given Cluster
CF1 = <5, (16,30), 244>
(3,4)
(2,6)
(4,5)
(4,7)
(3,8)
n = 5; LS = ((3+2+4+4+3), (4+6+5+7+8)) = (16, 30);
SS=(32+22+42+42+32) + (42+62+52+72+82)= 54+190=244
Essential Measures of Cluster: Centroid, Radius and Diameter
X
Example
CF Tree: A Height-Balanced Tree Storing Clustering Features for Hierarchical Clustering
CF Tree: A Height-Balanced Tree Storing Clustering Features for Hierarchical Clustering
CF1
child1
CF3
child3
CF2
child2
CF6
child6
CF11
child11
CF13
child13
CF12
child12
CF15
child15
CFx1
CFx2
CFx6
prev
next
CFy1
CFy2
CFy5
prev
next
B = 7
L = 6
Root
Non-leaf node
Leaf node
Leaf node
BIRCH: A Scalable and Flexible Clustering Method
BIRCH: Pros and Cons
Images like this may give BIRCH a hard time
Probabilistic Hierarchical Clustering
Generative Model
A Probabilistic Hierarchical Clustering Algorithm
Example
Outline
Density-Based Clustering Methods
DBSCAN: A Density-Based Spatial Clustering Algorithm
MinPts = 5
Eps = 1 cm
p
q
Core
Border
Outlier
Border point: in cluster but neighborhood is not dense
Outlier/noise: not in a cluster
Core point: dense neighborhood
DBSCAN: Density-Reachable and Density-Connected
p
q
p2
p
q
o
MinPts = 5
Eps = 1 cm
p
q
DBSCAN: The Algorithm
Core
Border
Outlier
Border point: in cluster but neighborhood is not dense
Outlier/noise: not in a cluster
Core point: dense neighborhood
DBSCAN Is Sensitive to the Setting of Parameters
Ack. Figures from G. Karypis, E.-H. Han, and V. Kumar, COMPUTER, 32(8), 1999
OPTICS: Ordering Points To Identify Clustering Structure
Visualization
Reachability-distance
Cluster-order of the objects
undefined
Reachability plot for a dataset
OPTICS: An Extension from DBSCAN
Reachability
distance
Cluster-order of the objects
undefined
OPTICS: An Extension from DBSCAN
Reachability-distanceε, MinPts(p, q) =
Undefined, if p is not a core object
max(core-distance(p), distance (p, q)), otherwise
OPTICS: Finding Hierarchically Nested Clustering Structures
OPTICS: Finding Hierarchically Nested Clustering Structures
Finding nested clustering structures with different parameter settings
Grid-Based Clustering Methods
STING: A Statistical Information Grid Approach
STING: A Statistical Information Grid Approach
Query Processing in STING and Its Analysis
CLIQUE: Grid-Based Subspace Clustering
CLIQUE: SubSpace Clustering with Aprori Pruning
CLIQUE: SubSpace Clustering with Aprori Pruning
Major Steps of the CLIQUE Algorithm
Pros and Cons of CLIQUE
Outline
Evaluation of Clustering: Basic Concepts
Clustering Tendency: Whether the Data Contains Inherent Grouping Structure
Testing Clustering Tendency: A Spatial Histogram Approach
(a) Input dataset
(b) Data generated from random samples
Testing Clustering Tendency: A Spatial Histogram Approach
Determining the Number of Clusters
Determining the Number of Clusters
Finding the Number of Clusters: the Elbow Method
Finding K, the Number of Clusters: A Cross Validation Method
Measuring Clustering Quality
General Criteria for Measuring Clustering Quality with Extrinsic Methods
Ground truth partitioning G1
G2
Cluster C1
Cluster C2
Commonly Used Extrinsic Methods
Ground truth partitioning G1
G2
Cluster C1
Cluster C2
Matching-Based Methods
Ground Truth G1
G2
Cluster C1
C2
G3
C3
Matching-Based Methods: Example
Ground Truth G1
G2
Cluster C1
C2
G3
C3
Purity for clustering C1 = 1/11 (4 + 2 + 4 + 1) = 11/11 = 1;
Purity for clustering C2 = 1/11 (2 + 3 + 1) = 6/11
Information Theory-Based Methods (I)�Conditional Entropy
Ground Truth G1
G2
Cluster C1
C2
G3
C3
Information Theory-Based Methods (I)�Conditional Entropy
Ground Truth G1
G2
Cluster C1
C2
G3
C3
Example
Ground Truth G1
G2
Cluster C1
C2
G3
C3
Purity for clustering C1 = 1/11 (4 + 2 + 4 + 1) = 11/11 = 1;
Purity for clustering C2 = 1/11 (2 + 3 + 1) = 6/11
Note: conditional entropy cannot detect the issue that C1 splits the objects in G into two clusters
Information Theory-Based Methods (II) �Normalized Mutual Information (NMI)
Pairwise Comparison-Based Methods: Jaccard Coefficient
Note: Total # of pairs of points
Intrinsic Methods (I): Dunn Index
Intrinsic Methods (II): Silhouette Coefficient