示例#1
0
 def test_correspond_4_and_up_2(self):
     # Tests correspond(Z, y) on linkage and CDMs over observation sets of
     # different sizes. Correspondance should be false.
     for (i, j) in (list(zip(list(range(2, 7)), list(range(16, 21)))) +
                    list(zip(list(range(2, 7)), list(range(16, 21))))):
         y = np.random.rand(i*(i-1)//2)
         y2 = np.random.rand(j*(j-1)//2)
         Z = linkage(y)
         Z2 = linkage(y2)
         self.assertTrue(correspond(Z, y2) == False)
         self.assertTrue(correspond(Z2, y) == False)
示例#2
0
 def test_correspond_4_and_up_2(self):
     # Tests correspond(Z, y) on linkage and CDMs over observation sets of
     # different sizes. Correspondance should be false.
     for (i, j) in (list(zip(list(range(2, 7)), list(range(16, 21)))) +
                    list(zip(list(range(2, 7)), list(range(16, 21))))):
         y = np.random.rand(i*(i-1)//2)
         y2 = np.random.rand(j*(j-1)//2)
         Z = linkage(y)
         Z2 = linkage(y2)
         self.assertTrue(correspond(Z, y2) == False)
         self.assertTrue(correspond(Z2, y) == False)
示例#3
0
 def test_correspond_2_and_up(self):
     # Tests correspond(Z, y) on linkage and CDMs over observation sets of
     # different sizes.
     for i in range(2, 4):
         y = np.random.rand(i*(i-1)//2)
         Z = linkage(y)
         self.assertTrue(correspond(Z, y))
     for i in range(4, 15, 3):
         y = np.random.rand(i*(i-1)//2)
         Z = linkage(y)
         self.assertTrue(correspond(Z, y))
示例#4
0
 def test_correspond_2_and_up(self):
     # Tests correspond(Z, y) on linkage and CDMs over observation sets of
     # different sizes.
     for i in xrange(2, 4):
         y = np.random.rand(i*(i-1)//2)
         Z = linkage(y)
         self.assertTrue(correspond(Z, y))
     for i in xrange(4, 15, 3):
         y = np.random.rand(i*(i-1)//2)
         Z = linkage(y)
         self.assertTrue(correspond(Z, y))