Exemple #1
0
 def check_leaves_list_Q(self, method):
     # Tests leaves_list(Z) on the Q data set
     X = hierarchy_test_data.Q_X
     Z = linkage(X, method)
     node = to_tree(Z)
     assert_equal(node.pre_order(), leaves_list(Z))
Exemple #2
0
 def check_leaves_list_Q(self, method):
     # Tests leaves_list(Z) on the Q data set
     X = hierarchy_test_data.Q_X
     Z = linkage(X, method)
     node = to_tree(Z)
     assert_equal(node.pre_order(), leaves_list(Z))
Exemple #3
0
 def test_leaves_list_2x4(self):
     # Tests leaves_list(Z) on a 2x4 linkage.
     Z = np.asarray([[0, 1, 3.0, 2],
                     [3, 2, 4.0, 3]], dtype=np.double)
     to_tree(Z)
     assert_equal(leaves_list(Z), [0, 1, 2])
Exemple #4
0
 def test_leaves_list_2x4(self):
     # Tests leaves_list(Z) on a 2x4 linkage.
     Z = np.asarray([[0, 1, 3.0, 2],
                     [3, 2, 4.0, 3]], dtype=np.double)
     to_tree(Z)
     assert_equal(leaves_list(Z), [0, 1, 2])