higher tolerance on weighted vs non-weighted mds test
@@ -40,6 +40,10 @@ class TestMDS(TestCase):
@patch('rsatoolbox.vis.scatter_plot.show_scatter')
def test_vis_weighted_mds_output_behaves_like_mds(self, show_scatter):
+ """
+ Fails stochastically as MDS solution not deterministic
+ Should fail once every >500 runs with current tolerance
+ """
from rsatoolbox.vis.scatter_plot import show_MDS
dis = np.random.rand(8, 10)
wes = np.ones((8, 10))
@@ -50,7 +54,7 @@ class TestMDS(TestCase):
mds_coords = show_scatter.call_args[0][1]
show_MDS(rdms, weights=wes)
wmds_coords = show_scatter.call_args[0][1]
- np.testing.assert_allclose(pdist(mds_coords[0]), pdist(wmds_coords[0]), atol=3e-1)
+ np.testing.assert_allclose(pdist(mds_coords[0]), pdist(wmds_coords[0]), rtol=0.3)
class Test_Icon(TestCase):
