Prof. Paolo Ferragina, Algoritmi per "Information Retrieval"

Slides:



Advertisements
Similar presentations
Lecture 15(Ch16): Clustering
Advertisements

Clustering II.
SEEM Tutorial 4 – Clustering. 2 What is Cluster Analysis?  Finding groups of objects such that the objects in a group will be similar (or.
Clustering (2). Hierarchical Clustering Produces a set of nested clusters organized as a hierarchical tree Can be visualized as a dendrogram –A tree like.
Hierarchical Clustering
Unsupervised Learning
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.
Data Mining Cluster Analysis Basics
Hierarchical Clustering, DBSCAN The EM Algorithm
PARTITIONAL CLUSTERING
Clustering Paolo Ferragina Dipartimento di Informatica Università di Pisa This is a mix of slides taken from several presentations, plus my touch !
© 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.
Data Mining Cluster Analysis: Basic Concepts and Algorithms
© 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.
Clustering II.
© University of Minnesota Data Mining for the Discovery of Ocean Climate Indices 1 CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance.
1 Text Clustering. 2 Clustering Partition unlabeled examples into disjoint subsets of clusters, such that: –Examples within a cluster are very similar.
Lecture 13: Clustering (continued) May 12, 2010
Cluster Analysis: Basic Concepts and Algorithms
© University of Minnesota Data Mining for the Discovery of Ocean Climate Indices 1 CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance.
Unsupervised Learning: Clustering 1 Lecture 16: Clustering Web Search and Mining.
Partitional and Hierarchical Based clustering Lecture 22 Based on Slides of Dr. Ikle & chapter 8 of Tan, Steinbach, Kumar.
Text Clustering.
Clustering Supervised vs. Unsupervised Learning Examples of clustering in Web IR Characteristics of clustering Clustering algorithms Cluster Labeling 1.
Introduction to Information Retrieval Introduction to Information Retrieval CS276: Information Retrieval and Web Search Pandu Nayak and Prabhakar Raghavan.
ITCS 6265 Information Retrieval & Web Mining Lecture 15 Clustering.
Basic Machine Learning: Clustering CS 315 – Web Search and Data Mining 1.
Introduction to Information Retrieval Introduction to Information Retrieval Modified from Stanford CS276 slides Chap. 16: Clustering.
Clustering Paolo Ferragina Dipartimento di Informatica Università di Pisa This is a mix of slides taken from several presentations, plus my touch !
CSE5334 DATA MINING CSE4334/5334 Data Mining, Fall 2014 Department of Computer Science and Engineering, University of Texas at Arlington Chengkai Li (Slides.
Information Retrieval Lecture 6 Introduction to Information Retrieval (Manning et al. 2007) Chapter 16 For the MSc Computer Science Programme Dell Zhang.
Information Retrieval and Organisation Chapter 16 Flat Clustering Dell Zhang Birkbeck, University of London.
Clustering. What is Clustering? Clustering: the process of grouping a set of objects into classes of similar objects –Documents within a cluster should.
Hierarchical Clustering Produces a set of nested clusters organized as a hierarchical tree Can be visualized as a dendrogram – A tree like diagram that.
CSCI 5417 Information Retrieval Systems Jim Martin Lecture 15 10/13/2011.
Clustering (Modified from Stanford CS276 Slides - Lecture 17 Clustering)
Today’s Topic: Clustering  Document clustering Motivations Document representations Success criteria  Clustering algorithms Partitional Hierarchical.
Data Mining Cluster Analysis: Basic Concepts and Algorithms Lecture Notes for Chapter 8 Introduction to Data Mining by Tan, Steinbach, Kumar © Tan,Steinbach,
Lecture 12: Clustering May 5, Clustering (Ch 16 and 17)  Document clustering  Motivations  Document representations  Success criteria  Clustering.
Information Retrieval and Organisation Chapter 17 Hierarchical Clustering Dell Zhang Birkbeck, University of London.
Basic Machine Learning: Clustering CS 315 – Web Search and Data Mining 1.
1 Machine Learning Lecture 9: Clustering Moshe Koppel Slides adapted from Raymond J. Mooney.
© Tan,Steinbach, Kumar Introduction to Data Mining 4/18/ Data Mining: Cluster Analysis This lecture node is modified based on Lecture Notes for Chapter.
Introduction to Information Retrieval Introduction to Information Retrieval Clustering Chris Manning, Pandu Nayak, and Prabhakar Raghavan.
Introduction to Information Retrieval Introduction to Information Retrieval CS276: Information Retrieval and Web Search Christopher Manning and Prabhakar.
Introduction to Information Retrieval Introduction to Information Retrieval CS276: Information Retrieval and Web Search Christopher Manning and Prabhakar.
Hierarchical Clustering & Topic Models
Data Mining: Basic Cluster Analysis
Unsupervised Learning: Clustering
Sampath Jayarathna Cal Poly Pomona
Hierarchical Clustering
Unsupervised Learning: Clustering
Clustering CSC 600: Data Mining Class 21.
Machine Learning Lecture 9: Clustering
Data Mining K-means Algorithm
Hierarchical Clustering
Cluster Analysis: Basic Concepts and Algorithms
CSE 5243 Intro. to Data Mining
Information Organization: Clustering
本投影片修改自Introduction to Information Retrieval一書之投影片 Ch 16 & 17
CS 391L: Machine Learning Clustering
Text Categorization Berlin Chen 2003 Reference:
SEEM4630 Tutorial 3 – Clustering.
Hierarchical Clustering
INFORMATION RETRIEVAL TECHNIQUES BY DR. ADNAN ABID
Data Mining Cluster Analysis: Basic Concepts and Algorithms
Presentation transcript:

Prof. Paolo Ferragina, Algoritmi per "Information Retrieval" Clustering Paolo Ferragina Dipartimento di Informatica Università di Pisa Chap 16 and 17

Objectives of 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 Competing objectives Intra-cluster distances are minimized Inter-cluster distances are maximized The commonest form of unsupervised learning

Google News: automatic clustering gives an effective news presentation metaphor

For improving search recall Sec. 16.1 Cluster hypothesis - Documents in the same cluster behave similarly with respect to relevance to information needs Therefore, to improve search recall: Cluster docs in corpus a priori When a query matches a doc D, also return other docs in the cluster containing D Hope if we do this: The query “car” will also return docs containing automobile But also for speeding up the search operation

For better visualization/navigation of search results Sec. 16.1 For better visualization/navigation of search results

Issues for clustering Representation for clustering How many clusters? Sec. 16.2 Representation for clustering Document representation Vector space? Normalization? Need a notion of similarity/distance How many clusters? Fixed a priori? Completely data driven?

Notion of similarity/distance Ideal: semantic similarity Practical: term-statistical similarity Docs as vectors We will use cosine similarity. For many algorithms, easier to think in terms of a distance (rather than similarity) between docs.

Clustering Algorithms Flat algorithms Create a set of clusters Usually start with a random (partial) partitioning Refine it iteratively K means clustering Hierarchical algorithms Create a hierarchy of clusters (dendogram) Bottom-up, agglomerative Top-down, divisive

Hard vs. soft clustering Hard clustering: Each document belongs to exactly one cluster More common and easier to do Soft clustering: Each document can belong to more than one cluster. Makes more sense for applications like creating browsable hierarchies News is a proper example Search results is another example

Flat & Partitioning Algorithms Given: a set of n documents and the number K Find: a partition in K clusters that optimizes the chosen partitioning criterion Globally optimal Intractable for many objective functions Ergo, exhaustively enumerate all partitions Locally optimal Effective heuristic methods: K-means and K-medoids algorithms

K-Means Assumes documents are real-valued vectors. Sec. 16.4 Assumes documents are real-valued vectors. Clusters based on centroids (aka the center of gravity or mean) of points in a cluster, c: Reassignment of instances to clusters is based on distance to the current cluster centroids.

K-Means Algorithm Select K random docs {s1, s2,… sK} as seeds. Sec. 16.4 Select K random docs {s1, s2,… sK} as seeds. Until clustering converges (or other stopping criterion): For each doc di: Assign di to the cluster cr such that dist(di, sr) is minimal. For each cluster cj sj = (cj)

K Means Example (K=2) Pick seeds Reassign clusters Compute centroids Sec. 16.4 Pick seeds Reassign clusters Compute centroids x Reassign clusters x Compute centroids Reassign clusters Converged!

Termination conditions Sec. 16.4 Several possibilities: A fixed number of iterations. Doc partition unchanged. Centroid positions don’t change.

Convergence Why should the K-means algorithm ever reach a fixed point? Sec. 16.4 Why should the K-means algorithm ever reach a fixed point? K-means is a special case of a general procedure known as the Expectation Maximization (EM) algorithm EM is known to converge Number of iterations could be large But in practice usually isn’t

Convergence of K-Means Sec. 16.4 Define goodness measure of cluster c as sum of squared distances from cluster centroid: G(c,s) = Σj in c (dj – sc)2 (sum over all di in cluster c) G(C,s) = Σc G(c,s) Reassignment monotonically decreases G It is a coordinate descent algorithm (optimize one component at a time) At any step we have some value for G(C,s) 1) Fix s, optimize C  assign doc to the closest centroid  G(C’,s) < G(C,s) 2) Fix C’, optimize s  take the new centroids  G(C’,s’) < G(C’,s) < G(C,s) The new cost is smaller than the original one  local minimum

Time Complexity The centroids are K Sec. 16.4 The centroids are K Each doc/centroid consists of M dimensions Computing distance btw vectors is O(M) time. Reassigning clusters: Each doc compared with all centroids, O(N x K x M) time. Computing centroids: Each doc gets added once to some centroid, O(NM) time. Assume these two steps are each done once for I iterations: O(IKNM).

Seed Choice Results can vary based on random seed selection. Sec. 16.4 Results can vary based on random seed selection. Some seeds can result in poor convergence rate, or convergence to sub-optimal clusterings. Select good seeds using a heuristic doc least similar to any existing centroid According to a probability distribution that depends inversely-proportional on the distance from the other current centroids Example showing sensitivity to seeds In the above, if you start with B and E as centroids you converge to {A,B,C} and {D,E,F} If you start with D and F you converge to {A,B,D,E} {C,F}

How Many Clusters? Number of clusters K is given Partition n docs into predetermined number of clusters Finding the “right” number of clusters is part of the problem Can usually take an algorithm for one flavor and convert to the other.

Bisecting K-means Variant of K-means that can produce a partitional or a hierarchical clustering SSE = G(C,s) is called Sum of Squared Error

Bisecting K-means Example

K-means Pros Simple Fast for low dimensional data It can find pure sub-clusters if large number of clusters is specified (but, over-partitioning) Cons K-Means cannot handle non-globular data of different sizes and densities K-Means will not identify outliers K-Means is restricted to data which has the notion of a center (centroid)

Hierarchical Clustering Build a tree-based hierarchical taxonomy (dendrogram) from a set of documents Possibility: recursive application of a partitional clustering algorithm animal vertebrate fish reptile amphib. mammal worm insect crustacean invertebrate

Strengths of Hierarchical Clustering No assumption of any particular number of clusters Any desired number of clusters can be obtained by ‘cutting’ the dendogram at the proper level They may correspond to meaningful taxonomies Example in biological sciences (e.g., animal kingdom, phylogeny reconstruction, …)

Hierarchical Agglomerative Clustering (HAC) Sec. 17.1 Starts with each doc in a separate cluster Then repeatedly join the most similar pair of clusters, until there is only one cluster. Keep attention: The computation at every step is the MIN of the SIM computed among all pairs of clusters The history of merging forms a binary tree or hierarchy.

Similarity of pair of clusters Sec. 17.2 Similarity of pair of clusters Single-link Similarity of the closest points Complete-link Similarity of the farthest points Centroid Similarity among centroids Average-link Similarity = Average distance between all pairs of items Keep attention: The computation at every step is the MIN of the SIM computed among all pairs of clusters

How to Define Inter-Cluster Similarity p1 p3 p5 p4 p2 . . . . Similarity? Single link (MIN) Complete link (MAX) Centroids Average Proximity Matrix Keep attention: The computation at every step is the MIN of the SIM computed among all pairs of clusters

How to Define Inter-Cluster Similarity p1 p3 p5 p4 p2 . . . . MIN MAX Centroids Average Proximity Matrix Keep attention: The computation at every step is the MIN of the SIM computed among all pairs of clusters

How to Define Inter-Cluster Similarity p1 p3 p5 p4 p2 . . . . MIN MAX Centroids Average Proximity Matrix Keep attention: The computation at every step is the MIN of the SIM computed among all pairs of clusters

How to define Inter-Cluster Similarity p1 p3 p5 p4 p2 . . . .   MIN MAX Centroids Average Proximity Matrix Keep attention: The computation at every step is the MIN of the SIM computed among all pairs of clusters

How to Define Inter-Cluster Similarity p1 p3 p5 p4 p2 . . . . MIN MAX Centroids Average Proximity Matrix Keep attention: The computation at every step is the MIN of the SIM computed among all pairs of clusters

Starting Situation Start with clusters of individual points and a proximity matrix p1 p3 p5 p4 p2 . . . . Proximity Matrix

Intermediate Situation After some merging steps, we have some clusters C2 C1 C3 C5 C4 C3 C4 C1 Proximity Matrix C1 C3 C2 C5 C4 C5 C2

Intermediate Situation We want to merge the two closest clusters (C2 and C5) and update the proximity matrix. C2 C1 C3 C5 C4 C3 C4 C1 Proximity Matrix C1 C3 C2 U C5 C4 C5 C2

After Merging The question is “How do we update the proximity matrix?” C2 U C5 C1 C3 C4 C1 ? C3 ? ? ? ? C2 U C5 C4 C3 ? ? C4 C1 Proximity Matrix C1 C3 C2 U C5 C4 C2 U C5

Cluster Similarity: MIN or Single Link Similarity of two clusters is based on the two most similar (closest) points in the different clusters Determined by one pair of points, i.e., by one link in the proximity graph. ? 1 2 3 4 5

Strength of MIN Two Clusters Original Points Can handle non-elliptical shapes

Limitations of MIN Two Clusters Original Points Sensitive to noise and outliers

Cluster Similarity: MAX or Complete Linkage Similarity of two clusters is based on the two least similar (most distant) points in the different clusters Determined by all pairs of points in the two clusters ? 1 2 3 4 5

Strength of MAX Two Clusters Original Points Less susceptible to noise and outliers

Limitations of MAX Original Points Two Clusters Tends to break large clusters Biased towards globular clusters

Cluster Similarity: Average Proximity of two clusters is the average of pairwise proximity between points in the two clusters. ? 1 2 3 4 5

Hierarchical Clustering: Comparison 5 5 1 2 3 4 5 6 4 1 2 3 4 5 6 4 3 2 2 1 MAX MIN 3 1 5 1 2 3 4 5 6 4 2 3 1 Average

How to evaluate clustering quality ? Sec. 16.3 Assesses a clustering with respect to ground truth … requires labeled data Produce the gold standard is costly !!