- •List of Tables
- •List of Figures
- •Table of Notation
- •Preface
- •Boolean retrieval
- •An example information retrieval problem
- •Processing Boolean queries
- •The extended Boolean model versus ranked retrieval
- •References and further reading
- •The term vocabulary and postings lists
- •Document delineation and character sequence decoding
- •Obtaining the character sequence in a document
- •Choosing a document unit
- •Determining the vocabulary of terms
- •Tokenization
- •Dropping common terms: stop words
- •Normalization (equivalence classing of terms)
- •Stemming and lemmatization
- •Faster postings list intersection via skip pointers
- •Positional postings and phrase queries
- •Biword indexes
- •Positional indexes
- •Combination schemes
- •References and further reading
- •Dictionaries and tolerant retrieval
- •Search structures for dictionaries
- •Wildcard queries
- •General wildcard queries
- •Spelling correction
- •Implementing spelling correction
- •Forms of spelling correction
- •Edit distance
- •Context sensitive spelling correction
- •Phonetic correction
- •References and further reading
- •Index construction
- •Hardware basics
- •Blocked sort-based indexing
- •Single-pass in-memory indexing
- •Distributed indexing
- •Dynamic indexing
- •Other types of indexes
- •References and further reading
- •Index compression
- •Statistical properties of terms in information retrieval
- •Dictionary compression
- •Dictionary as a string
- •Blocked storage
- •Variable byte codes
- •References and further reading
- •Scoring, term weighting and the vector space model
- •Parametric and zone indexes
- •Weighted zone scoring
- •Learning weights
- •The optimal weight g
- •Term frequency and weighting
- •Inverse document frequency
- •The vector space model for scoring
- •Dot products
- •Queries as vectors
- •Computing vector scores
- •Sublinear tf scaling
- •Maximum tf normalization
- •Document and query weighting schemes
- •Pivoted normalized document length
- •References and further reading
- •Computing scores in a complete search system
- •Index elimination
- •Champion lists
- •Static quality scores and ordering
- •Impact ordering
- •Cluster pruning
- •Components of an information retrieval system
- •Tiered indexes
- •Designing parsing and scoring functions
- •Putting it all together
- •Vector space scoring and query operator interaction
- •References and further reading
- •Evaluation in information retrieval
- •Information retrieval system evaluation
- •Standard test collections
- •Evaluation of unranked retrieval sets
- •Evaluation of ranked retrieval results
- •Assessing relevance
- •A broader perspective: System quality and user utility
- •System issues
- •User utility
- •Results snippets
- •References and further reading
- •Relevance feedback and query expansion
- •Relevance feedback and pseudo relevance feedback
- •The Rocchio algorithm for relevance feedback
- •Probabilistic relevance feedback
- •When does relevance feedback work?
- •Relevance feedback on the web
- •Evaluation of relevance feedback strategies
- •Pseudo relevance feedback
- •Indirect relevance feedback
- •Summary
- •Global methods for query reformulation
- •Vocabulary tools for query reformulation
- •Query expansion
- •Automatic thesaurus generation
- •References and further reading
- •XML retrieval
- •Basic XML concepts
- •Challenges in XML retrieval
- •A vector space model for XML retrieval
- •Evaluation of XML retrieval
- •References and further reading
- •Exercises
- •Probabilistic information retrieval
- •Review of basic probability theory
- •The Probability Ranking Principle
- •The 1/0 loss case
- •The PRP with retrieval costs
- •The Binary Independence Model
- •Deriving a ranking function for query terms
- •Probability estimates in theory
- •Probability estimates in practice
- •Probabilistic approaches to relevance feedback
- •An appraisal and some extensions
- •An appraisal of probabilistic models
- •Bayesian network approaches to IR
- •References and further reading
- •Language models for information retrieval
- •Language models
- •Finite automata and language models
- •Types of language models
- •Multinomial distributions over words
- •The query likelihood model
- •Using query likelihood language models in IR
- •Estimating the query generation probability
- •Language modeling versus other approaches in IR
- •Extended language modeling approaches
- •References and further reading
- •Relation to multinomial unigram language model
- •The Bernoulli model
- •Properties of Naive Bayes
- •A variant of the multinomial model
- •Feature selection
- •Mutual information
- •Comparison of feature selection methods
- •References and further reading
- •Document representations and measures of relatedness in vector spaces
- •k nearest neighbor
- •Time complexity and optimality of kNN
- •The bias-variance tradeoff
- •References and further reading
- •Exercises
- •Support vector machines and machine learning on documents
- •Support vector machines: The linearly separable case
- •Extensions to the SVM model
- •Multiclass SVMs
- •Nonlinear SVMs
- •Experimental results
- •Machine learning methods in ad hoc information retrieval
- •Result ranking by machine learning
- •References and further reading
- •Flat clustering
- •Clustering in information retrieval
- •Problem statement
- •Evaluation of clustering
- •Cluster cardinality in K-means
- •Model-based clustering
- •References and further reading
- •Exercises
- •Hierarchical clustering
- •Hierarchical agglomerative clustering
- •Time complexity of HAC
- •Group-average agglomerative clustering
- •Centroid clustering
- •Optimality of HAC
- •Divisive clustering
- •Cluster labeling
- •Implementation notes
- •References and further reading
- •Exercises
- •Matrix decompositions and latent semantic indexing
- •Linear algebra review
- •Matrix decompositions
- •Term-document matrices and singular value decompositions
- •Low-rank approximations
- •Latent semantic indexing
- •References and further reading
- •Web search basics
- •Background and history
- •Web characteristics
- •The web graph
- •Spam
- •Advertising as the economic model
- •The search user experience
- •User query needs
- •Index size and estimation
- •Near-duplicates and shingling
- •References and further reading
- •Web crawling and indexes
- •Overview
- •Crawling
- •Crawler architecture
- •DNS resolution
- •The URL frontier
- •Distributing indexes
- •Connectivity servers
- •References and further reading
- •Link analysis
- •The Web as a graph
- •Anchor text and the web graph
- •PageRank
- •Markov chains
- •The PageRank computation
- •Hubs and Authorities
- •Choosing the subset of the Web
- •References and further reading
- •Bibliography
- •Author Index
388 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 Hierarchical clustering |
|
|
|
d1 |
|
|
|
d2 |
|
|
|
|
|
|
d3 |
|
|
|
|
|
|
|
|
|
d4 |
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||
1 |
|
|
× |
|
|
|
× |
|
|
|
|
|
|
× |
|
|
|
|
|
|
|
|
|
× |
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
|
BEST-MERGE
PERSISTENCE
Figure 17.10 Complete-link clustering is not best-merge persistent. At first, d2 is the best-merge cluster for d3. But after merging d1 and d2, d4 becomes d3’s best-merge candidate. In a best-merge persistent algorithm like single-link, d3’s best-merge cluster would be {d1, d2}.
Can we also speed up the other three HAC algorithms with an NBM array? We cannot because only single-link clustering is best-merge persistent. Suppose that the best merge cluster for ωk is ωj in single-link clustering. Then after merging ωj with a third cluster ωi 6= ωk, the merge of ωi and ωj will be ωk’s best merge cluster (Exercise 17.6). In other words, the best-merge candidate for the merged cluster is one of the two best-merge candidates of its components in single-link clustering. This means that C can be updated in Θ(N) in each iteration – by taking a simple max of two values on line 14 in Figure 17.9 for each of the remaining ≤ N clusters.
Figure 17.10 demonstrates that best-merge persistence does not hold for complete-link clustering, which means that we cannot use an NBM array to speed up clustering. After merging d3’s best merge candidate d2 with cluster d1, an unrelated cluster d4 becomes the best merge candidate for d3. This is because the complete-link merge criterion is non-local and can be affected by points at a great distance from the area where two merge candidates meet.
In practice, the efficiency penalty of the Θ(N2 log N) algorithm is small compared with the Θ(N2) single-link algorithm since computing the similarity between two documents (e.g., as a dot product) is an order of magnitude slower than comparing two scalars in sorting. All four HAC algorithms in this chapter are Θ(N2) with respect to similarity computations. So the difference in complexity is rarely a concern in practice when choosing one of the algorithms.
?Exercise 17.1
Show that complete-link clustering creates the two-cluster clustering depicted in Figure 17.7.
17.3Group-average agglomerative clustering
GROUP-AVERAGE AGGLOMERATIVE CLUSTERING
Group-average agglomerative clustering or GAAC (see Figure 17.3, (d)) evaluates cluster quality based on all similarities between documents, thus avoiding the pitfalls of the single-link and complete-link criteria, which equate cluster
Online edition (c) 2009 Cambridge UP
(17.1)
(17.2)
(17.3)
17.3 Group-average agglomerative clustering |
389 |
similarity with the similarity of a single pair of documents. GAAC is also called group-average clustering and average-link clustering. GAAC computes the average similarity SIM-GA of all pairs of documents, including pairs from the same cluster. But self-similarities are not included in the average:
SIM-GA(ωi, ωj) = |
|
1 |
|
|
|
∑ |
|
|
|
|
∑ |
~ ~ |
||||
(N + N )(N + N |
j − |
1) |
|
|
|
|
|
dm · dn |
||||||||
|
|
i |
j i |
|
dm |
|
ωi |
|
ωj |
dn |
ωi |
|
|
6 |
||
|
|
|
|
|
|
|
ωj,dn =dm |
|||||||||
~ |
is the length-normalized vector of document d, · |
denotes the dot |
||||||||||||||
where d |
product, and Ni and Nj are the number of documents in ωi and ωj, respectively.
The motivation for GAAC is that our goal in selecting two clusters ωi and ωj as the next merge in HAC is that the resulting merge cluster ωk = ωi ωj should be coherent. To judge the coherence of ωk, we need to look at all document-document similarities within ωk, including those that occur within ωi and those that occur within ωj.
We can compute the measure SIM-GA efficiently because the sum of individual vector similarities is equal to the similarities of their sums:
∑ ∑ |
~ |
~ |
|
|
~ |
|
~ |
|
|
|
|
(dm · dn) = ( |
∑ dm) · ( ∑ dn) |
|
|
||||||||
dm ωi dn ωj |
|
|
|
dm ωi |
|
dn ωj |
|
|
|
||
With (17.2), we have: |
|
|
|
|
|
|
|
|
|
|
|
SIM-GA(ωi, ωj) = |
|
|
|
1 |
|
|
|
[( ∑ |
~ |
2 |
|
(N + N |
)(N + N |
j − |
1) |
dm) |
|
− (Ni + Nj)] |
|||||
|
|
i |
j |
i |
|
|
dm ωi ωj |
|
|
|
The term (Ni + Nj) on the right is the sum of Ni + Nj self-similarities of value 1.0. With this trick we can compute cluster similarity in constant time (as-
~ |
~ |
suming we have available the two vector sums ∑dm ωi dm and ∑dm ωj |
dm) |
instead of in Θ(Ni Nj). This is important because we need to be able to compute the function SIM on lines 18 and 20 in EFFICIENTHAC (Figure 17.8) in constant time for efficient implementations of GAAC. Note that for two singleton clusters, Equation (17.3) is equivalent to the dot product.
Equation (17.2) relies on the distributivity of the dot product with respect to vector addition. Since this is crucial for the efficient computation of a GAAC clustering, the method cannot be easily applied to representations of documents that are not real-valued vectors. Also, Equation (17.2) only holds for the dot product. While many algorithms introduced in this book have near-equivalent descriptions in terms of dot product, cosine similarity and Euclidean distance (cf. Section 14.1, page 291), Equation (17.2) can only be expressed using the dot product. This is a fundamental difference between single-link/complete-link clustering and GAAC. The first two only require a
Online edition (c) 2009 Cambridge UP
390 |
17 Hierarchical clustering |
square matrix of similarities as input and do not care how these similarities were computed.
To summarize, GAAC requires (i) documents represented as vectors, (ii) length normalization of vectors, so that self-similarities are 1.0, and (iii) the dot product as the measure of similarity between vectors and sums of vectors.
The merge algorithms for GAAC and complete-link clustering are the same except that we use Equation (17.3) as similarity function in Figure 17.8. Therefore, the overall time complexity of GAAC is the same as for complete-link clustering: Θ(N2 log N). Like complete-link clustering, GAAC is not bestmerge persistent (Exercise 17.6). This means that there is no Θ(N2) algorithm for GAAC that would be analogous to the Θ(N2) algorithm for single-link in Figure 17.9.
We can also define group-average similarity as including self-similarities:
|
1 |
|
|
|
~ |
1 |
|
|
~ |
|
(17.4)SIM-GA′(ωi, ωj) = |
(N +N |
)2 |
( |
∑ |
dm)2 |
= |
N +N |
|
∑ |
[dm ·~µ(ωi ωj)] |
|
i j |
|
|
dm ωi ωj |
|
|
i |
j dm ωi ωj |
where the centroid ~µ(ω) is defined as in Equation (14.1) (page 292). This definition is equivalent to the intuitive definition of cluster quality as average
similarity of documents ~ to the cluster’s centroid . dm ~µ
Self-similarities are always equal to 1.0, the maximum possible value for length-normalized vectors. The proportion of self-similarities in Equation (17.4) is i/i2 = 1/i for a cluster of size i. This gives an unfair advantage to small clusters since they will have proportionally more self-similarities. For two documents d1, d2 with a similarity s, we have SIM-GA′(d1, d2) = (1 + s)/2. In contrast, SIM-GA(d1, d2) = s ≤ (1 + s)/2. This similarity SIM-GA(d1, d2) of two documents is the same as in single-link, complete-link and centroid clustering. We prefer the definition in Equation (17.3), which excludes selfsimilarities from the average, because we do not want to penalize large clusters for their smaller proportion of self-similarities and because we want a consistent similarity value s for document pairs in all four HAC algorithms.
?Exercise 17.2
Apply group-average clustering to the points in Figures 17.6 and 17.7. Map them onto the surface of the unit sphere in a three-dimensional space to get length-normalized vectors. Is the group-average clustering different from the single-link and completelink clusterings?
Online edition (c) 2009 Cambridge UP
17.4 Centroid clustering |
391 |
5 |
|
× d1 |
× d3 |
|
4c µ2
3 |
|
|
× |
d2 |
|
|
|
|
|
|
|
|
|
|
|
|
× d4 |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
µ3 c |
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
d5 |
× |
c × |
|
|
d6 |
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
µ1 |
|
|
|
|
|
|
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
|
Figure 17.11 Three iterations of centroid clustering. Each iteration merges the two clusters whose centroids are closest.
17.4Centroid clustering
In centroid clustering, the similarity of two clusters is defined as the similarity of their centroids:
(17.5) |
SIM-CENT(ωi, ωj) = |
~µ(ωi) ·~µ(ωj) |
|
||||||
|
|
1 |
|
~ |
1 |
~ |
|||
|
= ( |
Ni |
|
∑ dm) · ( |
Nj |
∑ dn) |
|||
|
|
1 |
dm ωi |
|
|
dn ωj |
|||
(17.6) |
|
|
|
~ |
~ |
||||
= |
|
Ni Nj |
∑ |
∑ dm · dn |
|||||
|
|
|
|
|
|
dm ωi dn ωj |
|
Equation (17.5) is centroid similarity. Equation (17.6) shows that centroid similarity is equivalent to average similarity of all pairs of documents from different clusters. Thus, the difference between GAAC and centroid clustering is that GAAC considers all pairs of documents in computing average pairwise similarity (Figure 17.3, (d)) whereas centroid clustering excludes pairs from the same cluster (Figure 17.3, (c)).
Figure 17.11 shows the first three steps of a centroid clustering. The first two iterations form the clusters {d5, d6} with centroid µ1 and {d1, d2} with centroid µ2 because the pairs hd5, d6i and hd1, d2i have the highest centroid similarities. In the third iteration, the highest centroid similarity is between µ1 and d4 producing the cluster {d4, d5, d6} with centroid µ3.
Like GAAC, centroid clustering is not best-merge persistent and therefore Θ(N2 log N) (Exercise 17.6).
In contrast to the other three HAC algorithms, centroid clustering is not INVERSION monotonic. So-called inversions can occur: Similarity can increase during
Online edition (c) 2009 Cambridge UP
392 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
Hierarchical clustering |
||||||||
5 |
|
|
|
|
|
|
|
|
d3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
× |
|
|
|
|
|
|
|
−4 |
|
|
|
|
||||
4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
−3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
−2 |
|
|
|
|
|
|||||
|
|
d1 |
|
|
|
|
|
|
|
|
|
d2 |
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
1 |
|
|
× |
|
|
|
|
c |
|
|
|
× |
|
−1 |
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
0 |
1 |
2 |
3 |
4 |
5 |
|
d1 |
d2 |
d3 |
|||||||||||||||
|
|
|
|
|
|
|
Centroid clustering is not monotonic. The documents d1 at (1 + ǫ, 1), d2 at (5, 1), and d3 at (3, 1 + 2√3) are almost equidistant, with d1 and d2 closer to each other than to d3. The non-monotonic inversion in the hierarchical clustering of the three points appears as an intersecting merge line in the dendrogram. The intersection is circled.
clustering as in the example in Figure 17.12, where we define similarity as negative distance. In the first merge, the similarity of d1 and d2 is −(4 − ǫ). In
the second merge, the similarity of the centroid of d1 and d2 (the circle) and d3 is ≈ − cos(π/6) × 4 = −√3/2 × 4 ≈ −3.46 > −(4 − ǫ). This is an example
of an inversion: similarity increases in this sequence of two clustering steps. In a monotonic HAC algorithm, similarity is monotonically decreasing from iteration to iteration.
Increasing similarity in a series of HAC clustering steps contradicts the fundamental assumption that small clusters are more coherent than large clusters. An inversion in a dendrogram shows up as a horizontal merge line that is lower than the previous merge line. All merge lines in Figures 17.1 and 17.5 are higher than their predecessors because single-link and completelink clustering are monotonic clustering algorithms.
Despite its non-monotonicity, centroid clustering is often used because its similarity measure – the similarity of two centroids – is conceptually simpler than the average of all pairwise similarities in GAAC. Figure 17.11 is all one needs to understand centroid clustering. There is no equally simple graph that would explain how GAAC works.
?Exercise 17.3
For a fixed set of N documents there are up to N2 distinct similarities between clusters in single-link and complete-link clustering. How many distinct cluster similarities are there in GAAC and centroid clustering?
Online edition (c) 2009 Cambridge UP