Download as pdf or txt
Download as pdf or txt
You are on page 1of 98

Module 5

Cluster Analysis: Basic Concepts


and Algorithms

Dr. Sudhamani M J
Associate Professor
Dept of CSE
RNSIT
clustering

l the process by which we create groups in a data,


like customers, products, employees, text
documents, in such a way that objects falling into
one group exhibit many similar properties with
each other and are different from objects that fall
in the other groups that got created during the
process.
What is Cluster Analysis?

l Finding groups of objects such that the objects in a group


will be similar (or related) to one another and different
from (or unrelated to) the objects in other groups

Inter-cluster
Intra-cluster distances are
distances are maximized
minimized
l Clustering is an unsupervised method of data
analysis
l Data instances grouped according to some notion
of similarity
Applications of Cluster Analysis

l Why is clustering useful?


– Can identify dense and sparse patterns, correlation
among attributes and overall distribution patterns
– Identify outliers and thus useful to detect anomalies
l Examples:
– Marketing Research: Help marketers to identify and
classify groups of people based on spending
patterns and therefore develop more focused
campaigns
– Biology: Categorize genes with similar functionality,
derive plant and animal taxonomies
n More Examples:
n Image processing: Help in identifying borders or recognizing different objects in
an image

n City Planning: Identify groups of houses and separate them into different
clusters according to similar characteristics – type, size, geographical location
What is not Cluster Analysis?

l Supervised classification
– Have class label information

l Simple segmentation
– Dividing students into different registration groups
alphabetically, by last name

l Results of a query
– Groupings are a result of an external specification

l Graph partitioning
Types of clustering

l Connectivity-based Clustering (Hierarchical


clustering)
l Centroids-based Clustering (Partitioning
methods)
l Distribution-based Clustering
l Density-based Clustering (Model-based methods)
l Fuzzy Clustering
l Constraint-based (Supervised Clustering)
Connectivity-Based Clustering (Hierarchical
Clustering)
l Hierarchical Clustering is a method of
unsupervised machine learning clustering where
it begins with a pre-defined top to bottom
hierarchy of clusters.
l It then proceeds to perform a decomposition of
the data objects based on this hierarchy, hence
obtaining the clusters.
l This method follows two approaches based on
the direction of progress, i.e., whether it is the
top-down or bottom-up flow of creating clusters.
Divisive Approach and the Agglomerative
Approach
Divisive Approach

l This approach of hierarchical clustering follows a

l where we consider that all the data points belong


to one large cluster and try to divide the data into
smaller groups based on a termination logic or, a
point beyond which there will be no further
division of data points.
Agglomerative Approach
l Agglomerative is quite the contrary to Divisive,
l all the “N” data points are considered to be a
single member of “N” clusters that the data is
comprised into.
l We iteratively combine these numerous “N”
clusters to fewer number of clusters, let’s say “k”
clusters and hence assign the data points to each
of these clusters accordingly.
l This approach is a bottom-up one, and also uses
a termination logic in combining the clusters.
l This logic can be a number based criterion (no
more clusters beyond this point) or a distance
criterion
Centroid Based Clustering
l one of the most simplest clustering algorithms,
l cluster is characterized and represented by a
central vector and data points that are in close
proximity to these vectors are assigned to the
respective clusters.
l These groups of clustering methods iteratively
measure the distance between the clusters and
the characteristic centroids using various distance
metrics.
l These are either of Euclidian distance, Manhattan
Distance or Minkowski Distance.
Density-based Clustering

l Density-based clustering methods take density


into consideration instead of distances.
l Clusters are considered as the densest region in
a data space, which is separated by regions of
lower object density and it is defined as a
maximal-set of connected points.
Characteristics of the Input Data Are Important

l Type of proximity or density measure


– This is a derived measure, but central to clustering
l Sparseness
– Dictates type of similarity
– Adds to efficiency
l Attribute type
– Dictates type of similarity
l Type of Data
– Dictates type of similarity
– Other characteristics, e.g., autocorrelation
l Dimensionality
l Noise and Outliers
l Type of Distribution
Clustering Algorithms

l K-means and its variants

l Hierarchical clustering

l Density-based clustering
K-means Clustering

l Partitional clustering approach


l Each cluster is associated with a centroid (center point)
l Each point is assigned to the cluster with the closest
centroid
l Number of clusters, K, must be specified
l The basic algorithm is very simple
K-means Clustering – Details
l Initial centroids are often chosen randomly.
– Clusters produced vary from one run to another.
l The centroid is (typically) the mean of the points in the
cluster.
l ‘Closeness’ is measured by Euclidean distance, cosine
similarity, correlation, etc.
l K-means will converge for common similarity measures
mentioned above.
l Most of the convergence happens in the first few
iterations.
– Often the stopping condition is changed to ‘Until relatively few
points change clusters’
l Complexity is O( n * K * I * d )
– n = number of points, K = number of clusters,
I = number of iterations, d = number of attributes
Exercise problems
l Cluster the following eight points (with (x, y)
representing locations) into three clusters:
A1(2, 10), A2(2, 5), A3(8, 4), A4(5, 8), A5(7, 5),
A6(6, 4), A7(1, 2), A8(4, 9)
Initial cluster centers are: A1(2, 10), A4(5, 8) and
A7(1, 2).
lThe distance function between two points
a = (x1, y1) and b = (x2, y2) is defined as-
Ρ(a, b) = |x2 – x1| + |y2 – y1|

Iteration-01:
We calculate the distance of each point from each
of the center of the three clusters.
l The distance is calculated by using the given
distance function.
calculating Distance Between A1(2, 10) and C1(2,
10)- Ρ(A1, C1)

= |x2 – x1| + |y2 – y1|

= |2 – 2| + |10 – 10|

=0
Cluster-01:
A1(2, 10)
Cluster-02:
A3(8, 4)
A4(5, 8)
A5(7, 5)
A6(6, 4)
A8(4, 9)
Cluster-03:
A2(2, 5)
A7(1, 2)
l Now,

l We re-compute the new cluster clusters.


l The new cluster center is computed by taking
mean of all the points contained in that cluster.
For Cluster-01:
We have only one point A1(2, 10) in Cluster-01.
So, cluster center remains the same.
For Cluster-02:
Center of Cluster-02
= ((8 + 5 + 7 + 6 + 4)/5, (4 + 8 + 5 + 4 + 9)/5)
= (6, 6)
For Cluster-03:
Center of Cluster-03
= ((2 + 1)/2, (5 + 2)/2)
= (1.5, 3.5) This is completion of Iteration-01.
Iteration-02:

l We calculate the distance of each point from


each of the center of the three clusters.
l The distance is calculated by using the given
distance function.
Calculating Distance Between A1(2, 10) and C1(2,
10)-
Ρ(A1, C1)
= |x2 – x1| + |y2 – y1| = |2 – 2| + |10 – 10|= 0
From here, New clusters are-
Cluster-01: A1(2, 10) A8(4, 9)
Cluster-02:
A3(8, 4) A4(5, 8) A5(7, 5) A6(6, 4)
Cluster-03: A2(2, 5) A7(1, 2)
Now,

We re-compute the new cluster clusters.


The new cluster center is computed by taking mean
of all the points contained in that cluster.
For Cluster-01:
Center of Cluster-01
= ((2 + 4)/2, (10 + 9)/2) = (3, 9.5)
For Cluster-02:
Center of Cluster-02
= ((8 + 5 + 7 + 6)/4, (4 + 8 + 5 + 4)/4) = (6.5, 5.25)
For Cluster-03:
Center of Cluster-03
= ((2 + 1)/2, (5 + 2)/2) = (1.5, 3.5)

This is completion of Iteration-02.


l After second iteration, the center of the three
clusters are-

l C1(3, 9.5)
l C2(6.5, 5.25)
l C3(1.5, 3.5)
exercise problem 1
Use the k-means algorithm and Euclidean
distance to cluster the following 8 examples into 3
clusters:
A1=(2,10), A2=(2,5), A3=(8,4), A4=(5,8), A5=(7,5),
A6=(6,4), A7=(1,2), A8=(4,9).
The distance matrix based on the Euclidean
distance is given below:
Suppose that the initial seeds (centers of each cluster) are
A1, A4 and A7. Run the k-means algorithm for 1 epoch
only. At the end of this epoch show:
a) The new clusters (i.e. the examples belonging to each
cluster)
b) The centers of the new clusters
c) Draw a 10 by 10 space with all the 8 points and show the
clusters after the first epoch and the new centroids.
d) How many more iterations are needed to converge?
Draw the result for each epoch.
Two different K-means Clusterings
3

2.5

2
Original Points
1.5

y
1

0.5

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2


x

3 3

2.5 2.5

2 2

1.5 1.5
y

y
1 1

0.5 0.5

0 0

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2


x x

Optimal Clustering Sub-optimal Clustering


Importance of Choosing Initial Centroids

Iteration 6
1
2
3
4
5
3

2.5

1.5
y

0.5

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2


x
Importance of Choosing Initial Centroids
Iteration 1 Iteration 2 Iteration 3
3 3 3

2.5 2.5 2.5

2 2 2

1.5 1.5 1.5


y

y
1 1 1

0.5 0.5 0.5

0 0 0

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x x x

Iteration 4 Iteration 5 Iteration 6


3 3 3

2.5 2.5 2.5

2 2 2

1.5 1.5 1.5


y

y
1 1 1

0.5 0.5 0.5

0 0 0

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x x x
Evaluating K-means Clusters

l Sum of Square Error (SSE) is a formula used to


evaluate K-means cluster.
l It measure the difference between the data
obtained by the prediction model that has been
done previously.
l SSE is often used as a research reference in
determining optimal clusters.
Evaluating K-means Clusters

l Most common measure is Sum of Squared Error (SSE)


– For each point, the error is the distance to the nearest cluster
– To get SSE, we square these errors and sum them.
K
SSE    dist 2 (mi , x )
i 1 xCi

– x is a data point in cluster Ci and mi corresponds to the center


(mean) of the cluster
– Given two clusters, we can choose the one with the smallest
error
– One easy way to reduce SSE is to increase K, the number of
clusters
u A good clustering with smaller K can have a lower SSE than a poor
clustering with higher K
Importance of Choosing Initial Centroids …

Iteration 5
1
2
3
4
3

2.5

1.5
y

0.5

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2


x
Importance of Choosing Initial Centroids …

Iteration 1 Iteration 2
3 3

2.5 2.5

2 2

1.5 1.5
y

y
1 1

0.5 0.5

0 0

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2


x x

Iteration 3 Iteration 4 Iteration 5


3 3 3

2.5 2.5 2.5

2 2 2

1.5 1.5 1.5


y

y
1 1 1

0.5 0.5 0.5

0 0 0

-2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
x x x
Handling Empty Clusters

l Basic K-means algorithm can yield empty clusters

l Several strategies
– Choose the point that contributes most to SSE
– Choose a point from the cluster with the highest SSE
– If there are several empty clusters, the above can be
repeated several times.
Updating Centers Incrementally

l In the basic K-means algorithm, centroids are


updated after all points are assigned to a centroid

l An alternative is to update the centroids after


each assignment (incremental approach)
– Each assignment updates zero or two centroids
– More expensive
– Introduces an order dependency
– Never get an empty cluster
– Can use “weights” to change the impact
Pre-processing and Post-processing

l Pre-processing
– Normalize the data
– Eliminate outliers

l Post-processing
– Eliminate small clusters that may represent outliers
– Split ‘loose’ clusters, i.e., clusters with relatively high
SSE
– Merge clusters that are ‘close’ and that have relatively
low SSE
– Can use these steps during the clustering process
u ISODATA
Bisecting K-means

l Bisecting K-means algorithm


– Variant of K-means that can produce a partitional or a
hierarchical clustering
Bisecting K-means Example
Limitations of K-means

l K-means has problems when clusters are of


differing
– Sizes
– Densities
– Non-globular shapes

l K-means has problems when the data contains


outliers.
Limitations of K-means: Differing Sizes

Original Points K-means (3 Clusters)


Limitations of K-means: Differing Density

Original Points K-means (3 Clusters)


Limitations of K-means: Non-globular Shapes

Original Points K-means (2 Clusters)


Overcoming K-means Limitations

Original Points K-means Clusters

One solution is to use many clusters.


Find parts of clusters, but need to put together.
Overcoming K-means Limitations

Original Points K-means Clusters


Overcoming K-means Limitations

Original Points K-means Clusters


strength and the weakness of K-means clustering.

l The strength of K-means algorithm lies in its


computational efficiency and the nature of easy-to-use.
l In contrast, there are a number of weaknesses:
a) requiring the prior knowledge of cluster numbers, K,
b) sensitive to initialisation, which leads to unwanted
solutions,
c) sensitive to outliers and noise, which results in an
inaccurate partition,
d) incapable of handling clusters of a non-convex shape,
and
e) inapplicable to categorical data.
Hierarchical Clustering

l Produces a set of nested clusters organized as a


hierarchical tree
l Can be visualized as a dendrogram
– A tree like diagram that records the sequences of
merges or splits

6 5
0.2
4
3 4
0.15 2
5
2
0.1

1
0.05
3 1

0
1 3 2 5 4 6
Strengths of Hierarchical Clustering

l Do not have to assume any particular number of


clusters
– Any desired number of clusters can be obtained by
‘cutting’ the dendogram at the proper level

l They may correspond to meaningful taxonomies


– Example in biological sciences (e.g., animal kingdom,
phylogeny reconstruction, …)
Hierarchical Clustering

l Two main types of hierarchical clustering


– Agglomerative:
u Start with the points as individual clusters (bottom up approach)
u At each step, merge the closest pair of clusters until only one cluster
(or k clusters) left

– Divisive:
u Start with one, all-inclusive cluster (top down clusters)
u At each step, split a cluster until each cluster contains a point (or
there are k clusters)

l Traditional hierarchical algorithms use a similarity or


distance matrix
– Merge or split one cluster at a time
Agglomerative Clustering Algorithm

l More popular hierarchical clustering technique


l Basic algorithm is straightforward
1. Compute the proximity matrix
2. Let each data point be a cluster
3. Repeat
4. Merge the two closest clusters
5. Update the proximity matrix
6. Until only a single cluster remains

l Key operation is the computation of the proximity of


two clusters
– Different approaches to defining the distance between
clusters distinguish the different algorithms
Starting Situation

l Start with clusters of individual points and a


proximity matrix p1 p2 p3 p4 p5 ...
p1

p2
p3

p4
p5
.
.
. Proximity Matrix
Intermediate Situation

l After some merging steps, we have some clusters


C1 C2 C3 C4 C5
C1

C2
C3
C3
C4
C4
C5

Proximity Matrix
C1

C2 C5
Intermediate Situation

l We want to merge the two closest clusters (C2 and C5) and
update the proximity matrix. C1 C2 C3 C4 C5
C1

C2
C3
C3
C4
C4
C5

Proximity Matrix
C1

C2 C5
After Merging

l The question is “How do we update the proximity matrix?”


C2
U
C1 C5 C3 C4

C1 ?

C2 U C5 ? ? ? ?
C3
C3 ?
C4
C4 ?

Proximity Matrix
C1

C2 U C5
Linkage Criteria: How to Define Inter-Cluster
Similarity
l It determines the distance between sets of observations as a function
of the pairwise distance between observations.

ü In Single Linkage, the distance between two clusters is the minimum


distance between members of the two clusters
ü In Complete Linkage, the distance between two clusters is the
maximum distance between members of the two clusters
ü In Average Linkage, the distance between two clusters is the average
of all distances between members of the two clusters
ü In Centroid Linkage, the distance between two clusters is is the
distance between their centroids
How to Define Inter-Cluster Similarity
p1 p2 p3 p4 p5 ...
p1
Similarity?
p2

p3

p4

p5
l MIN
.
l MAX
.
l Group Average .
Proximity Matrix
l Distance Between Centroids
l Other methods driven by an objective
function
– Ward’s Method uses squared error
How to Define Inter-Cluster Similarity
p1 p2 p3 p4 p5 ...
p1

p2

p3

p4

p5
l MIN
.
l MAX
.
l Group Average .
Proximity Matrix
l Distance Between Centroids
l Other methods driven by an objective
function
– Ward’s Method uses squared error
How to Define Inter-Cluster Similarity
p1 p2 p3 p4 p5 ...
p1

p2

p3

p4

p5
l MIN
.
l MAX
.
l Group Average .
Proximity Matrix
l Distance Between Centroids
l Other methods driven by an objective
function
– Ward’s Method uses squared error
How to Define Inter-Cluster Similarity
p1 p2 p3 p4 p5 ...
p1

p2

p3

p4

p5
l MIN
.
l MAX
.
l Group Average .
Proximity Matrix
l Distance Between Centroids
l Other methods driven by an objective
function
– Ward’s Method uses squared error
How to Define Inter-Cluster Similarity
p1 p2 p3 p4 p5 ...
p1

  p2

p3

p4

p5
l MIN
.
l MAX
.
l Group Average .
Proximity Matrix
l Distance Between Centroids
l Other methods driven by an objective
function
– Ward’s Method uses squared error
exercise problem

Use single and complete link agglomerative


clustering to group the data described by the
following distance matrix. Show the dendrograms.
Cluster Similarity: MIN or Single Link

l Similarity of two clusters is based on the two most


similar (closest) points in the different clusters
– Determined by one pair of points, i.e., by one link in
the proximity graph.

I1 I2 I3 I4 I5
I1 1.00 0.90 0.10 0.65 0.20
I2 0.90 1.00 0.70 0.60 0.50
I3 0.10 0.70 1.00 0.40 0.30
I4 0.65 0.60 0.40 1.00 0.80
I5 0.20 0.50 0.30 0.80 1.00 1 2 3 4 5
Hierarchical Clustering: MIN

5
1
3
5 0.2

2 1 0.15

2 3 6 0.1

0.05
4
4 0
3 6 2 5 4 1

Nested Clusters Dendrogram


Strength of MIN

Original Points Two Clusters

• Can handle non-elliptical shapes


Limitations of MIN

Original Points Two Clusters

• Sensitive to noise and outliers


Cluster Similarity: MAX or Complete Linkage

l Similarity of two clusters is based on the two least


similar (most distant) points in the different
clusters
– Determined by all pairs of points in the two clusters

I1 I2 I3 I4 I5
I1 1.00 0.90 0.10 0.65 0.20
I2 0.90 1.00 0.70 0.60 0.50
I3 0.10 0.70 1.00 0.40 0.30
I4 0.65 0.60 0.40 1.00 0.80
I5 0.20 0.50 0.30 0.80 1.00 1 2 3 4 5
Hierarchical Clustering: MAX

4 1
2 5 0.4

0.35
5
2 0.3

0.25

3 6 0.2

3 0.15
1 0.1

4 0.05

0
3 6 4 1 2 5

Nested Clusters Dendrogram


Strength of MAX

Original Points Two Clusters

• Less susceptible to noise and outliers


Limitations of MAX

Original Points Two Clusters

•Tends to break large clusters


•Biased towards globular clusters
Cluster Similarity: Group Average

l Proximity of two clusters is the average of pairwise proximity


between points in the two clusters.
 proximity(p , p )
piClusteri
i j

p jCluster j
proximity(Clusteri , Clusterj ) 
|Clusteri ||Clusterj |

l Need to use average connectivity for scalability since total


proximity favors large clusters
I1 I2 I3 I4 I5
I1 1.00 0.90 0.10 0.65 0.20
I2 0.90 1.00 0.70 0.60 0.50
I3 0.10 0.70 1.00 0.40 0.30
I4 0.65 0.60 0.40 1.00 0.80
I5 0.20 0.50 0.30 0.80 1.00 1 2 3 4 5
Hierarchical Clustering: Group Average

5 4 1
2 0.25

5 0.2
2
0.15

3 6 0.1

1 0.05

4 0
3 3 6 4 1 2 5

Nested Clusters Dendrogram


Hierarchical Clustering: Group Average

l Compromise between Single and Complete


Link

l Strengths
– Less susceptible to noise and outliers

l Limitations
– Biased towards globular clusters
Cluster Similarity: Ward’s Method

l Similarity of two clusters is based on the increase


in squared error when two clusters are merged
– Similar to group average if distance between points is
distance squared

l Less susceptible to noise and outliers

l Biased towards globular clusters

l Hierarchical analogue of K-means


– Can be used to initialize K-means
Hierarchical Clustering: Comparison

5
1 4 1
3
2 5
5 5
2 1 2
MIN MAX
2 3 6 3 6
3
1
4 4
4

5
1 5 4 1
2 2
5 Ward’s Method 5
2 2
3 6 Group Average 3 6
3
4 1 1
4 4
3
Hierarchical Clustering: Time and Space requirements

l O(N2) space since it uses the proximity matrix.


– N is the number of points.

l O(N3) time in many cases


– There are N steps and at each step the size, N2,
proximity matrix must be updated and searched
– Complexity can be reduced to O(N2 log(N) ) time for
some approaches
Hierarchical Clustering: Problems and Limitations

l Once a decision is made to combine two clusters,


it cannot be undone

l No objective function is directly minimized

l Different schemes have problems with one or


more of the following:
– Sensitivity to noise and outliers
– Difficulty handling different sized clusters and convex
shapes
– Breaking large clusters
MST: Divisive Hierarchical Clustering

l Build MST (Minimum Spanning Tree)


– Start with a tree that consists of any point
– In successive steps, look for the closest pair of points (p, q) such
that one point (p) is in the current tree but the other (q) is not
– Add q to the tree and put an edge between p and q
MST: Divisive Hierarchical Clustering

l Use MST for constructing hierarchy of clusters


DBSCAN

l DBSCAN is a density-based algorithm.


– Density = number of points within a specified radius (Eps)

– A point is a core point if it has more than a specified number


of points (MinPts) within Eps
u These are points that are at the interior of a cluster

– A border point has fewer than MinPts within Eps, but is in the
neighborhood of a core point

– A noise point is any point that is not a core point or a border


point.
DBSCAN: Core, Border, and Noise Points
DBSCAN Algorithm

l Eliminate noise points


l Perform clustering on the remaining points
DBSCAN: Core, Border and Noise Points

Original Points Point types: core,


border and noise

Eps = 10, MinPts = 4


When DBSCAN Works Well

Original Points Clusters

• Resistant to Noise
• Can handle clusters of different shapes and sizes
When DBSCAN Does NOT Work Well

(MinPts=4, Eps=9.75).

Original Points

• Varying densities
• High-dimensional data
(MinPts=4, Eps=9.92)
DBSCAN: Determining EPS and MinPts

l Idea is that for points in a cluster, their kth nearest


neighbors are at roughly the same distance
l Noise points have the kth nearest neighbor at farther
distance
l So, plot sorted distance of every point to its kth
nearest neighbor
Cluster Validity

l For supervised classification we have a variety of


measures to evaluate how good our model is
– Accuracy, precision, recall

l For cluster analysis, the analogous question is how to


evaluate the “goodness” of the resulting clusters?

l But “clusters are in the eye of the beholder”!

l Then why do we want to evaluate them?


– To avoid finding patterns in noise
– To compare clustering algorithms
– To compare two sets of clusters
– To compare two clusters
Clusters found in Random Data
1 1

0.9 0.9

0.8 0.8

0.7 0.7

Random 0.6 0.6 DBSCAN


Points 0.5 0.5
y

y
0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
1 1

0.9 0.9

K-means 0.8 0.8


Complete
0.7 0.7
Link
0.6 0.6

0.5 0.5
y

0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
x x
Different Aspects of Cluster Validation

1. Determining the clustering tendency of a set of data, i.e.,


distinguishing whether non-random structure actually exists in the
data.
2. Comparing the results of a cluster analysis to externally known
results, e.g., to externally given class labels.
3. Evaluating how well the results of a cluster analysis fit the data
without reference to external information.
- Use only the data
4. Comparing the results of two different sets of cluster analyses to
determine which is better.
5. Determining the ‘correct’ number of clusters.

For 2, 3, and 4, we can further distinguish whether we want to


evaluate the entire clustering or just individual clusters.
Measures of Cluster Validity

l Numerical measures that are applied to judge various aspects


of cluster validity, are classified into the following three types.
– External Index: Used to measure the extent to which cluster labels
match externally supplied class labels.
u Entropy
– Internal Index: Used to measure the goodness of a clustering
structure without respect to external information.
u Sum of Squared Error (SSE)
– Relative Index: Used to compare two different clusterings or
clusters.
u Often an external or internal index is used for this function, e.g., SSE or
entropy
l Sometimes these are referred to as criteria instead of indices
– However, sometimes criterion is the general strategy and index is the
numerical measure that implements the criterion.
Final Comment on Cluster Validity

“The validation of clustering structures is the most


difficult and frustrating part of cluster analysis.
Without a strong effort in this direction, cluster
analysis will remain a black art accessible only to
those true believers who have experience and
great courage.”

Algorithms for Clustering Data, Jain and Dubes

You might also like