예제 #1
0
 def test_apply_lloyd_three(self):
     a = kmeans.apply_lloyd(self.three_cluster_test_points, 3)
     self.assertIn([(1,2),(1,2.1),(1,2.2)], a.values())
예제 #2
0
 def test_apply_lloyd_two(self):
     a = kmeans.apply_lloyd(self.test_points, 2)
     self.assertIn([(1,2),(1,2.1)], a.values())
     self.assertIn([(4,5),(4,5.1)], a.values())