denselinkage.metrics.adjusted_metrics

denselinkage.metrics.adjusted_metrics(result: LinkageResult, candidates: Sequence[CandidatePair], *, gold: LabeledPairs, k: int, directed: bool = True) AdjustedMetrics[source]

Decompose end-to-end recall into matcher x blocker components.

blocking_recall_at_k is the blocker’s pair-completeness@k over candidates. matcher is the matcher’s metrics measured conditionally on blocking — recall over only the gold pairs the candidate set surfaced — so recall_adjusted = matcher.recall * pc@k is the honest end-to-end recall, not a double-counting of the blocking loss (measuring the matcher against the full gold would already fold blocking misses in as false negatives). Precision is unaffected by the conditioning. When the matched candidate set is the top-k set used for pc@k, recall_adjusted equals linkage_metrics(result, gold=gold).recall exactly. directed follows linkage_metrics / pair_completeness_at_k.