def test_calc_Lambda_b(expected_scatter_matrices, expected_W, expected_Lambda_b): S_b = expected_scatter_matrices['S_b'] W = expected_W actual_Lambda_b = calc_Lambda_b(S_b, W) assert_allclose(actual_Lambda_b, expected_Lambda_b, rtol=1e-8) assert_diagonal(actual_Lambda_b, atol=1e-6)
def test_calc_Lambda_w(expected_scatter_matrices, expected_W, expected_Lambda_w): S_w = expected_scatter_matrices['S_w'] W = expected_W dim = W.shape[0] actual_Lambda_w = calc_Lambda_b(S_w, W) assert_allclose(actual_Lambda_w, expected_Lambda_w, rtol=1e-8) assert_diagonal(actual_Lambda_w, atol=1e-6) assert_allclose(np.eye(dim), actual_Lambda_w, atol=1e-6)