コード例 #1
0
 def test_heuristic_get_states(self):
     """Check attribute pairs after the widget has been paused"""
     heuristic = KMeansCorrelationHeuristic(self.data_cont)
     heuristic.n_clusters = 2
     states = heuristic.get_states(None)
     _ = next(states)
     self.assertListEqual(list(heuristic.get_states(next(states))),
                          [(0, 3), (2, 3), (0, 1), (1, 2), (1, 3)])
コード例 #2
0
 def test_heuristic_get_states(self):
     """Check attribute pairs after the widget has been paused"""
     heuristic = KMeansCorrelationHeuristic(self.data_cont)
     heuristic.n_clusters = 2
     states = heuristic.get_states(None)
     _ = next(states)
     self.assertListEqual(list(heuristic.get_states(next(states))),
                          [(0, 3), (2, 3), (0, 1), (1, 2), (1, 3)])
コード例 #3
0
 def test_heuristic(self):
     """Check attribute pairs got by heuristic"""
     heuristic = KMeansCorrelationHeuristic(self.data_cont)
     heuristic.n_clusters = 2
     self.assertListEqual(list(heuristic.get_states(None)), [(0, 2), (0, 3),
                                                             (2, 3), (0, 1),
                                                             (1, 2),
                                                             (1, 3)])
コード例 #4
0
 def test_get_states_one_cluster(self):
     heuristic = KMeansCorrelationHeuristic(Table("iris")[:, :2])
     states = set(heuristic.get_states(None))
     self.assertEqual(len(states), 1)
     self.assertSetEqual(states, {(0, 1)})
コード例 #5
0
 def setUpClass(cls):
     cls.data = Table(test_filename("datasets/breast-cancer-wisconsin"))
     cls.heuristic = KMeansCorrelationHeuristic(cls.data)
コード例 #6
0
 def test_get_states_one_cluster(self):
     heuristic = KMeansCorrelationHeuristic(Table("iris")[:, :2])
     states = set(heuristic.get_states(None))
     self.assertEqual(len(states), 1)
     self.assertSetEqual(states, {(0, 1)})
コード例 #7
0
 def setUpClass(cls):
     cls.data = Table("wine")
     cls.heuristic = KMeansCorrelationHeuristic(cls.data)
コード例 #8
0
 def test_heuristic(self):
     """Check attribute pairs got by heuristic"""
     heuristic = KMeansCorrelationHeuristic(self.data_cont)
     heuristic.n_clusters = 2
     self.assertListEqual(list(heuristic.get_states(None)),
                          [(0, 2), (0, 3), (2, 3), (0, 1), (1, 2), (1, 3)])