Docsity

Clustering unit 7, Lecture notes of Data Mining

Toggle sidebar
bg1
Unit-7 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
•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
•Typical applications
•As a stand-alone tool to get insight into data distribution
•As a preprocessing step for other algorithms
General Applications of Clustering
•Pattern Recognition
•Spatial Data Analysis
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a

Partial preview of the text

Download Clustering unit 7 and more Lecture notes Data Mining in PDF only on Docsity!

Unit-7 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

• 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
  • Typical applications
    • As a stand-alone tool to get insight into data distribution
    • As a preprocessing step for other algorithms 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
  • Economic Science (especially market research)
  • WWW
  • Document classification
  • Cluster Weblog data to discover groups of similar access patterns Examples of Clustering Applications
  • Marketing: Help marketers discover distinct groups in their customer bases, and then use this knowledge to develop targeted marketing programs
  • Land use: Identification of areas of similar land use in an earth observation database
  • Insurance: Identifying groups of motor insurance policy holders with a high average claim cost
  • City-planning: Identifying groups of houses according to their house type, value, and geographical location
  • Earth-quake studies: Observed earth quake epicenters should be clustered along continent faults What Is Good Clustering?
  • A good clustering method will produce high quality clusters with
  • (^) high intra-class similarity
  • low inter-class similarity
  • The quality of a clustering result depends on both the similarity measure used by the method and its implementation.
  • The quality of a clustering method is also measured by its ability to discover some or all of the hidden patterns. Requirements of Clustering in Data Mining
  • Scalability
  • Ability to deal with different types of attributes
  • Discovery of clusters with arbitrary shape
  • the answer is typically highly subjective.
  • Type of data in clustering analysis
  • Interval-scaled variables:
  • Binary variables:
  • Nominal, ordinal, and ratio variables:
  • Variables of mixed types:
  • Interval-valued variables
  • Standardize data
  • Calculate the mean absolute deviation: Where
  • Calculate the standardized measurement ( z-score )
  • Using mean absolute deviation is more robust than using standard deviation
  • Similarity and Dissimilarity Between Objects
  • Distances are normally used to measure the similarity or dissimilarity between two dataobjects
  • Some popular ones include: Minkowski distance :

where i = ( x i1 , x i2, …, x (^) ip) and j = ( x (^) j1, x j2, …, x (^) jp) are two p -dimensional data objects, and q is a positive integer

  • If q = 1 , d is Manhattan distance
  • If q = 2 , d is 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, parametric Pearson product moment correlation, or other disimilarity measures.
  • Binary Variables
  • A contingency table for binary data Object j

Object i

  • Simple matching coefficient (invariant, if the binary variable is symmetric ):
  • Jaccard coefficient (noninvariant if the binary variable is asymmetric ):

Dissimilarity between Binary Variables

  • Example
  • Ratio-scaled variable: a positive measurement on a nonlinear scale, approximately at exponential scale,such as AeBt^ or^ Ae^ -Bt
  • Methods:
    • (^) treat them like interval-scaled variables — not a good choice! (why?)
    • apply logarithmic transformation yif = log(x (^) if)
    • treat them as continuous ordinal data treat their rank as interval-scaled.
  • Variables of Mixed Types
  • A database may contain all the six types of variables
  • symmetric binary, asymmetric binary, nominal, ordinal, interval and ratio.
  • One may use a weighted formula to combine their effects.
  • f is binary or nominal:
  • dij(f)^ = 0 if xif = x (^) jf , or d (^) ij(f)^ = 1 o.w.
  • f is interval-based: use the normalized distance
  • f is ordinal or ratio-scaled
  • compute ranks rif and
  • and treat zif as interval-scaled
  • Major Clustering Approaches
  • Partitioning algorithms: Construct various partitions and then evaluate them by some criterion
  • Hierarchy 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
  • Partitioning Algorithms: Basic Concept
  • Partitioning method: Construct a partition of a database D of n objects into a set of k clusters
  • Given a k , find a partition of k clusters that optimizes the chosen partitioning criterion
  • Global optimal: exhaustively enumerate all partitions
  • Heuristic methods: k-means and k-medoids algorithms
  • k-means (MacQueen’67): Each cluster is represented by the center of the cluster
  • k-medoids or PAM (Partition around medoids) (Kaufman & Rousseeuw’87): Each cluster is represented by one of the objects in the cluster
  • The^ K-Means^ Clustering Method
  • Given k , the k-means algorithm is implemented in 4 steps:
  • Partition objects into k nonempty subsets
  • Compute seed points as the centroids of the clusters of the current partition. The centroid is the center (mean point) of the cluster.
  • Assign each object to the cluster with the nearest seed point.
  • (^) Go back to Step 2, stop when no more new assignment.
  • Example

Comments on the K-Means Method

  • Strength
    • Relatively efficient : O ( tkn ), where n is # objects, k is # clusters, and t is # iterations. Normally, k , t << n.
    • Often terminates at a local optimum. The global optimum may be found using techniques such as: deterministic annealing and genetic algorithms
  • Weakness
  • Use real object to represent the cluster
    • Select k representative objects arbitrarily
    • For each pair of non-selected object h and selected object i , calculate the total swapping cost TC (^) ih
    • (^) For each pair of i and h ,
      • If TCih < 0, i is replaced by h
      • Then assign each non-selected object to the most similar representative object
    • repeat steps 2-3 until there is no change

PAM Clustering: Total swapping cost TCih =∑jC (^) jih

  • CLARA (Clustering Large Applications) (1990)
    • CLARA (Kaufmann and Rousseeuw in 1990)
    • Built in statistical analysis packages, such as S+
    • It draws multiple samples of the data set, applies PAM on each sample, and gives the best clustering as the output
    • Strength: deals with larger data sets than PAM
    • Weakness:
      • Efficiency depends on the sample size
  • A good clustering based on samples will not necessarily represent a good clustering of the whole data set if the sample is biased
  • Density-Based Clustering Methods
  • Clustering based on density (local cluster criterion), such as density-connected points
  • Major features:
  • Discover clusters of arbitrary shape
  • Handle noise
  • One scan
  • Need density parameters as termination condition
  • Several interesting studies:
  • DBSCAN: Ester, et al. (KDD’96)
  • OPTICS: Ankerst, et al (SIGMOD’99).
  • DENCLUE: Hinneburg & D. Keim (KDD’98)
  • CLIQUE: Agrawal, et al. (SIGMOD’98) Density-Based Clustering: Background
  • Two parameters :
  • (^) Eps : Maximum radius of the neighbourhood
  • MinPts : Minimum number of points in an Eps-neighbourhood of that point
  • NEps (p) : {q belongs to D | dist(p,q) <= Eps}
  • Directly density-reachable: A point p is directly density-reachable from a point q wrt. Eps , MinPts if
    1. p belongs to N (^) Eps(q)
    1. core point condition: | N (^) Eps (q) | >= MinPts
  • Density-reachable :
  • Retrieve all points density-reachable from p wrt Eps and MinPts.
  • If p is a core point, a cluster is formed.
  • If p is a border point, no points are density-reachable from p and DBSCAN visits the next point of the database.
  • Continue the process until all of the points have been processed.
  • OPTICS: A Cluster-Ordering Method (1999)
  • OPTICS: Ordering Points To Identify the Clustering Structure
  • Produces a special order of the database wrt its density-based clustering structure
  • This cluster-ordering contains info equiv to the density-based clusterings corresponding to a broad range of parameter settings
  • Good for both automatic and interactive cluster analysis, including finding intrinsic clustering structure
  • Can be represented graphically or using visualization techniques
  • OPTICS computes an augmented cluster ordering for automatic and interactive cluster analysis.
  • This ordering represents the density –based clustering obtained from a wide range of parameter settings.
  • The clustering ordering can be used to extract basic clustering info(cluster centers or arbitrary shaped clusters) as well as provide the intrinsic clustering.
  • To construct the diff clusterings simultaneously, the objects should be processed in a specific order.
  • (^) This order selects an obj that is density-reachable w.r.t the lowest F 06 5value so that clusters with higher density (lower F 06 5) will be finished first.
  • Two values need to be stored for each object here is :
  • Core Distance and reachability distance
  • Core distance of an object p is the smallest F 06 5F 02 0^ F 0 3 1 value that makes {p} a core object.
  • Reachability –distance of an obj q w.r.t another obj p is the greater value of the core-distance of p and the ED b/w p and q.If p is not a core obj , the reachability-distance b/w p and q is undefined. OPTICS: Some Extension from DBSCAN

DENCLUE: using density functions

  • DENsity-based CLUstEring by Hinneburg & Keim (KDD’98)
  • Major features
    • Solid mathematical foundation
    • Good for data sets with large amounts of noise
    • Allows a compact mathematical description of arbitrarily shaped clusters in high-dimensional data sets
    • Significant faster than existing algorithm (faster than DBSCAN by a factor of up to 45)
    • But needs a large number of parameters
  • Grid-Based Clustering Method
    • Using multi-resolution grid data structure
    • Several interesting methods
      • STING (a STatistical INformation Grid approach) by Wang, Yang and Muntz (1997)
      • WaveCluster by Sheikholeslami, Chatterjee, and Zhang (VLDB’98)
        • A multi-resolution clustering approach using wavelet method
      • (^) CLIQUE: Agrawal, et al. (SIGMOD’98)
  • STING: A Statistical Information Grid Approach
  • Wang, Yang and Muntz (VLDB’97)
  • The spatial area area is divided into rectangular cells
  • There are several levels of cells corresponding to different levels of resolution
  • Each cell at a high level is partitioned into a number of smaller cells in the next lower level
  • Statistical info of each cell is calculated and stored beforehand and is used to answer queries
  • Parameters of higher level cells can be easily calculated from parameters of lower level cell
    • count , mean , s , min , max
    • type of distribution—normal, uniform , etc.
  • Use a top-down approach to answer spatial data queries
  • (^) Start from a pre-selected layer—typically with a small number of cells
  • For each cell in the current level compute the confidence interval
    • Remove the irrelevant cells from further consideration
      • When finish examining the current layer, proceed to the next lower level
      • Repeat this process until the bottom layer is reached
      • Advantages:

WaveCluster (1998)

  • How to apply wavelet transform to find clusters
    • Summaries the data by imposing a multidimensional grid structure onto data space
    • These multidimensional spatial data objects are represented in a n-dimensional feature space
    • Apply wavelet transform on feature space to find the dense regions in the feature space
    • Apply wavelet transform multiple times which result in clusters at different scales from fine to coarse

What Is Wavelet (2)?

Quantization

Transformation

WaveCluster (1998)

  • Why is wavelet transformation useful for clustering