FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit f2498c21 authored by M.D. Driver's avatar M.D. Driver
Browse files

formatting.

parent a8db4998
No related branches found
No related tags found
No related merge requests found
......@@ -42,16 +42,16 @@ class ClusterStatisticsTestCase(unittest.TestCase):
def test_calculate_max_dist(self):
"""Test to see if expected max dist matrix is produced.
"""
expected_matrix = np.array([ 17., 22., 28., 33.])
expected_matrix = np.array([17., 22., 28., 33.])
actual_matrix = clusterstatistics.calculate_max_dist(self.example_linkage_matrix)
np.testing.assert_array_almost_equal(expected_matrix, actual_matrix)
def test_calculate_inconsistency(self):
"""Test to see if expected inconsistency matrix is returned.
"""
expected_matrix = np.array([[ 17. , 0. , 1. , 0. ],
[ 19.5 , 3.535534, 2. , 0.707107],
[ 28. , 0. , 1. , 0. ],
[ 27.666667, 5.507571, 3. , 0.968364]])
expected_matrix = np.array([[17., 0., 1., 0.],
[19.5, 3.535534, 2., 0.707107],
[28., 0., 1., 0.],
[27.666667,5.507571, 3., 0.968364]])
actual_matrix = clusterstatistics.calculate_inconsistency(self.example_linkage_matrix)
np.testing.assert_array_almost_equal(expected_matrix, actual_matrix)
def test_calculate_cophenetic_distance(self):
......@@ -59,7 +59,8 @@ class ClusterStatisticsTestCase(unittest.TestCase):
returned as expected.
"""
expected_distance = 0.73020316123580109
expected_matrix = np.array([ 17., 33., 33., 22., 33., 33., 22., 28., 33., 33.])
expected_matrix = np.array([17., 33., 33., 22., 33., 33., 22., 28.,
33., 33.])
actual_distance, actual_matrix = clusterstatistics.calculate_cophenetic_distance(self.example_linkage_matrix,
self.example_distance_matrix)
self.assertAlmostEqual(expected_distance, actual_distance)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment