denselinkage.metrics.clustering_metrics

denselinkage.metrics.clustering_metrics(clustering: ClusteringResult, *, gold: LabeledPairs) ClusteringMetrics[source]

B³ clustering quality of clustering against gold.

gold pairs are treated as edges and closed transitively into gold clusters, so the same LabeledPairs used for linkage_metrics scores clustering too — one gold type everywhere (kwarg gold, consistent with the other metrics). Records present in clustering but in no gold pair are singleton gold clusters. Returns B³ precision/recall/F1; see ClusteringMetrics.