Exemplo n.º 1
0
def _test_output_dim(self, method, *args, **kwargs):
    n_components = 4
    embed = method(n_components=n_components)
    n = 10
    M = 20
    A = er_nm(n, M) + 5
    embed._reduce_dim(A)
    self.assertEqual(embed.latent_left_.shape, (n, 4))
    self.assertTrue(embed.latent_right_ is None)
Exemplo n.º 2
0
 def test_baseembed_er(self):
     n_components = 4
     embed = BaseEmbed(n_components=n_components)
     n = 10
     M = 20
     A = er_nm(n, M) + 5
     embed._reduce_dim(A)
     self.assertEqual(embed.latent_left_.shape, (n, n_components))
     self.assertTrue(embed.latent_right_ is None)
Exemplo n.º 3
0
def test_omni_unconnected():
    np.random.seed(4)
    n = 100
    m = 50

    graphs = [er_nm(n, m) for _ in range(2)]
    omni = OmnibusEmbed()

    with pytest.warns(UserWarning):
        omni.fit(graphs)
Exemplo n.º 4
0
 def test_unconnected_warning(self):
     A = er_nm(100, 10)
     with self.assertWarns(UserWarning):
         ase = AdjacencySpectralEmbed()
         ase.fit(A)
Exemplo n.º 5
0
 def test_baseembed(self):
     embed = BaseEmbed(n_components=None)
     n = 10
     M = 20
     A = er_nm(n, M) + 5
     embed._reduce_dim(A)