Esempio n. 1
0
 def test_partition_05(self):
     np.random.seed(42)
     matrix = np.random.uniform(-1, 1, 9).reshape(3, 3)
     ss = KernelActiveSubspaces(dim=4)
     ss.evects = matrix
     with self.assertRaises(ValueError):
         ss._partition()
Esempio n. 2
0
 def test_partition_02(self):
     np.random.seed(42)
     matrix = np.random.uniform(-1, 1, 9).reshape(3, 3)
     ss = KernelActiveSubspaces(dim=2)
     ss.evects = matrix
     ss._partition()
     np.testing.assert_array_almost_equal(matrix[:, 2:], ss.W2)