Overview Prognostic Models and Data Mining in Medicine, part I Cluster Analsis What is Cluster Analsis? K-Means Clustering Hierarchical Clustering Cluster Validit Eample: Microarra data analsis 6 Summar Includes material from: - Tan, Steinbach, Kumar: Introduction to Data Mining - Witten & Frank: Data Mining Practical Machine Learning Tools and Techniques Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis What is Cluster Analsis? () Finding groups of items that are similar Clustering is unsupervised The class of an eample is not known Success often measured subjectivel What is Cluster Analsis? Sepal length 9 Sepal width Petal length Petal width Tpe Iris setosa Iris setosa 7 7 Iris versicolor 6 Iris versicolor 6 6 Iris virginica 8 7 9 Iris virginica Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis What is Cluster Analsis? () Applications of Cluster Analsis 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 Intra-cluster distances are minimized Inter-cluster distances are maimized Understanding Group related documents for browsing, group genes and proteins that have similar functionalit, or group stocks with similar price fluctuations Discovered Clusters Applied-Matl-DOWN,Ba-Network-Down,-COM-DOWN, Cabletron-Ss-DOWN,CISCO-DOWN,HP-DOWN, DSC-Comm-DOWN,INTEL-DOWN,LSI-Logic-DOWN, Micron-Tech-DOWN,Teas-Inst-Down,Tellabs-Inc-Down, Natl-Semiconduct-DOWN,Oracl-DOWN,SGI-DOWN, Sun-DOWN Apple-Comp-DOWN,Autodesk-DOWN,DEC-DOWN, ADV-Micro-Device-DOWN,Andrew-Corp-DOWN, Computer-Assoc-DOWN,Circuit-Cit-DOWN, Compaq-DOWN, EMC-Corp-DOWN, Gen-Inst-DOWN, Motorola-DOWN,Microsoft-DOWN,Scientific-Atl-DOWN Fannie-Mae-DOWN,Fed-Home-Loan-DOWN, MBNA-Corp-DOWN,Morgan-Stanle-DOWN Baker-Hughes-UP,Dresser-Inds-UP,Halliburton-HLD-UP, Louisiana-Land-UP,Phillips-Petro-UP,Unocal-UP, Schlumberger-UP Industr Group Technolog-DOWN Technolog-DOWN Financial-DOWN Oil-UP Summarization Reduce the size of large data sets Clustering precipitation in Australia Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis 6
Eample: Document Clustering Goal: To find groups of documents that are similar to each other based on the important terms appearing in them Approach: Identif frequentl occurring terms in the documents Define a similarit measure based on the frequencies of different terms Use it to cluster Gain: Information Retrieval can utilize the clusters to relate a new document or search term to clustered documents Clustering: Definition Given a set of data points, each having a set of attributes, and a similarit measure among them, find clusters such that Data points in one cluster are more similar to one another Data points in separate clusters are less similar to one another Similarit Measures: Euclidean Distance if attributes are continuous Other Problem-specific Measures Prognostic Models and Data Mining, part I Cluster Analsis 7 Prognostic Models and Data Mining, part I Cluster Analsis 8 Notion of a Cluster can be Ambiguous Tpes of Clusterings How man clusters? Si Clusters A clustering is a set of clusters Important distinction between hierarchical and partitional sets of clusters Partitional Clustering A division of data objects into non-overlapping subsets Hierarchical clustering A set of nested partitional clusterings, organized in a tree Two Clusters Four Clusters Prognostic Models and Data Mining, part I Cluster Analsis 9 Prognostic Models and Data Mining, part I Cluster Analsis Partitional Clustering Hierarchical Clustering p p p p p p p p Traditional Hierarchical Clustering Traditional Dendrogram p p p A Partitional Clustering p Non-traditional Hierarchical Clustering p p p p Non-traditional Dendrogram Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis
Clustering Algorithms K-means clustering Hierarchical clustering Densit-based clustering K-means K Clustering Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis K-means Clustering K-means Clustering Algorithm Partitional clustering method where each cluster C i has a representative point m i (called centroid) Number of clusters, K, is specified in advance Objective: find a set of clusters C,, C k that minimizes the Sum of Squared Errors (SSE): SSE = i= Ci Other evaluation functions are possible K d( m, ) With this evaluation function, centroid m i will be the geometric mean of cluster C i i Central concept is proimit between points Intermediate and final centroids need not be data points (and tpicall the are not) Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis 6 Eample K-means Clustering Details Iteration 6 - - - - Initial centroids are often chosen randoml Clusters produced var from one run to another The centroid is (usuall) the mean of the points in the cluster Closeness is measured b Euclidean distance, cosine similarit, correlation, etc Converge is guaranteed for common similarit measures mentioned above Most of the convergence happens in the first few iterations Often the stopping condition is changed to Until relativel few points change clusters Prognostic Models and Data Mining, part I Cluster Analsis 7 Prognostic Models and Data Mining, part I Cluster Analsis 8
The Influence of Initial Centroids Influence of Initial Centroids K-means clustering performs a greed search procedure, starting from the initial centroids The search algorithms gets easil stuck in local minima As a result, the final clustering highl depends on the initial centroids Iteration - - - - Prognostic Models and Data Mining, part I Cluster Analsis 9 Prognostic Models and Data Mining, part I Cluster Analsis Problems with Selecting Initial Clusters Eample () If there are K real clusters then the chance of selecting one centroid from each cluster is small Chance is relativel small when K is large If clusters are the same size, n, then 8 6 Iteration For eample, if K =, then P =!/ = 6 Sometimes the initial centroids will readjust themselves in right wa, and sometimes the don t Consider an eample of five pairs of clusters Prognostic Models and Data Mining, part I Cluster Analsis - - -6 Starting with two initial centroids in one cluster of each pair of clusters Prognostic Models and Data Mining, part I Cluster Analsis Clusters Eample () Solutions to Initial Centroids Problem 8 6 - - -6 Iteration Multiple runs Helps, but probabilit is not on our side Select more than k initial centroids and then select among these initial centroids Select most widel separated Appl better search technique Eg genetic algorithm Postprocessing Starting with some pairs of clusters having three initial centroids, while other have onl one Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis
Pre-processing and Post-processing Pre-processing Normalize the data Eliminate outliers Post-processing Eliminate small clusters that ma represent outliers Split loose clusters (clusters with relativel high SSE) Merge clusters that are close and that have relativel low SSE Limitations of K-means K-means has problems when clusters are of differing Sizes Densities Non-globular shapes K-means has problems when the data contains outliers Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis 6 Limitations of K-means: Differing Sizes Limitations of K-means: Differing Densit K-means ( Clusters) K-means ( Clusters) Prognostic Models and Data Mining, part I Cluster Analsis 7 Prognostic Models and Data Mining, part I Cluster Analsis 8 Limitations of K-means: Non-globular Shapes Hierarchical Clustering K-means ( Clusters) Prognostic Models and Data Mining, part I Cluster Analsis 9 Prognostic Models and Data Mining, part I Cluster Analsis
Hierarchical Clustering Produces a set of nested clusters organized as a hierarchical tree Can be visualized as a dendrogram A tree like diagram that records the sequences of merges or splits 6 Strengths of Hierarchical Clustering Do not have to assume an particular number of clusters An desired number of clusters can be obtained b cutting the dendogram at the proper level The ma correspond to meaningful taonomies Eample in biological sciences (eg, animal kingdom, phlogen reconstruction, ) 6 Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis Tpes of hierarchical Clustering Agglomerative Start with the points as individual clusters At each step, merge the closest pair of clusters until one cluster remains Most popular Divisive Start with one, all-inclusive cluster At each step, split a cluster until each cluster contains a single point Agglomerative Clustering Algorithm Basic algorithm: Compute the proimit matri Let each data point be a cluster Repeat Merge the two closest clusters Update the proimit matri 6 Until onl a single cluster remains Central concept is proimit between clusters Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis Starting Situation Start with clusters of individual points and a proimit matri p p p p p p p p p p Proimit Matri Intermediate Situation After some merging steps, we have some clusters C C C C C C C C C C C C Proimit Matri C C C Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis 6
Intermediate Situation After Merging We want to merge the two closest clusters (C and C) and update the proimit matri C C C C C C C C C U C * C C C C C C C C C Proimit Matri C C C C U C C C * * * * * * Proimit Matri C C C U C Prognostic Models and Data Mining, part I Cluster Analsis 7 Prognostic Models and Data Mining, part I Cluster Analsis 8 How to Define Inter-Cluster Similarit How to Define Inter-Cluster Similarit p p p p p p p p p p Similarit? p p p p p p p p MIN MAX Group Average Distance Between Centroids Other p Proimit Matri MIN MAX Group Average Distance Between Centroids Other p Proimit Matri Prognostic Models and Data Mining, part I Cluster Analsis 9 Prognostic Models and Data Mining, part I Cluster Analsis How to Define Inter-Cluster Similarit How to Define Inter-Cluster Similarit p p p p p p p p p p p p p p p p p p MIN MAX Group Average Distance Between Centroids Other p Proimit Matri MIN MAX Group Average Distance Between Centroids Other p Proimit Matri Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis
How to Define Inter-Cluster Similarit Cluster Similarit: MIN or Single Link MIN MAX Group Average Distance Between Centroids Other p p p p p p p p p p Proimit Matri Similarit of two clusters is based on the two most similar (closest) points in the different clusters Determined b one pair of points, ie, b one link in the proimit graph I I I I I I 9 6 I 9 7 6 I 7 I 6 6 8 I 8 Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis Hierarchical Clustering: MIN Strength of MIN 6 6 Two Clusters Nested Clusters Dendrogram Can handle differing sizes and desities Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis 6 Limitations of MIN Cluster Similarit: MAX or Complete Linkage Similarit of two clusters is based on the two least similar (most distant) points in the different clusters Determined b all pairs of points in the two clusters Sensitive to noise and outliers Two Clusters I I I I I I 9 6 I 9 7 6 I 7 I 6 6 8 I 8 Prognostic Models and Data Mining, part I Cluster Analsis 7 Prognostic Models and Data Mining, part I Cluster Analsis 8
Hierarchical Clustering: MAX Strength of MAX 6 6 Two Clusters Nested Clusters Dendrogram Less susceptible to noise and outliers Prognostic Models and Data Mining, part I Cluster Analsis 9 Prognostic Models and Data Mining, part I Cluster Analsis Limitations of MAX Hierarchical Clustering: Problems and Limitations Tends to break large clusters Biased towards globular clusters Two Clusters Once a decision is made to combine two clusters, it cannot be undone Does not directl minimize objective function (eg SSE), as in K-means Different schemes have problems with one or more of the following: Sensitivit to noise and outliers Handling different sized clusters and conve shapes Breaking large clusters Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis Cluster Validit Clustering algorithms will alwas come up with a clustering of the data, whether that makes sense or not Eg K-means: alwas ields K clusters Cluster Validit We must therefore assess whether the results of a cluster analsis are valid Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis
Clusters found in Random Data Subjective validation: eeballing Random 9 8 7 6 One method to evaluate clusterings is eeballing not feasible in high-dimensional domains Solution: construct and visualize similarit matri 6 8 9 9 K-means 8 7 6 8 7 6 Complete Link 6 8 6 8 Prognostic Models and Data Mining, part I Cluster Analsis Prognostic Models and Data Mining, part I Cluster Analsis 6 Using Similarit Matri for Cluster Validation Using Similarit Matri for Cluster Validation Clusters in random data are not so crisp 9 9 8 8 9 9 7 7 8 8 6 6 6 6 7 6 7 6 7 7 6 8 8 9 6 8 Similarit 8 9 6 8 Similarit 6 8 K-means Prognostic Models and Data Mining, part I Cluster Analsis 7 Prognostic Models and Data Mining, part I Cluster Analsis 8 Using Similarit Matri for Cluster Validation Clusters in random data are not so crisp Validation Measures Objective measures to evaluate clusterings are generall preferrable over subjective measures 6 7 8 9 9 8 7 6 9 8 7 6 For classification methods we have a variet of objective measures to evaluate how good the results are Eg error rate, sensitivit, specificit, AUC, Brier score, For cluster analsis, the number of available measures is much smaller 6 8 Similarit 6 8 and the are more heavil disputed Complete Link Prognostic Models and Data Mining, part I Cluster Analsis 9 Prognostic Models and Data Mining, part I Cluster Analsis 6
What are DNA microarras? Gene E E E Gene Eample: Microarra Analsis Ep Ep Ep Gene N Prognostic Models and Data Mining, part I Cluster Analsis 6 Prognostic Models and Data Mining, part I Cluster Analsis 6 Wh clustering? Eample E E E Gene Gene Gene N E E E Gene N Gene Gene Discover functional relations (similar epression functionall related) Assign function to unknown genes Find out which genes control which other genes Clustering It is easier to look at large blocks of similarl epressed genes The dendogram helps show how closel related epression patterns are A Cholesterol sn B Cell ccle C Immediate-earl response D Signaling E Tissue remodeling Prognostic Models and Data Mining, part I Cluster Analsis 6 Prognostic Models and Data Mining, part I Cluster Analsis 6 Summar 6 Summar Cluster analsis is the process of finding groups of similar objects Most popular algorithms: K-means clustering Agglomerative Hierarchical Clustering Result will criticall depend on various choices Proimit measure / distance metric Number of clusters (K-means) Tpe of linkage (Hierarchical clustering) Cluster validation is problematic Prognostic Models and Data Mining, part I Cluster Analsis 6 Prognostic Models and Data Mining, part I Cluster Analsis 66