Today Unsupervised Learning Clustering K-means. EE3J2 Data Mining Lecture 18 K-means and Agglomerative Algorithms Ali Al-Shahib.

Slides:



Advertisements
Similar presentations
Clustering II.
Advertisements

Slide 1 EE3J2 Data Mining EE3J2 Data Mining Lecture 11: K-Means Clustering Martin Russell.
SEEM Tutorial 4 – Clustering. 2 What is Cluster Analysis?  Finding groups of objects such that the objects in a group will be similar (or.
Hierarchical Clustering
Cluster Analysis: Basic Concepts and Algorithms
1 CSE 980: Data Mining Lecture 16: Hierarchical Clustering.
Hierarchical Clustering. Produces a set of nested clusters organized as a hierarchical tree Can be visualized as a dendrogram – A tree-like diagram that.
Hierarchical Clustering, DBSCAN The EM Algorithm
Data Mining Cluster Analysis: Basic Concepts and Algorithms
Data Mining Techniques: Clustering
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ What is Cluster Analysis? l Finding groups of objects such that the objects in a group will.
Unsupervised learning: Clustering Ata Kaban The University of Birmingham
Clustering II.
Clustering II.
Slide 1 EE3J2 Data Mining Lecture 16 Unsupervised Learning Ali Al-Shahib.
Cluster Analysis: Basic Concepts and Algorithms
Cluster Analysis CS240B Lecture notes based on those by © Tan,Steinbach, Kumar Introduction to Data Mining 4/18/2004.
Microarray analysis 2 Golan Yona. 2) Analysis of co-expression Search for similarly expressed genes experiment1 experiment2 experiment3 ……….. Gene i:
K-means clustering CS281B Winter02 Yan Wang and Lihua Lin.
K-means Clustering. What is clustering? Why would we want to cluster? How would you determine clusters? How can you do this efficiently?
Revision (Part II) Ke Chen COMP24111 Machine Learning Revision slides are going to summarise all you have learnt from Part II, which should be helpful.
Slide 1 EE3J2 Data Mining EE3J2 Data Mining Lecture 11: Clustering Martin Russell.
CSC 4510 – Machine Learning Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Unsupervised Learning. CS583, Bing Liu, UIC 2 Supervised learning vs. unsupervised learning Supervised learning: discover patterns in the data that relate.
DATA MINING CLUSTERING K-Means.
1 Lecture 10 Clustering. 2 Preview Introduction Partitioning methods Hierarchical methods Model-based methods Density-based methods.
Partitional and Hierarchical Based clustering Lecture 22 Based on Slides of Dr. Ikle & chapter 8 of Tan, Steinbach, Kumar.
Clustering Methods K- means. K-means Algorithm Assume that K=3 and initially the points are assigned to clusters as follows. C 1 ={x 1,x 2,x 3 }, C 2.
Clustering Algorithms k-means Hierarchic Agglomerative Clustering (HAC) …. BIRCH Association Rule Hypergraph Partitioning (ARHP) Categorical clustering.
1 Motivation Web query is usually two or three words long. –Prone to ambiguity –Example “keyboard” –Input device of computer –Musical instruments How can.
Clustering What is clustering? Also called “unsupervised learning”Also called “unsupervised learning”
CSE5334 DATA MINING CSE4334/5334 Data Mining, Fall 2014 Department of Computer Science and Engineering, University of Texas at Arlington Chengkai Li (Slides.
COMP Data Mining: Concepts, Algorithms, and Applications 1 K-means Arbitrarily choose k objects as the initial cluster centers Until no change,
K-Means Algorithm Each cluster is represented by the mean value of the objects in the cluster Input: set of objects (n), no of clusters (k) Output:
Data Mining Practical Machine Learning Tools and Techniques Chapter 4: Algorithms: The Basic Methods Section 4.8: Clustering Rodney Nielsen Many of these.
Clustering Clustering is a technique for finding similarity groups in data, called clusters. I.e., it groups data instances that are similar to (near)
Ch. Eick: Introduction to Hierarchical Clustering and DBSCAN 1 Remaining Lectures in Advanced Clustering and Outlier Detection 2.Advanced Classification.
Hierarchical Clustering Produces a set of nested clusters organized as a hierarchical tree Can be visualized as a dendrogram – A tree like diagram that.
Machine Learning Queens College Lecture 7: Clustering.
Slide 1 EE3J2 Data Mining Lecture 18 K-means and Agglomerative Algorithms.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Definition 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)
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Data Mining: Cluster Analysis This lecture node is modified based on Lecture Notes for Chapter.
Clustering Algorithms Sunida Ratanothayanon. What is Clustering?
Given a set of data points as input Randomly assign each point to one of the k clusters Repeat until convergence – Calculate model of each of the k clusters.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach, Kumar Introduction.
Data Mining and Text Mining. The Standard Data Mining process.
Topic 4: Cluster Analysis Analysis of Customer Behavior and Service Modeling.
COMP24111 Machine Learning K-means Clustering Ke Chen.
Data Mining: Basic Cluster Analysis
Unsupervised Learning: Clustering
Unsupervised Learning: Clustering
Clustering CSC 600: Data Mining Class 21.
Slides by Eamonn Keogh (UC Riverside)
Ke Chen Reading: [7.3, EA], [9.1, CMB]
Hierarchical Clustering
Data Clustering Michael J. Watts
Data Mining -Cluster Analysis. What is a clustering ? Clustering is the process of grouping data into classes, or clusters, so that objects within a cluster.
Discrimination and Classification
K-means and Hierarchical Clustering
Clustering.
Revision (Part II) Ke Chen
Ke Chen Reading: [7.3, EA], [9.1, CMB]
Revision (Part II) Ke Chen
Cluster Analysis in Bioinformatics
Text Categorization Berlin Chen 2003 Reference:
Junheng, Shengming, Yunsheng 11/09/2018
Topic 5: Cluster Analysis
SEEM4630 Tutorial 3 – Clustering.
Hierarchical Clustering
Presentation transcript:

EE3J2 Data Mining Lecture 18 K-means and Agglomerative Algorithms Ali Al-Shahib

Today Unsupervised Learning Clustering K-means

Distortion The distortion for the centroid set C = c1,…,cM is defined by: In other words, the distortion is the sum of distances between each data point and its nearest centroid The task of clustering is to find a centroid set C such that the distortion Dist(C) is minimised EE3J2 Data Mining

The K-Means Clustering Method Given k, the k-means algorithm is implemented in 4 steps: Initialisation Define the number of clusters (k). Designate a cluster centre (a vector quantity that is of the same dimensionality of the data) for each cluster. Assign each data point to the closest cluster centre (centroid). That data point is now a member of that cluster. Calculate the new cluster centre (the geometric average of all the members of a certain cluster). Calculate the sum of within-cluster sum-of-squares. If this value has not significantly changed over a certain number of iterations, exit the algorithm. If it has, or the change is insignificant but has not been seen to persist over a certain number of iterations, go back to Step 2. Remember you converge when you have found the minimum overall distance between the centroid and the objects.

The K-Means Clustering Method Example

Lets watch an animation! http://r.yihui.name/stat/multivariate_stat/kmeans/index.htm

K-means Clustering Suppose that we have decided how many centroids we need - denote this number by K Suppose that we have an initial estimate of suitable positions for our K centroids K-means clustering is an iterative procedure for moving these centroids to reduce distortion

K-means clustering - notation Suppose there are T data points, denoted by: Suppose that the initial K clusters are denoted by: One iteration of K-means clustering will produce a new set of clusters Such that

K-means clustering (1) For each data point yt let ci(t) be the closest centroid In other words: d(yt, ci(t)) = minmd(yt,cm) Now, for each centroid c0k define: In other words, Y0k is the set of data points which are closer to c0k than any other cluster

K-means clustering (2) Now define a new kth centroid c1k by: where |Yk0| is the number of samples in Yk0 In other words, c1k is the average value of the samples which were closest to c0k

K-means clustering (3) Now repeat the same process starting with the new centroids: to create a new set of centroids: … and so on until the process converges Each new set of centroids has smaller distortion than the previous set

So….Basically Start with randomly k data points (objects). Find the set of data points that are closer to C0k (Y0k). Compute average of these points, notate C1k -> new centroid. Now repeat again this process and find the closest objects to C1k Compute the average to get C2k -> new centroid, and so on…. Until convergence.

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 Applicable only when mean is defined, then what about categorical data? Need to specify k, the number of clusters, in advance Unable to handle noisy data and outliers Not suitable to discover clusters with non-convex shapes

Hierarchical Clustering Grouping data objects into a tree of clusters. Agglomerative clustering Begin by assuming that every data point is a separate centroid Combine closest centroids until the desired number of clusters is reached Divisive clustering Begin by assuming that there is just one centroid/cluster Split clusters until the desired number of clusters is reached

Agglomerative Clustering - Example Students Exam1 Exam2 Exam3 Mike 9 3 7 Tom 10 2 Bill 1 4 T Ren 6 5 Ali

Distances between objects Using Euclidean Distance measure, what's the difference between Mike and Tom? Mike:9,3,7 Tom: 10,2,9 S E1 E2 E3 Mike 9 3 7 Tom 10 2 Bill 1 4 T 6 5 Ali

Distance Matrix Mike Tom Bill T Ren Ali 2.5 10.44 4.12 11.75 - 12.5   Mike Tom Bill T Ren Ali 2.5 10.44 4.12 11.75 - 12.5 6.4 13.93 6.48 1.41 7.35

The Algorithm Step 1 Identify the entities which are most similar - this can be easily discerned from the distance table constructed. In this example, Bill and Ali are most similar, with a distance value of 1.41. They are therefore the most 'related' Bill Ali

The Algorithm – Step 2 The two entities that are most similar can now be merged so that they represent a single cluster (or new entity). So Bill and Ali can now be considered to be a single entity. How do we compare this entity with others? We use the Average linkage between the two. So the new average vector is [1, 9.5, 3.5] – see first table and average the marks for Bill and Ali. We now need to redraw the distance table, including the merger of the two entities, and new distance calculations.

The Algorithm – Step 3 Mike Tom T Ren {Bill & Ali} - 2.5 4.12 10.9 6.4   Mike Tom T Ren {Bill & Ali} - 2.5 4.12 10.9 6.4 9.1 6.9

Next closest students Mike and Tom with 2.5! So, now we have 2 clusters! Bill Ali Mike Tom

The distance matrix now   {Mike & Tom} T Ren {Bill & Ali} - 3.7 9.2 6.9 Now, T Ren is closest to Bill and Ali so T Ren joines them In the cluster.

The final dendogram Bill Ali MANY ‘SUB-CLUSTERS’ WITHIN ONE CLUSTER Mike Tom T Ren

Conclusions K- Means Algorithm – memorize equations and algorithm. Hierarchical Clustering: Agglomerative Clustering

On Tuesday Sequence Analysis: BLAST Algorithm

Some References and Acknowledgments University College London: http://www.ucl.ac.uk/oncology/MicroCore/HTML_resource/Hier_Example.htm