denselinkage.metrics.ClusteringMetrics¶
- class denselinkage.metrics.ClusteringMetrics(b3_precision: float, b3_recall: float, n_clusters: int, n_gold_clusters: int)[source]¶
Bases:
objectB³ (Bagga-Baldwin) clustering quality.
Gold clusters are the transitive closure of
LabeledPairs(gold pairs -> connected components), so the same gold that scores pairwiselinkage_metricsalso scores clustering — one gold type everywhere.b3_precision/b3_recallare per-record B³ averages;b3_f1is their harmonic mean.n_clusters/n_gold_clustersare reported for context. Construct viafrom_b3()— the two adjacent ratios are easy to transpose positionally, so the keyword constructor is the supported path (mirrorsBlockingMetrics.from_pc_map).