cluster analysis basic concepts and algorithms lecture
play

Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for - PowerPoint PPT Presentation

Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Slides by Tan, Steinbach, Kumar adapted by Michael Hahsler Look for accompanying R code on the course web site. Topics Introduction Types of Clustering


  1. Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Slides by Tan, Steinbach, Kumar adapted by Michael Hahsler Look for accompanying R code on the course web site.

  2. Topics • Introduction • Types of Clustering • Types of Clusters • Clustering Algorithms - K-Means Clustering - Hierarchical Clustering - Density-based Clustering • Cluster Validation

  3. What is Cluster Analysis? • 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

  4. Applications of Cluster Analysis Discovered Clusters Industry Group • Understanding Applied-Matl-DOWN,Bay-Network-Down,3-COM-DOWN, 1 Cabletron-Sys-DOWN,CISCO-DOWN,HP-DOWN, DSC-Comm-DOWN,INTEL-DOWN,LSI-Logic-DOWN, - Group related documents Technology1-DOWN Micron-Tech-DOWN,Texas-Inst-Down,Tellabs-Inc-Down, Natl-Semiconduct-DOWN,Oracl-DOWN,SGI-DOWN, Sun-DOWN for browsing, group genes Apple-Comp-DOWN,Autodesk-DOWN,DEC-DOWN, 2 ADV-Micro-Device-DOWN,Andrew-Corp-DOWN, and proteins that have Computer-Assoc-DOWN,Circuit-City-DOWN, Technology2-DOWN Compaq-DOWN, EMC-Corp-DOWN, Gen-Inst-DOWN, similar functionality, or Motorola-DOWN,Microsoft-DOWN,Scientific-Atl-DOWN Fannie-Mae-DOWN,Fed-Home-Loan-DOWN, 3 group stocks with similar MBNA-Corp-DOWN,Morgan-Stanley-DOWN Financial-DOWN price fluctuations Baker-Hughes-UP,Dresser-Inds-UP,Halliburton-HLD-UP, 4 Louisiana-Land-UP,Phillips-Petro-UP,Unocal-UP, Oil-UP Schlumberger-UP • Summarization - Reduce the size of large data sets Clustering precipitation in Australia

  5. What is not Cluster Analysis? • Supervised classification - Uses class label information • Simple segmentation - Dividing students into different registration groups alphabetically, by last name • Results of a query - Groupings are a result of an external specification → Clustering uses only the data

  6. Similarity How do we measure similarity/proximity/dissimilarity/distance? Examples - Minkovsky distance: Manhattan distance, Euclidean Distance, etc. - Jaccard index for binary data - Gower's distance for mixed data (ratio/interval and nominal) - Correlation coefficient as similarity between variables

  7. Notion of a Cluster can be Ambiguous How many clusters?

  8. Notion of a Cluster can be Ambiguous How many clusters? Six Clusters Two Clusters Four Clusters

  9. Topics • Introduction • Types of Clustering • Types of Clusters • Clustering Algorithms - K-Means Clustering - Hierarchical Clustering - Density-based Clustering • Cluster Validation

  10. Types of Clusterings • A clustering is a set of clusters • Partitional Clustering - A division data objects into non-overlapping subsets (clusters) such that each data object is in exactly one subset • Hierarchical clustering - A set of nested clusters organized as a hierarchical tree

  11. Partitional Clustering Original Points A Partitional Clustering

  12. Hierarchical Clustering

  13. Other Distinctions Between Sets of Clusters • Exclusive versus non-exclusive - In non-exclusive clusterings, points may belong to multiple clusters. • Fuzzy versus non-fuzzy - In fuzzy clustering, a point belongs to every cluster with some membership weight between 0 and 1 - Membership weights must sum to 1 - Probabilistic clustering has similar characteristics • Partial versus complete - In some cases, we only want to cluster some of the data • Heterogeneous versus homogeneous - Cluster of widely different sizes, shapes, and densities

  14. Topics • Introduction • Types of Clustering • Types of Clusters • Clustering Algorithms - K-Means Clustering - Hierarchical Clustering - Density-based Clustering • Cluster Validation

  15. Types of Clusters • Center-based clusters • Contiguous clusters • Density-based clusters • Conceptual clusters • Described by an Objective Function

  16. Center-based Clusters Not well separated (overlapping) Well separated Cluster Center A cluster is a set of objects such that an object in a cluster is closer (more similar) to the “center” of a cluster, than to the center of any other cluster The center of a cluster is often a centroid , the average of all the points in the cluster, or a medoid , the most “representative” point of a cluster

  17. Contiguous and Density-based Clusters High density

  18. Conceptual Clusters Conceptual clusters are hard to detect since they are often not: ● Center-based ● Contiguity-based ● Density-based

  19. Topics • Introduction • Types of Clustering • Types of Clusters • Objective Functions • Clustering Algorithms - K-Means Clustering - Hierarchical Clustering - Density-based Clustering • Cluster Validation

  20. Objective Functions The best clustering minimizes or maximizes an objective function. • Example: Minimize the Sum of Squared Errors K 2 SSE = ∑ ∑ ‖ x − m i ‖ i = 1 x ∈ C i - x is a data point in cluster C i is the center for cluster C as the m i , i mean of all points in the cluster and | is the L2 norm (= Euclidean | . | | distance). Problem: Enumerate all possible ways of dividing the points into clusters and evaluate the `goodness' of each potential set of clusters by using the given objective function. (NP Hard)

  21. Objective Functions Global objective function • Typically used in partitional clustering (k-means uses SSE) • Mixture Models assume that the data is a ‘mixture' of a number of parametric statistical distributions (e.g., a mixture of Gaussians). Local objective function • Hierarchical clustering algorithms typically have local objectives • Density-based clustering is based on local density estimates • Graph based approaches. Graph partitioning and shared nearest neighbors We will talk about the objective functions when we talk about individual clustering algorithms.

  22. Topics • Introduction • Types of Clustering • Types of Clusters • Clustering Algorithms - K-Means Clustering - Hierarchical Clustering - Density-based Clustering • Cluster Validation

  23. K-means Clustering • Partitional clustering approach • Each cluster is associated with a centroid (center point) • Each point is assigned to the cluster with the closest centroid • Number of clusters, K, must be specified Lloyd’s algorithm (Voronoi iteration):

  24. K-means Clustering – Details • Initial centroids are often chosen randomly. - Clusters produced vary from one run to another. • The centroid is the mean of the points in the cluster. • ‘Closeness’ is measured by Euclidean distance • K-means will converge (points stop changing assignment) typically in the first few iterations. - Often the stopping condition is changed to ‘Until relatively few points change clusters’ • Complexity is O ( n * K * I * d ) - n = number of points, K = number of clusters, = number of iterations, d = number of attributes I

  25. K-Means Example I t e r a t i o n 1 I t e r a t i o n 2 I t e r a t i o n 3 3 3 3 2 . 5 2 . 5 2 . 5 2 2 2 1 . 5 1 . 5 1 . 5 y 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 I t e r a t i o n 4 I t e r a t i o n 5 I t e r a t i o n 6 3 3 3 2 . 5 2 . 5 2 . 5 2 2 2 1 . 5 1 . 5 1 . 5 y 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 See visualization on course web site

  26. Problems with Selecting Initial Points If there are K ‘real’ clusters then the chance of selecting one centroid from each cluster is small. - Chance is relatively small when K is large - If clusters are the same size, n, then - For example, if K = 10, then probability = 10!/1010 = 0.00036 - Sometimes the initial centroids will readjust themselves in ‘right’ way, and sometimes they don’t - Consider an example of five pairs of clusters

  27. Importance of Choosing Initial Centroids … I t e r a t i o n 1 I t e r a t i o n 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 I t e r a t i o n 3 I t e r a t i o n 4 I t e r a t i o n 5 3 3 3 2 . 5 2 . 5 2 . 5 2 2 2 1 . 5 1 . 5 1 . 5 y 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

  28. Solutions to Initial Centroids Problem • Multiple runs (Helps) • Sample and use hierarchical clustering to determine initial centroids • Select more than k initial centroids and then select among these initial centroids the ones that are far away from each other.

Recommend


More recommend