def test_minmax_condensed(self):
     condensed_matrix = CondensedDistanceMatrix([ 1., 
                                                 4.5, 8.5, 
                                                 7.2, 4.5, 7.8, 
                                                 6.7, 3.6,2.2, 2.0])
     expected = (1,8.5)
     self.assertEqual(condensed_matrix.get_minimum_and_maximum(),expected)
 def test_normalize_condensed_matrix(self):
     condensed = CondensedDistanceMatrix([ 1., 4.5, 8.5, 7.2, 4.5, 7.8, 6.7, 3.6,2.2, 2.])
     expected = CondensedDistanceMatrix([0.0, 0.47, 1.0, 0.83, 0.47, 0.91, 0.76, 0.35, 0.16, 0.13])
     minmax = condensed.get_minimum_and_maximum()
     condensed.normalize(minmax[0], minmax[1])
     for i in range(len(condensed.get_data())):
         self.assertAlmostEqual(condensed.get_data()[i],expected.get_data()[i],2)
Exemple #3
0
 def test_normalize_condensed_matrix(self):
     condensed = CondensedDistanceMatrix(
         [1., 4.5, 8.5, 7.2, 4.5, 7.8, 6.7, 3.6, 2.2, 2.])
     expected = CondensedDistanceMatrix(
         [0.0, 0.47, 1.0, 0.83, 0.47, 0.91, 0.76, 0.35, 0.16, 0.13])
     minmax = condensed.get_minimum_and_maximum()
     condensed.normalize(minmax[0], minmax[1])
     for i in range(len(condensed.get_data())):
         self.assertAlmostEqual(condensed.get_data()[i],
                                expected.get_data()[i], 2)
Exemple #4
0
 def test_minmax_condensed(self):
     condensed_matrix = CondensedDistanceMatrix(
         [1., 4.5, 8.5, 7.2, 4.5, 7.8, 6.7, 3.6, 2.2, 2.0])
     expected = (1, 8.5)
     self.assertEqual(condensed_matrix.get_minimum_and_maximum(), expected)