File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,14 @@ Changelog
165
165
and automatic retries in case of HTTP errors. :pr: `29354 ` by :user: `Olivier
166
166
Grisel <ogrisel> `.
167
167
168
+ :mod: `sklearn.decomposition `
169
+ ............................
170
+
171
+ - |Fix | Increase rank defficiency threshold in the whitening step of
172
+ :class: `decomposition.FastICA ` with `whiten_solver="eigh" ` to improve the
173
+ platform-agnosticity of the estimator. :pr: `29612 ` by :user: `Olivier Grisel
174
+ <ogrisel> `.
175
+
168
176
:mod: `sklearn.discriminant_analysis `
169
177
....................................
170
178
Original file line number Diff line number Diff line change @@ -605,7 +605,7 @@ def g(x, fun_args):
605
605
# Faster when num_samples >> n_features
606
606
d , u = linalg .eigh (XT .dot (X ))
607
607
sort_indices = np .argsort (d )[::- 1 ]
608
- eps = np .finfo (d .dtype ).eps
608
+ eps = np .finfo (d .dtype ).eps * 10
609
609
degenerate_idx = d < eps
610
610
if np .any (degenerate_idx ):
611
611
warnings .warn (
Original file line number Diff line number Diff line change 13
13
from sklearn .decomposition import PCA , FastICA , fastica
14
14
from sklearn .decomposition ._fastica import _gs_decorrelation
15
15
from sklearn .exceptions import ConvergenceWarning
16
- from sklearn .utils ._testing import assert_allclose
16
+ from sklearn .utils ._testing import assert_allclose , ignore_warnings
17
17
18
18
19
19
def center_and_norm (x , axis = - 1 ):
@@ -448,5 +448,10 @@ def test_fastica_eigh_low_rank_warning(global_random_seed):
448
448
X = A @ A .T
449
449
ica = FastICA (random_state = 0 , whiten = "unit-variance" , whiten_solver = "eigh" )
450
450
msg = "There are some small singular values"
451
+
451
452
with pytest .warns (UserWarning , match = msg ):
452
- ica .fit (X )
453
+ with ignore_warnings (category = ConvergenceWarning ):
454
+ # The FastICA solver may not converge for some data with specific
455
+ # random seeds but this happens after the whiten step so this is
456
+ # not want we want to test here.
457
+ ica .fit (X )
You can’t perform that action at this time.
0 commit comments