1 Clustering: K-Means Machine Learning 10-601, Fall 2014 Bhavana Dalvi Mishra PhD student LTI, CMU Slides are based on materials from Prof. Eric Xing,

Slides:



Advertisements
Similar presentations
Mixture Models and the EM Algorithm
Advertisements

Unsupervised Learning
AUTOMATIC GLOSS FINDING for a Knowledge Base using Ontological Constraints Bhavana Dalvi (PhD Student, LTI) Work done with: Prof. William Cohen, CMU Prof.
Expectation Maximization
K Means Clustering , Nearest Cluster and Gaussian Mixture
Supervised Learning Recap
Segmentation and Fitting Using Probabilistic Methods
DATA MINING van data naar informatie Ronald Westra Dep. Mathematics Maastricht University.
K-means clustering Hongning Wang
Machine Learning and Data Mining Clustering
Introduction to Bioinformatics
Overview Full Bayesian Learning MAP learning
Lecture 17: Supervised Learning Recap Machine Learning April 6, 2010.
ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Unsupervised Learning: Clustering Rong Jin Outline  Unsupervised learning  K means for clustering  Expectation Maximization algorithm for clustering.
Announcements  Project proposal is due on 03/11  Three seminars this Friday (EB 3105) Dealing with Indefinite Representations in Pattern Recognition.
Prénom Nom Document Analysis: Data Analysis and Clustering Prof. Rolf Ingold, University of Fribourg Master course, spring semester 2008.
Clustering.
Expectation Maximization Algorithm
Semi-Supervised Clustering Jieping Ye Department of Computer Science and Engineering Arizona State University
Expectation-Maximization
Visual Recognition Tutorial
Pattern Recognition. Introduction. Definitions.. Recognition process. Recognition process relates input signal to the stored concepts about the object.
Multi-view Exploratory Learning for AKBC Problems Bhavana Dalvi and William W. Cohen School Of Computer Science, Carnegie Mellon University Motivation.
ECE 5984: Introduction to Machine Learning
Clustering with Bregman Divergences Arindam Banerjee, Srujana Merugu, Inderjit S. Dhillon, Joydeep Ghosh Presented by Rohit Gupta CSci 8980: Machine Learning.
INTRODUCTION TO Machine Learning ETHEM ALPAYDIN © The MIT Press, Lecture Slides for.
Gaussian Mixture Models and Expectation Maximization.
Radial Basis Function Networks
Incomplete Graphical Models Nan Hu. Outline Motivation K-means clustering Coordinate Descending algorithm Density estimation EM on unconditional mixture.
EM and expected complete log-likelihood Mixture of Experts
COMMON EVALUATION FINAL PROJECT Vira Oleksyuk ECE 8110: Introduction to machine Learning and Pattern Recognition.
CSC321: Neural Networks Lecture 12: Clustering Geoffrey Hinton.
Lecture 19: More EM Machine Learning April 15, 2010.
CHAPTER 7: Clustering Eick: K-Means and EM (modified Alpaydin transparencies and new transparencies added) Last updated: February 25, 2014.
Unsupervised Learning: Clustering Some material adapted from slides by Andrew Moore, CMU. Visit for
First topic: clustering and pattern recognition Marc Sobel.
MACHINE LEARNING 8. Clustering. Motivation Based on E ALPAYDIN 2004 Introduction to Machine Learning © The MIT Press (V1.1) 2  Classification problem:
ECE 5984: Introduction to Machine Learning Dhruv Batra Virginia Tech Topics: –Unsupervised Learning: Kmeans, GMM, EM Readings: Barber
Lecture 17 Gaussian Mixture Models and Expectation Maximization
Chapter 11 Statistical Techniques. Data Warehouse and Data Mining Chapter 11 2 Chapter Objectives  Understand when linear regression is an appropriate.
HMM - Part 2 The EM algorithm Continuous density HMM.
Lecture 6 Spring 2010 Dr. Jianjun Hu CSCE883 Machine Learning.
Cluster Analysis Potyó László. Cluster: a collection of data objects Similar to one another within the same cluster Similar to one another within the.
INTRODUCTION TO MACHINE LEARNING 3RD EDITION ETHEM ALPAYDIN © The MIT Press, Lecture.
DATA MINING van data naar informatie Ronald Westra Dep. Mathematics Maastricht University.
1 Clustering: K-Means Machine Learning , Fall 2014 Bhavana Dalvi Mishra PhD student LTI, CMU Slides are based on materials from Prof. Eric Xing,
Mehdi Ghayoumi MSB rm 132 Ofc hr: Thur, a Machine Learning.
Lecture 2: Statistical learning primer for biologists
Radial Basis Function ANN, an alternative to back propagation, uses clustering of examples in the training set.
Flat clustering approaches
ECE 5984: Introduction to Machine Learning Dhruv Batra Virginia Tech Topics: –(Finish) Expectation Maximization –Principal Component Analysis (PCA) Readings:
SUPERVISED AND UNSUPERVISED LEARNING Presentation by Ege Saygıner CENG 784.
ECE 8443 – Pattern Recognition ECE 8527 – Introduction to Machine Learning and Pattern Recognition Objectives: Mixture Densities Maximum Likelihood Estimates.
Semi-Supervised Learning William Cohen. Outline The general idea and an example (NELL) Some types of SSL – Margin-based: transductive SVM Logistic regression.
Slide 1 Directed Graphical Probabilistic Models: learning in DGMs William W. Cohen Machine Learning
Big Data Infrastructure Week 9: Data Mining (4/4) This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States.
Introduction to Machine Learning Nir Ailon Lecture 12: EM, Clustering and More.
Unsupervised Learning Part 2. Topics How to determine the K in K-means? Hierarchical clustering Soft clustering with Gaussian mixture models Expectation-Maximization.
Big Data Infrastructure
Deep Feedforward Networks
Machine Learning Clustering: K-means Supervised Learning
Lecture 18 Expectation Maximization
Latent Variables, Mixture Models and EM
Probabilistic Models with Latent Variables
Unsupervised Learning II: Soft Clustering with Gaussian Mixture Models
INTRODUCTION TO Machine Learning
LECTURE 21: CLUSTERING Objectives: Mixture Densities Maximum Likelihood Estimates Application to Gaussian Mixture Models k-Means Clustering Fuzzy k-Means.
Expectation Maximization Eric Xing Lecture 10, August 14, 2010
Presentation transcript:

1 Clustering: K-Means Machine Learning , Fall 2014 Bhavana Dalvi Mishra PhD student LTI, CMU Slides are based on materials from Prof. Eric Xing, Prof. William Cohen and Prof. Andrew Ng

Outline 2 What is clustering? How are similarity measures defined? Different clustering algorithms  K-Means  Gaussian Mixture Models Expectation Maximization Advanced topics  How to seed clustering?  How to choose #clusters  Application: Gloss finding for a Knowledge Base

Clustering 3

Classification vs. Clustering Supervision availableUnsupervised 4 Unsupervised learning: learning from raw (unlabeled) data Learning from supervised data: example classifications are given

Clustering 5 The process of grouping a set of objects into clusters high intra-cluster similarity low inter-cluster similarity How many clusters? How to identify them?

Applications of Clustering 6 Google news: Clusters news stories from different sources about same event …. Computational biology: Group genes that perform the same functions Social media analysis: Group individuals that have similar political views Computer graphics: Identify similar objects from pictures

Examples 7 People Images Species

What is a natural grouping among these objects? 8

Similarity Measures 9

What is Similarity? 10 The real meaning of similarity is a philosophical question. Depends on representation and algorithm. For many rep./alg., easier to think in terms of a distance (rather than similarity) between vectors. Hard to define! But we know it when we see it

Intuitions behind desirable distance measure properties 11 D(A,B) = D(B,A) Symmetry Otherwise you could claim "Alex looks like Bob, but Bob looks nothing like Alex" D(A,A) = 0 Constancy of Self-Similarity Otherwise you could claim "Alex looks more like Bob, than Bob does" D(A,B) = 0 IIf A= B Identity of indiscerniblesects in your world that are different, but you cannot tell apart. D(A,B)  D(A,C) + D(B,C) Triangular Inequality Otherwise you could claim "Alex is very like Bob, and Alex is very like Carl, but Bob is very unlike Carl"

Intuitions behind desirable distance measure properties 12 D(A,B) = D(B,A) Symmetry Otherwise you could claim "Alex looks like Bob, but Bob looks nothing like Alex" D(A,A) = 0 Constancy of Self-Similarity Otherwise you could claim "Alex looks more like Bob, than Bob does" D(A,B) = 0 IIf A= B Identity of indiscernibles Otherwise there are objects in your world that are different, but you cannot tell apart. D(A,B)  D(A,C) + D(B,C) Triangular Inequality Otherwise you could claim "Alex is very like Bob, and Alex is very like Carl, but Bob is very unlike Carl"

Distance Measures: Minkowski Metric 13 Suppose two object x and y both have p features The Minkowski metric is defined by Most Common Minkowski Metrics

An Example x y

Hamming distance 15 Manhattan distance is called Hamming distance when all features are binary. Gene Expression Levels Under 17 Conditions (1-High,0-Low)

Similarity Measures: Correlation Coefficient 16 Time Gene A Gene B Expression Level Time Gene A Gene B Positively correlated Uncorrelated Negatively correlated Time Gene A Expression Level Gene B

Similarity Measures: Correlation Coefficient 17 Pearson correlation coefficient Special case: cosine distance

Clustering Algorithm K-Means 18

K-means Clustering: Step 1 19

K-means Clustering: Step 2 20

K-means Clustering: Step 3 21

K-means Clustering: Step 4 22

K-means Clustering: Step 5 23

K-Means: Algorithm Decide on a value for k. 2. Initialize the k cluster centers randomly if necessary. 3. Repeat till any object changes its cluster assignment Decide the cluster memberships of the N objects by assigning them to the nearest cluster centroid Re-estimate the k cluster centers, by assuming the memberships found above are correct.

K-Means is widely used in practice 25 Extremely fast and scalable: used in variety of applications Can be easily parallelized Easy Map-Reduce implementation Mapper: assigns each datapoint to nearest cluster Reducer: takes all points assigned to a cluster, and re-computes the centroids Sensitive to starting points or random seed initialization (Similar to Neural networks) There are extensions like K-Means++ that try to solve this problem

Outliers 26

Clustering Algorithm Gaussian Mixture Model 27

Density estimation 28 An aircraft testing facility measures Heat and Vibration parameters for every newly built aircraft. Estimate density function P(x) given unlabeled datapoints X 1 to X n

Mixture of Gaussians 29

Mixture Models 30 A density model p ( x ) may be multi-modal. We may be able to model it as a mixture of uni-modal distributions (e.g., Gaussians). Each mode may correspond to a different sub-population (e.g., male and female). 

Gaussian Mixture Models (GMMs) 31 Consider a mixture of K Gaussian components: This model can be used for unsupervised clustering. This model (fit by AutoClass) has been used to discover new kinds of stars in astronomical data, etc. mixture proportion mixture component

Learning mixture models 32 In fully observed iid settings, the log likelihood decomposes into a sum of local terms. With latent variables, all the parameters become coupled together via marginalization

If we are doing MLE for completely observed data Data log-likelihood MLE MLE for GMM 33 Gaussian Naïve Bayes

Learning GMM (z’s are unknown) 34

Expectation Maximization (EM) 35

Expectation-Maximization (EM) 36 Start: "Guess" the mean and covariance of each of the K gaussians Loop

37

Expectation-Maximization (EM) 38 Start: "Guess" the centroid and covariance of each of the K clusters Loop

The Expectation-Maximization (EM) Algorithm 39 E Step: Guess values of Z’s

The Expectation-Maximization (EM) Algorithm 40 M Step: Update parameter estimates

EM Algorithm for GMM 41 E Step: Guess values of Z’s M Step: Update parameter estimates

K-means is a hard version of EM 42 In the K-means “E-step” we do hard assignment: In the K-means “M-step” we update the means as the weighted sum of the data, but now the weights are 0 or 1:

Soft vs. Hard EM assignments 43 GMM K-Means

Theory underlying EM 44 What are we doing? Recall that according to MLE, we intend to learn the model parameters that would maximize the likelihood of the data. But we do not observe z, so computing is difficult! What shall we do?

Intuition behind the EM algorithm 45

Jensen’s Inequality 46 For a convex function f(x) Similarly, for a concave function f(x)

Jensen’s Inequality: concave f(x) 47

EM and Jensen’s Inequality 48

Advanced Topics 49

How Many Clusters? 50 Number of clusters K is given Partition ‘n’ documents into predetermined #topics Solve an optimization problem: penalize #clusters Information theoretic approaches: AIC, BIC criteria for model selection Tradeoff between having clearly separable clusters and having too many clusters

Seed Choice: K-Means++ 51

Semi-supervised K-Means 52

Supervised Learning Unsupervised Learning 53 Semi-supervised Learning

Automatic Gloss Finding for a Knowledge Base 54 Glosses: Natural language definitions of named entities. E.g. “Microsoft” is an American multinational corporation headquartered in Redmond that develops, manufactures, licenses, supports and sells computer software, consumer electronics and personal computers and services... Input: Knowledge Base i.e. a set of concepts (e.g. company) and entities belonging to those concepts (e.g. Microsoft), and a set of potential glosses. Output: Candidate glosses matched to relevant entities in the KB. “Microsoft is an American multinational corporation headquartered in Redmond …” is mapped to entity “Microsoft” of type “Company”. [Automatic Gloss Finding for a Knowledge Base using Ontological Constraints, Bhavana Dalvi Mishra, Einat Minkov, Partha Pratim Talukdar, and William W. Cohen, 2014, Under submission]

Example: Gloss finding 55

Example: Gloss finding 56

Example: Gloss finding 57

Example: Gloss finding 58

Training a clustering model Train: Unambiguous glosses Test: Ambiguous glosses 59 Fruit Company

GLOFIN: Clustering glosses 60

GLOFIN: Clustering glosses 61

GLOFIN: Clustering glosses 62

GLOFIN: Clustering glosses 63

GLOFIN: Clustering glosses 64

GLOFIN: Clustering glosses 65

GLOFIN on NELL Dataset categories, 247K candidate glosses, #train=20K, #test=227K

GLOFIN on Freebase Dataset categories, 285K candidate glosses, #train=25K, #test=260K

Summary 68 What is clustering? What are similarity measures? K-Means clustering algorithm Mixture of Gaussians (GMM) Expectation Maximization Advanced Topics How to seed clustering How to decide #clusters Application: Gloss finding for a Knowledge Bases

Thank You Questions? 69