def test_not_fitted(): dd = PairwiseDistance() da = Amplitude() with pytest.raises(NotFittedError): dd.transform(X_1) with pytest.raises(NotFittedError): da.transform(X_1)
def compute_distance(emb2diagram, metric: str = "bottleneck"): dis = PairwiseDistance(metric=metric) dis.fit(emb2diagram["SBert"]) dis.transform(emb2diagram["LF"]) return dis