Skip to content

TST Make test_fastica_eigh_low_rank_warning more stable #23770

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions sklearn/decomposition/tests/test_fastica.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import numpy as np
from scipy import stats
from sklearn.datasets import make_low_rank_matrix

from sklearn.utils._testing import assert_array_equal
from sklearn.utils._testing import assert_allclose
Expand Down Expand Up @@ -501,9 +500,8 @@ def test_fastica_simple_different_solvers(add_noise, global_random_seed):
def test_fastica_eigh_low_rank_warning(global_random_seed):
"""Test FastICA eigh solver raises warning for low-rank data."""
rng = np.random.RandomState(global_random_seed)
X = make_low_rank_matrix(
n_samples=10, n_features=10, random_state=rng, effective_rank=2
)
A = rng.randn(10, 2)
X = A @ A.T
ica = FastICA(random_state=0, whiten="unit-variance", whiten_solver="eigh")
msg = "There are some small singular values"
with pytest.warns(UserWarning, match=msg):
Expand Down