Ejemplo n.º 1
0
class TestFSVD(unittest.TestCase):
    def setUp(self):
        self.test_matrix = np.loadtxt(get_data_path('full_sym_matrix.txt'))
        self.fsvd = FSVD()

    def test_svd(self):
        """
        Ensure eigenvalues and eigenvectors are returned.
        """
        DIMENSIONS_OUT = 10
        eigenvectors, eigenvalues = self.fsvd.run(self.test_matrix,
                                                  DIMENSIONS_OUT)

        self.assertEqual(eigenvectors.shape, (100, DIMENSIONS_OUT))
        self.assertEqual(eigenvalues.shape, (DIMENSIONS_OUT,))
Ejemplo n.º 2
0
 def setUp(self):
     self.test_matrix = np.loadtxt(get_data_path('full_sym_matrix.txt'))
     self.fsvd = FSVD()