first test fix, but the results are not actually equal
@@ -53,7 +53,9 @@ class TestVIS(unittest.TestCase):
dissimilarity_measure=mes,
descriptors=des)
mds_emb = rsv.mds(rdms, dim=3, weight=wes)
- self.assertEqual(mds_emb.shape, (8, 5, 3))
+ self.assertEqual(mds_emb.shape[0], 8)
+ self.assertEqual(mds_emb.shape[1], 5)
+ self.assertEqual(mds_emb.shape[2], 3)
def test_vis_weighted_mds_output_behaves_like_mds(self):
dis = np.random.rand(8, 10)
@@ -65,7 +67,7 @@ class TestVIS(unittest.TestCase):
descriptors=des)
mds_emb = rsv.mds(rdms)
wmds_emb = rsv.mds(rdms, weight=wes)
- self.assertEqual(mds_emb, wmds_emb)
+ np.testing.assert_allclose(mds_emb, wmds_emb)
def test_vis_3d_weighted_mds_output_behaves_like_mds(self):
dis = np.random.rand(8, 10)
@@ -77,7 +79,7 @@ class TestVIS(unittest.TestCase):
descriptors=des)
mds_emb = rsv.mds(rdms, dim=3)
wmds_emb = rsv.mds(rdms, dim=3, weight=wes)
- self.assertEqual(mds_emb, wmds_emb)
+ np.testing.assert_allclose(mds_emb, wmds_emb)
if __name__ == '__main__':
unittest.main()
