Download Data Clustering Techniques - Lecture Notes | CS 4440 and more Study notes Computer Science in PDF only on Docsity!
Slides are adapted from the slides for the text book by Dr. M.H.Dunham,
Data Mining, Introductory and Advanced Topics , Prentice Hall, 2002.
Data Mining Part I:
Data Clustering Techniques
Ling Liu
Associate Professor
Distributed Data Intensive Systems Lab
College of Computing
Georgia Institute of Technology
Outline
Introduction to Data Mining
Data Clustering Techniques
Partitional Approach
Hierarchical Approach
Visual Clustering
What is Data Mining?
Definition:
Finding hidden information in a database
or a large data repository
Approach: Fit data to a model
Technique to choose the best model
Technique to search the data to fit a model
Categories of Techniques
Descriptive
Predictive
Database vs. Data Mining
Query
Well defined
Standard SQL
^ OutputOutput
(^) Subset of databaseSubset of database
Standard CommercialStandard Commercial
DBMSDBMS
Query
Poorly defined
No standard query language
^ OutputOutput
(^) Predication/SummarizationPredication/Summarization
of the data scannedof the data scanned
Not a subset of databaseNot a subset of database
Non standard productsNon standard products
Descriptive Data Mining
Clustering groups similar data together into
clusters.
Unsupervised learning
Segmentation
Partitioning
Summarization maps data into subsets with
associated simple descriptions.
Characterization
Generalization
Link Analysis uncovers relationships among data.
Affinity Analysis
Association Rules
Sequential Analysis determines sequential patterns.
Predictive Data Mining
Classification maps data into predefined
groups or classes
Supervised learning
Pattern recognition
Prediction
Regression is used to map a data item to a
real valued prediction variable.
Data Mining vs. KDD
Knowledge Discovery in Databases
(KDD): process of finding useful
information and patterns in data.
Data Mining: Use of algorithms to
extract the information and patterns
derived by the KDD process.
KDD Process
Selection: Obtain data from various sources.
Preprocessing: Cleanse data.
Transformation: Convert to common
format. Transform to new format.
Data Mining: Obtain desired results.
Interpretation/Evaluation: Present
results to user in meaningful manner.
Modified from [FPSS96C]
Cluster Analysis
Cluster Analysis
What is Cluster Analysis?
Types of Data in Cluster Analysis
A Categorization of Major Clustering Methods
Partitioning Methods
Hierarchical Methods
Density-Based Methods
Grid-Based Methods
Model-Based Clustering Methods
Outlier Analysis
Summary
What is Cluster Analysis?
Cluster: a collection of data objects
Similar to one another within the same cluster
Dissimilar to the objects in other clusters
Cluster analysis
Grouping a set of data objects into clusters
Clustering is unsupervised classification: no
predefined classes
Clustering is used:
As a stand-alone tool to get insight into data distribution
Visualization of clusters may unveil important information
As a preprocessing step for other algorithms
Efficient indexing or compression often relies on clustering
General Applications of Clustering
Pattern Recognition
Spatial Data Analysis
create thematic maps in GIS by clustering feature
spaces
detect spatial clusters and explain them in spatial data
mining
Image Processing
cluster images based on their visual content
Economic Science (especially market research)
WWW and IR
document classification
cluster Weblog data to discover groups of similar
access patterns
Outliers
Outliers are objects that do not belong to any
cluster or form clusters of very small
cardinality
In some applications we are interested in
discovering outliers, not clusters (outlier
analysis)
cluster
outliers
Cluster Analysis
What is Cluster Analysis?
Types of Data in Cluster Analysis
A Categorization of Major Clustering Methods
Partitioning Methods
Hierarchical Methods
Density-Based Methods
Grid-Based Methods
Model-Based Clustering Methods
Outlier Analysis
S
Data Structures
data matrix
(two modes)
dissimilarity ordistance
matrix
(one mode)
np
... x nf
... x n
x
ip
... x if
... x i
x
1p
... x 1f
... x 11
x
d n d n ...
d(3,1 d 0
d(2,1) 0
the “classic” data input
attributes/dimensions
tuples/objects
the desired data input to some
clustering algorithms
objects
objects
Measuring Similarity in Clustering
Dissimilarity/Similarity metric:
The dissimilarityd(i, j) between two objectsi andj is
expressed in terms of a distance function, which is
typically a metricmetric:
d(i, j)≥0 (non-negativity)
d(i, i)=0 (isolation)
d(i, j)=d(j, i) (symmetry)
d(i, j) ≤ d(i, h)+d(h, j) (triangular inequality)
The definitions of distance functions are usually
different for interval-scaled, boolean, categorical,
ordinal and ratio-scaled variables.
Weights may be associated with different variables
based on applications and data semantics.
Similarity and Dissimilarity
Between Objects (Cont.)
If p =2,L
is the Euclidean distance:
Properties
d(i,j) ≥ 0
d(i,i) = 0
d(i,j) =d(j,i)
d(i,j) ≤ d(i,k) +d(k,j)
Also one can use weighted distance:
2 2
2 2
2
1 1 n jn
x i
x j
x i
x j
x i
d ij = x − + − + + −
2 2
2 2
2
1 1 n jn
x i
x n
w j
x i
w x j
x i
d ij = w x − + − + + −
Major Clustering Approaches
Partitioning algorithms: Construct random partitions and
then iteratively refine them by some criterion
Hierarchical algorithms: Create a hierarchical
decomposition of the set of data (or objects) using some
criterion
Density-based: based on connectivity and density
functions
Grid-based: based on a multiple-level granularity
structure
Model-based: A model is hypothesized for each of the
clusters and the idea is to find the best fit of that model
to each other
Clustering Approaches
Clustering
Hierarchical Partitional Categorical Large DB
Agglomerative Divisive Sampling Compression
Cluster Parameters
K-Means
Initial set of clusters randomly chosen.
Iteratively, items are moved among
sets of clusters until the desired set is
reached.
High degree of similarity among
elements in a cluster is obtained.
Given a cluster K
i
={t
i
,t
i
,…,t
im
}, the
cluster mean is m
i
= (1/m)(t
i
t
im
K-Means Example
Given: {2,4,10,12,3,20,30,11,25}, k=
Randomly assign means: m
1
=3,m
2
K
1
={2,3}, K
2
m
1
=2.5,m
2
K
1
={2,3,4},K
2
m
1
=3,m
2
K
1
={2,3,4,10},K
2
m
1
=4.75,m
2
K
1
={2,3,4,10,11,12},K
2
m
1
=7,m
2
Stop as the clusters with these means are the
same.
The k-means Clustering Method
Givenk, thek-means algorithm is
implemented in 4 steps:
1. Partition objects intok nonempty subsets
2. Compute seed points as the centroidscentroids of
the clusters of the current partition. The
centroid is the center (mean point) of the
cluster.
3. Assign each object to the cluster with the
nearest seed point.
4. Go back to Step 2, stop when no more
new assignment.
K-Means Algorithm
TheK-Medoids Clustering Method
Findrepresentative objects, called medoids, in
clusters
PAM (Partitioning Around Medoids, 1987)
starts from an initial set of medoids and iteratively
replaces one of the medoids by one of the non-
medoids if it improves the total distance of the
resulting clustering
PAM works effectively for small data sets, but does not
scale well for large data sets
CLARA (Kaufmann & Rousseeuw, 1990)
CLARANS (Ng & Han, 1994): Randomized
sampling
Nearest Neighbor
Items are iteratively merged into the
existing clusters that are closest.
Incremental
Threshold t
used to determine if items are added to
existing clusters or a new cluster is
created.
Nearest Neighbor Algorithm
Hierarchical Clustering
Clusters are created in levels actually creating
sets of clusters at each level.
Agglomerative
Initially each item in its own cluster
Iteratively clusters are merged together
Bottom Up
Divisive
Initially all items in one cluster
Large clusters are successively divided
Top Down