

def test_cohesion(self):
    distances = CondensedMatrix([1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0])
    clusters = [Cluster(None, elements=[0, 1, 2]), Cluster(None, elements=[3, 4])]
    clustering = Clustering(clusters)
    calculator = CohesionCalculator()
    self.assertAlmostEqual((1 - 0.696945), calculator.evaluate(clustering, distances), places=4)

dataset/ETHPy150Open victor-gil-sepulveda/pyProCT/pyproct/clustering/evaluation/metrics/test/TestCohesion.py TestBoundedMetrics.test_cohesion/original