Exemplo n.º 1
0
 def test_vis_3d_weighted_mds_output_behaves_like_mds(self):
     dis = np.random.rand(8, 10)
     wes = np.ones((8, 10))
     mes = "Euclidean"
     des = {'session': 0, 'subj': 0}
     rdms = rsr.RDMs(dissimilarities=dis,
                     dissimilarity_measure=mes,
                     descriptors=des)
     mds_emb = rsv.mds(rdms, dim=3)
     wmds_emb = rsv.mds(rdms, dim=3, weight=wes)
     np.testing.assert_allclose(pdist(mds_emb[0]),
                                pdist(wmds_emb[0]),
                                atol=3e-1)
Exemplo n.º 2
0
 def test_vis_3d_mds_output_shape_corresponds_to_inputs(self):
     dis = np.random.rand(8, 10)
     mes = "Euclidean"
     des = {'session': 0, 'subj': 0}
     rdms = rsr.RDMs(dissimilarities=dis,
                     dissimilarity_measure=mes,
                     descriptors=des)
     mds_emb = rsv.mds(rdms, dim=3)
     self.assertEqual(mds_emb.shape, (8, 5, 3))