def test_plot_eigenvalues_03(self): np.random.seed(42) gradients = np.random.uniform(-1, 1, 200).reshape(50, 1, 4) inputs = np.random.uniform(-1, 1, 200).reshape(50, 4) weights = np.ones((50, 1)) / 50 ss = KernelActiveSubspaces() ss.compute(inputs=inputs, gradients=gradients, weights=weights, method='exact', nboot=49, n_features=8, feature_map=None) with assert_plot_figures_added(): ss.plot_eigenvalues(n_evals=3, figsize=(7, 7), title='Eigenvalues')
def test_plot_eigenvalues_01(self): ss = KernelActiveSubspaces(dim=2) with self.assertRaises(TypeError): ss.plot_eigenvalues(figsize=(7, 7), title='Eigenvalues')