AI Wiki中文/EN

HDBSCAN: from density hierarchy to stable clusters

HDBSCAN

Compute mutual reachability, tied hierarchy events, condensation and exact stability-based cluster selection.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

A cluster need not survive at the same distance as its neighbor

A maintenance cart records seven stopping positions along a corridor: 0, 1, 2, 10, 12, 14 and 30 metres. The first three stops form a tight group; the next three are more spread out. The last stop is far away. One distance threshold can sometimes recover this pattern, but choosing it becomes awkward when dense groups have internal gaps and sparse groups sit near other points.

HDBSCAN builds a hierarchy across distance scales, simplifies it, then chooses nonoverlapping branches using a persistence score. The selected branches can occupy different ranges of scales. It still depends on the distance representation and parameters; it does not discover an objectively correct taxonomy. Campello, Moulavi and Sander introduced the hierarchy and stability selection in their 2013 paper.

Two controls answer different questions. min_samples determines the neighborhood used to assess local crowding. min_cluster_size determines which branches are large enough to count as clusters. Increasing one does not substitute for increasing the other. We will keep them explicit and watch each decision in an exact, one-dimensional calculation.

From local crowding to a choice of branches

For distinct points, let the core distance be the distance to the m-th nearest sample, including the point itself. With m = 1 it is zero; with m = 2 it is the distance to the nearest other point. For different points, mutual reachability raises a short geometric distance whenever either endpoint has a large core distance:

cm(i)=order⁡m{∣xi−xj∣:j=1,…,n},wij=max⁡{cm(i),cm(j),∣xi−xj∣}(i≠j).c_m(i)=\operatorname{order}_m\{\lvert x_i-x_j\rvert:j=1,\ldots,n\},\qquad w_{ij}=\max\{c_m(i),c_m(j),\lvert x_i-x_j\rvert\}\quad(i\ne j).

A point with a large core distance cannot form a link cheaper than that core distance. Whether the core distance is large depends on the neighborhood count; with m = 1 this adjustment disappears. This changes the edge weights; it does not delete the original coordinates. Our graph has no self edges. The self-inclusive convention matches scikit-learn 1.7.2. Its documentation explicitly distinguishes the contrib hdbscan package, whose min_samples excludes the point itself. Compare neighborhood counts before transferring a parameter value between implementations.

Keep all threshold connections in one tree

Imagine the complete graph with these edge weights. At a distance threshold, connect points using edges no heavier than that threshold. The connected components form a single-linkage hierarchy. A minimum spanning tree, or MST, preserves every such partition. In fact, for two distinct vertices:

max⁡e∈path⁡MST(i,j)we=min⁡π:i⇝jmax⁡e∈πwe.\max_{e\in\operatorname{path}_{\mathrm{MST}}(i,j)}w_e =\min_{\pi:i\leadsto j}\max_{e\in\pi}w_e.

To see why, remove the heaviest edge on the tree path. Any alternative path crosses the resulting cut. If every crossing edge on an alternative path were lighter, one could replace the removed edge and obtain a lighter spanning tree, contradicting minimality. The tree path itself provides the other inequality. This argument also works when weights tie.

Our code traverses the hierarchy in the opposite direction: start with all points together, then remove all edges of the current largest weight. The recorded partition is immediately after removal, so it retains edges strictly lighter than that weight. A single tied event can have three or more children. Processing those edges as separate positive-duration splits would make the hierarchy depend on arbitrary edge order. The MST approach and its acceleration are developed in McInnes and Healy’s original paper, sections 2.2 and 3.

The connection to density clustering uses DBSCAN*, which omits ordinary DBSCAN’s border-point assignment. It is not an instruction to combine outputs of ordinary DBSCAN at several radii. Isolated vertices remain visible in our graph partitions, but never become accepted clusters because min_cluster_size is at least two.

Condense without inventing a new cluster at every loss

Now increase inverse distance, lambda = 1 / distance. At a split, inspect the resulting components. If at least two meet the minimum cluster size, the parent ends and those components become new clusters. If exactly one meets it, that component continues the parent’s identity; only the smaller pieces fall out. If none meets it, the parent ends without children. These rules distinguish losing a few points from breaking into separate groups.

For each condensed cluster, retain its members at birth and the inverse distance at which each member leaves that cluster. Leaving can mean individual fallout or transfer to a child at a genuine split. Its stability is:

S(C)=∑i∈Cbirth(λi,Cexit−λCbirth)=∫λCbirth∞nC(λ) dλ.S(C)=\sum_{i\in C_{\mathrm{birth}}}\bigl(\lambda_{i,C}^{\mathrm{exit}}-\lambda_C^{\mathrm{birth}}\bigr) =\int_{\lambda_C^{\mathrm{birth}}}^{\infty}n_C(\lambda)\,d\lambda.

Here the count is zero after the cluster ends. A big branch that disappears quickly can score below a smaller branch that persists. This is an inverse-distance persistence score, not a probability that the cluster is correct, nor a calibrated probability density. The project’s algorithm guide illustrates condensation and this per-point accounting.

Choose a parent or its descendants

Selected clusters must not overlap. Condensed branches are nested or disjoint, so one may choose a cluster or a collection of its descendants, never both. Let the best score within a branch be:

B(C)=max⁡{S(C), ∑D∈children⁡(C)B(D)}.B(C)=\max\left\{S(C),\ \sum_{D\in\operatorname{children}(C)}B(D)\right\}.

This recurrence is exact: once the parent is excluded, its child branches share no points, so their best choices add independently. Induction from the leaves proves optimality for this tree and score. It says nothing about every possible clustering of the coordinates. We choose the parent on a score tie, and exclude the artificial root. The selected score is the sum of the best choices beneath that root. Root exclusion follows the usual allow_single_cluster=False setting; a tree with no qualifying split yields all noise.

Inspect every stop’s contribution

The following standard-library program implements the complete teaching pipeline: core distances, mutual-reachability edges, Kruskal’s MST, simultaneous tied cuts, condensation, stability and EOM selection. It accepts 2–20 distinct integer or Fraction coordinates; floats, booleans, duplicates and invalid parameter ranges are rejected. Both parameters are explicit integers. There is no rescaling parameter, alternate selection method, root selection, membership probability or new-point prediction.

Cluster IDs are assigned as branches are born. Final numeric labels follow the smallest original row index in each selected branch, so labels can be renamed after a row permutation. A selected non-root cluster assigns its birth members to that label, including points that later fell out while its identity persisted. A point that left before any selected cluster was born stays noise. Inspect exits to distinguish those cases.

from fractions import Fraction as F


def hdbscan_1d(values, min_samples=2, min_cluster_size=2):
    """Exact small HDBSCAN* pipeline; self-inclusive neighbors, no root selection."""
    if not isinstance(values, (list, tuple)) or not 2 <= len(values) <= 20:
        raise ValueError('values must contain 2 to 20 distinct rational points')
    if any(type(x) not in (int, F) for x in values):
        raise ValueError('coordinates must be integers or Fractions, not bool/float')
    x = tuple(map(F, values))
    n = len(x)
    if len(set(x)) != n:
        raise ValueError('duplicate coordinates are outside this example')
    if type(min_samples) is not int or not 1 <= min_samples <= n:
        raise ValueError('min_samples must be an integer from 1 to n')
    if type(min_cluster_size) is not int or not 2 <= min_cluster_size <= n:
        raise ValueError('min_cluster_size must be an integer from 2 to n')
    core = tuple(sorted(abs(a - b) for b in x)[min_samples - 1] for a in x)
    edges = sorted((max(core[i], core[j], abs(x[i] - x[j])), i, j)
                   for i in range(n) for j in range(i + 1, n))
    parent = list(range(n))
    rank = [0] * n

    def find(i):
        while parent[i] != i:
            parent[i] = parent[parent[i]]
            i = parent[i]
        return i

    mst = []
    for w, i, j in edges:
        a, b = find(i), find(j)
        if a == b:
            continue
        if rank[a] < rank[b]:
            a, b = b, a
        parent[b] = a
        if rank[a] == rank[b]:
            rank[a] += 1
        mst.append((w, i, j))
        if len(mst) == n - 1:
            break

    def components(cut):
        # Immediately AFTER removing every edge with weight >= cut.
        adjacency = [[] for _ in x]
        for w, i, j in mst:
            if w < cut:
                adjacency[i].append(j)
                adjacency[j].append(i)
        seen, groups = set(), []
        for i in range(n):
            if i in seen:
                continue
            stack, group = [i], []
            seen.add(i)
            while stack:
                v = stack.pop()
                group.append(v)
                for u in adjacency[v]:
                    if u not in seen:
                        seen.add(u)
                        stack.append(u)
            groups.append(tuple(sorted(group)))
        return tuple(groups)

    levels = tuple((w, components(w))
                   for w in sorted({e[0] for e in mst}, reverse=True))
    clusters = []

    def born(members, birth):
        cid = len(clusters)
        clusters.append(dict(members=members, birth=birth, exits=[], children=[]))
        return cid

    born(tuple(range(n)), F(0))
    active = {0: tuple(range(n))}
    for cut, groups in levels:
        lam = 1 / cut
        owner = {i: j for j, g in enumerate(groups) for i in g}
        updated = {}
        for cid, current in active.items():
            parts = [groups[j] for j in sorted({owner[i] for i in current})]
            large = [g for g in parts if len(g) >= min_cluster_size]
            if len(large) == 1:
                survivor = large[0]
                keep = set(survivor)
                clusters[cid]['exits'].extend((i, lam) for i in current if i not in keep)
                updated[cid] = survivor
            else:
                # A real split, or no surviving child: the parent ends.
                clusters[cid]['exits'].extend((i, lam) for i in current)
                for g in large:
                    child = born(g, lam)
                    clusters[cid]['children'].append(child)
                    updated[child] = g
        active = updated
    assert not active
    for c in clusters:
        c['exits'] = tuple(sorted(c['exits']))
        c['children'] = tuple(c['children'])
        assert tuple(i for i, _ in c['exits']) == c['members']
        c['stability'] = sum((lam - c['birth'] for _, lam in c['exits']), F(0))

    def best(cid):
        c = clusters[cid]
        choices = [best(j) for j in c['children']]
        total = sum((score for score, _ in choices), F(0))
        if c['stability'] >= total:
            return c['stability'], (cid,)
        return total, tuple(j for _, ids in choices for j in ids)

    selected = tuple(sorted((j for child in clusters[0]['children']
                             for j in best(child)[1]),
                            key=lambda j: min(clusters[j]['members'])))
    labels = [-1] * n
    for label, cid in enumerate(selected):
        for i in clusters[cid]['members']:
            assert labels[i] == -1
            labels[i] = label
    return dict(points=x, core=core, mst=tuple(mst), levels=levels,
                clusters=tuple(clusters), selected=selected, labels=tuple(labels),
                score=sum((clusters[j]['stability'] for j in selected), F(0)))


if __name__ == '__main__':
    model = hdbscan_1d([0, 1, 2, 10, 12, 14, 30], 2, 3)
    print('core:', ', '.join(map(str, model['core'])))
    print('cut distances:', ', '.join(str(w) for w, _ in model['levels']))
    for cid, c in enumerate(model['clusters']):
        print('cluster', cid, 'members', c['members'], 'birth', c['birth'],
              'stability', c['stability'])
    print('selected:', model['selected'], 'labels:', model['labels'],
          'score:', model['score'])
    print('tied chain:', hdbscan_1d([0, 1, 2, 3], 1, 2)['labels'])
core: 1, 1, 1, 2, 2, 2, 16
cut distances: 16, 8, 2, 1
cluster 0 members (0, 1, 2, 3, 4, 5, 6) birth 0 stability 13/16
cluster 1 members (0, 1, 2) birth 1/8 stability 21/8
cluster 2 members (3, 4, 5) birth 1/8 stability 9/8
selected: (1, 2) labels: (0, 0, 0, 1, 1, 1, -1) score: 15/4
tied chain: (-1, -1, -1, -1)

At distance 16, the stop at 30 falls out, while the other six retain the root’s identity. At distance 8, those six split into two qualifying groups. Both are born at inverse distance 1/8. The first group’s three points leave at 1; the second group’s three points leave at 1/2. Their scores are therefore 21/8 and 9/8, with total 15/4. No single global cut was supplied to the selection step.

BranchBirth members, as row indicesPoint exit levelsStabilitySelected?
0, root0–6row 6 at 1/16; rows 0–5 at 1/813/16No
10, 1, 2all at 121/8Yes
23, 4, 5all at 1/29/8Yes

The equally spaced four-point chain has all three MST edges of weight one. Removing them together leaves four singletons. No non-root cluster reaches size two, so all four labels are −1. This is a useful test for accidentally turning tied distances into artificial branches.

With n points, the complete edge list, stored level partitions and per-cluster point records give the following operation bounds:

T(n)=O(n2log⁡n),M(n)=O(n2),2≤n≤20.T(n)=O(n^2\log n),\qquad M(n)=O(n^2),\qquad 2\le n\le20.

Sorting the complete edge list and each row’s distances costs at most this time. There are at most n − 1 cut levels; each tree traversal is linear, with additional sorting bounded by n log n per level. Condensation processes at most n current point memberships per level. Its small sets contain integer component IDs, not repeatedly hashed whole components. EOM visits every condensed node once, with at most quadratic total copying of returned ID lists. These are unit-cost rational arithmetic bounds; large numerators and denominators increase bit costs. The cap keeps the example inspectable, rather than making an asymptotic claim about a production library.

Stable under which choices?

The distance metric and feature scale define the neighborhood. A corridor coordinate is easy to interpret; a mixture of image embeddings, timestamps and money is not. A stable branch in a poorly chosen geometry can remain a poor grouping. Noise means unassigned by these settings, not a verified fault or anomaly. A small but operationally important group can disappear when its size falls below the threshold.

Changing min_samples changes mutual reachability before the hierarchy is built. Changing only min_cluster_size changes condensation and selection of that fixed hierarchy. EOM may prefer a broad parent over several sharper children; selecting only leaves is a different objective. Review the tree and domain examples when that distinction matters.

This example avoids zero split distances by requiring distinct coordinates and accepted cluster size at least two. In general, repeated points can form a qualifying zero-distance component, leading to infinite inverse distance and potentially infinite stability. One must specify how to represent and compare those values; silently substituting a large constant changes the objective. Our rejection is deliberate. Equal positive distances remain supported and are processed simultaneously, a declared convention that need not match every library’s binary linkage tie behavior.

Translation preserves this example. A common positive scale factor changes the units of all distances and reciprocally changes the scores:

xi′=axi+b,a>0⟹cm′(i)=acm(i),S′(C)=S(C)/a.x_i'=a x_i+b,\quad a>0 \quad\Longrightarrow\quad c_m'(i)=a c_m(i),\quad S'(C)=S(C)/a.

Thus the chosen branches remain the same under a uniform scale change here. Scaling different features differently in a multidimensional problem does not have this guarantee. Neither persistence nor this finite calculation establishes a statistical consistency theorem for arbitrary distributions and parameter choices.

Trace the branch, not just the final label

  1. For positions 0, 2 and 10, compute core distances for self-inclusive min_samples equal to 1, 2 and 3. Which value corresponds to using one other neighbor?

    Answer: The three vectors are (0, 0, 0), (2, 2, 8) and (10, 8, 10). One other neighbor corresponds to self-inclusive value 2. This is why copying min_samples unchanged between conventions is unsafe.

  2. In the corridor example, explain the root’s score 13/16. Why not multiply seven by 1/8?

    Answer: Six points remain until 1/8; the last leaves at 1/16. Their contributions total six times 1/8 plus 1/16, which is 13/16. Multiplying seven by 1/8 would keep counting the isolated stop after it had left.

  3. A qualifying branch has stability 4/3 and two leaf children with stability 2/3 each. Which does this program choose? If every coordinate is multiplied by three, does that decision change?

    Answer: It chooses the parent because equality favors the parent. All three scores are divided by three under uniform scaling, so the equality and decision persist. The data (0, 1, 5/2, 7/2, 13/2, 15/2), with both parameters equal to two, contain such a branch; no arbitrary epsilon is needed to break the score tie.

  4. Run (0, 2, 3, 5, 20, 21) with both parameters equal to two. The first selected cluster contains rows 0–3. Rows 0 and 3 leave it at 1/2, while rows 1 and 2 leave at 1. Should the first two points mentioned be relabeled as noise? What happens to the seven-point corridor example if min_cluster_size becomes seven?

    Answer: No. They belonged to the selected cluster from its birth; their earlier exits reduce its stability, not their final membership in that selected branch. With minimum size seven, the corridor root never creates qualifying children. Because root selection is disabled, all seven points become noise. Neither outcome proves the observations lack useful structure.

A hierarchy, an objective and a faster computation

The 2013 HDBSCAN paper linked a simplified density hierarchy to an explicit stability selection problem. This makes a useful separation: a hierarchy describes possible nested groupings, while a selection criterion decides which of them to report.

McInnes and Healy, 2017 connect statistical cluster trees, DBSCAN* and a topological interpretation, then accelerate the computation using spatial trees and a modified Borůvka approach. Read their computational account alongside the official algorithm walkthrough: the former explains the mathematical relationships and engineering problem; the latter makes point fallout and branch selection easy to follow. Faster geometric search depends on the data and representation; it does not turn this complete-graph implementation into a near-linear algorithm.

The fixed scikit-learn API documents practical choices such as EOM versus leaf selection, root eligibility and the self-count convention. For comparison, follow DBSCAN for a single radius and hierarchical clustering for linkage choices. The common question is what kind of connection should hold a cluster together; HDBSCAN adds a density-adjusted connection and a persistence-based choice among branches.

Make a prediction, then check

A condensed cluster loses a small component, leaving exactly one child large enough. What happens?

Choose one answer

Learning objectives

  • Compute self-inclusive core distances and explain what an MST preserves across thresholds.
  • Distinguish point fallout, true cluster splits and simultaneous distance ties.
  • Derive per-point stability and certify the best disjoint branch selection.

Prerequisites & connections

Explore related knowledge →

References

  1. Density-Based Clustering Based on Hierarchical Density Estimates
    Ricardo J. G. B. Campello; Davoud Moulavi; Joerg Sander · 2013
  2. Accelerated Hierarchical Density Clustering
    Leland McInnes; John Healy · 2017
  3. How HDBSCAN Works — hdbscan documentation
    hdbscan developers
  4. HDBSCAN — scikit-learn 1.7
    scikit-learn developers

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Codex · 2026-09-05 · Codex technical check: primary-source locations, original runnable models, independent mathematical and computational references, bilingual review and second-agent cross-checks; not independent human peer review.

  • Six tests passed. On ten targeted models, an independent complete-graph Boolean connectivity oracle and quotient of component-time intervals verify core distances, every returned hierarchy partition, all cluster births, exits and stability scores. Enumeration of all non-root disjoint cluster subsets verifies the global selected score. This reference uses neither an MST nor the authored active-cluster update and computes stability by interval area.
  • Checked parent wins, children win, exact score ties, retained identity after point fallout, uniform tied chains under three row orders, self counts 1/2/3, all-noise output, affine scale/reflection and row permutation, invalid ranges/types/duplicates and input preservation. Actual main run reports scores 21/8 and 9/8, total 15/4, one noise point and an all-noise tied-chain counterexample.
  • Complete original bilingual prose, identical runnable Python and seven actual stdout lines, six displays, six anchors and four answered exercises. Strict MDX/KaTeX and actual React HTML passed; six mathematical annotations match. Humanizer reread; AI author checks only, written pending independent review. Draft only; no repository changes or production clustering-library execution.
  • Six final author tests pass. Eight independent full reports agree: core distances from minimax m-record subsets, Prim cut-growing MST under the same total edge order (35 edges), and one-dimensional sorted eligible-point sweeps for all 20 hierarchy partitions. The sweep uses core-distance eligibility and consecutive coordinate gaps, without graph traversal or Boolean/Floyd closure. A recursive raw hierarchy followed by pruning and maximal unary-chain contraction verifies 26 condensed clusters, birth order/IDs, children, every exit and stability.
  • A generic exact linear-program vertex oracle checks the disjoint-selection packing problem, rather than EOM recursion or enumerating antichain subsets: 548 active bases and 104 feasible vertices. Its secondary linear objective chooses ancestors on exact score ties. It verifies selected IDs, labels and score, including point fallout retained in a selected ancestor, parent/child wins, equal-distance all-noise chains and root exclusion.
  • Fully reread both articles, code, equations, four answers, parameter/domain restrictions and complexity. Independently reran strict MDX/KaTeX/React HTML: six corresponding displays and actual MathML annotations, six standard anchors and four answers in each language. All five final SHA values match after the ID and conditional-language corrections. No remaining mathematical or implementation defect found in the stated scope.
  • Promoted the full prose, equations, code and exercises. Tests read formal MDX only; removed temporary fallbacks/draft skips and updated review assertion to checked. Algorithm and independent references are unchanged; final record binds both locale hashes.
  • Publication navigation points published topics to complete articles and removes corresponding pending wording, retaining directory entries for unwritten targets. Principles, equations, programs and exercises are unchanged; final article SHA values rebound.

Source locations checked:

  • Density-Based Clustering Based on Hierarchical Density Estimates · Actually read the Springer chapter landing page: authors, PAKDD 2013, pages 160–172 and abstract lines 38–40 describing the hierarchy, simplification and stability optimization. Year precision only: the inspected publisher page does not give a month or day. Full PDF redirects to the subscription page; no full-text reading claimed. The 2015 CORE PDF could not be fetched (web errors and shell DNS failure); it is not counted as a read mathematical source.
  • Accelerated Hierarchical Density Clustering · Actually read the 32-page arXiv PDF, v2 footer dated 23 May 2017 and title dated 25 May 2017. Read sections 2.1–2.2 (printed pages 4–9) on cluster trees, condensation, DBSCAN*, per-point stability and disjoint-branch optimization; sections 3.2–3.3 passages on MST construction and Boruvka (printed pages 13, 16 and 19–20). The extracted page-8 formula has d(Xj,Xj) in the off-diagonal maximum; the implementation uses d(Xi,Xj), independently derived and consistent with Algorithm 6 on printed page 20 and the official guide. The article uses >= minimum size explicitly, rather than reproducing the paper’s uneven more-than wording. No claimed visual PDF inspection, paper code reuse, acceleration implementation or universal near-linear bound.
  • How HDBSCAN Works — hdbscan documentation · Actually opened the official algorithm page, heading rendered hdbscan 0.8.1 documentation. Read lines 38–127: five pipeline stages, kth other neighbor convention, mutual reachability, MST threshold connectivity, one-child continuation, point exit levels, sum stability and bottom-up parent-versus-children selection. This is an accessed documentation snapshot, not a pinned source revision; no figures or code copied.
  • HDBSCAN — scikit-learn 1.7 · Actually opened the fixed /1.7 API rendered 1.7.2. Read parameters lines 631–681, noise and membership-strength attributes 701–720, self-inclusive versus contrib offset note 759–760, and DBSCAN* versus border-point assignment 796–802. Example follows self inclusion and root exclusion but uses exact rational one-dimensional inputs and explicit simultaneous positive-distance ties; no sklearn/contrib execution or full API output equivalence claimed.
  • Density-Based Clustering Based on Hierarchical Density Estimates · Independently opened Springer landing page: authors, PAKDD 2013, pages 160–172 and abstract lines 38–40 on simplified hierarchy, stability and disjoint flat selection. Full chapter was not read; no precise month/day or performance replication asserted.
  • Accelerated Hierarchical Density Clustering · Independently opened the 32-page arXiv v2 PDF. Read §2.2 printed pages 8–9: DBSCAN* removes borders, mutual reachability, point fallout, condensed identities and disjoint stability objective; also §3.2–3.3 passages on MST, spatial trees, Boruvka and Algorithm 6 at printed page 20. The extracted off-diagonal formula repeats Xj; Algorithm 6 and the official guide use distinct endpoints. No reproduction of theoretical consistency results, figures or acceleration; no visual PDF inspection claimed.
  • How HDBSCAN Works — hdbscan documentation · Independently opened official latest walkthrough, rendered hdbscan 0.8.1. Read lines 38–58, 78–104 and 112–127: stages, kth other-neighbor convention, mutual reachability, MST, one-child continuation, point exits and stability selection. Mutable documentation snapshot, not a pinned release; no figures or library code reused.
  • HDBSCAN — scikit-learn 1.7 · Independently read fixed 1.7 API displayed as 1.7.2, lines 631–681, 701–720 and 759–760: min cluster size, EOM/leaf, root eligibility, label/member-strength distinctions and self-inclusive count offset. The exact example’s simultaneous positive ties and duplicate rejection are explicit teaching conventions, not a full library-equivalence claim.

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.