def test_min_hac(self): # Merge steps # (1, 1), (2), (4), (5), (8) # (1, 1, 2), (4, 5), (8) # (1, 1, 2, 4, 5), (8) clusters = self.sort_clusters(clust.min_hac(self.dataset, 2)) self.assertEqual(2, len(clusters)) self.assertEqual(1, clusters.count([0,1,2,3,4])) self.assertEqual(1, clusters.count([5]))
def run_hac(self, dataset): return clust.min_hac(dataset, 4)