@@ -180,22 +180,23 @@ def fastica(
180
180
`n_features` is the number of features.
181
181
182
182
n_components : int, default=None
183
- Number of components to extract. If None no dimension reduction
184
- is performed.
183
+ Number of components to use. If None is passed, all are used.
185
184
186
185
algorithm : {'parallel', 'deflation'}, default='parallel'
187
- Apply a parallel or deflational FASTICA algorithm .
186
+ Specify which algorithm to use for FastICA .
188
187
189
188
whiten : str or bool, default="warn"
190
189
Specify the whitening strategy to use.
191
- If 'arbitrary-variance' (default), a whitening with variance arbitrary is used.
192
- If 'unit-variance', the whitening matrix is rescaled to ensure that each
193
- recovered source has unit variance.
194
- If False, the data is already considered to be whitened, and no
195
- whitening is performed.
190
+
191
+ - If 'arbitrary-variance' (default), a whitening with variance
192
+ arbitrary is used.
193
+ - If 'unit-variance', the whitening matrix is rescaled to ensure that
194
+ each recovered source has unit variance.
195
+ - If False, the data is already considered to be whitened, and no
196
+ whitening is performed.
196
197
197
198
.. deprecated:: 1.1
198
- From version 1 .3, `whiten='unit-variance'` will be used by default.
199
+ Starting in v1 .3, `whiten='unit-variance'` will be used by default.
199
200
`whiten=True` is deprecated from 1.1 and will raise ValueError in 1.3.
200
201
Use `whiten=arbitrary-variance` instead.
201
202
@@ -206,10 +207,10 @@ def fastica(
206
207
You can also provide your own function. It should return a tuple
207
208
containing the value of the function, and of its derivative, in the
208
209
point. The derivative should be averaged along its last dimension.
209
- Example:
210
+ Example::
210
211
211
- def my_g(x):
212
- return x ** 3, np.mean (3 * x ** 2, axis=-1)
212
+ def my_g(x):
213
+ return x ** 3, (3 * x ** 2).mean( axis=-1)
213
214
214
215
fun_args : dict, default=None
215
216
Arguments to send to the functional form.
@@ -219,13 +220,13 @@ def my_g(x):
219
220
max_iter : int, default=200
220
221
Maximum number of iterations to perform.
221
222
222
- tol : float, default=1e-04
223
+ tol : float, default=1e-4
223
224
A positive scalar giving the tolerance at which the
224
225
un-mixing matrix is considered to have converged.
225
226
226
227
w_init : ndarray of shape (n_components, n_components), default=None
227
- Initial un-mixing array of dimension (n.comp,n.comp).
228
- If None (default) then an array of normal r.v.'s is used.
228
+ Initial un-mixing array. If `w_init=None`, then an array of values
229
+ drawn from a normal distribution is used.
229
230
230
231
random_state : int, RandomState instance or None, default=None
231
232
Used to initialize ``w_init`` when not specified, with a
@@ -332,18 +333,20 @@ class FastICA(_ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator)
332
333
Number of components to use. If None is passed, all are used.
333
334
334
335
algorithm : {'parallel', 'deflation'}, default='parallel'
335
- Apply parallel or deflational algorithm for FastICA.
336
+ Specify which algorithm to use for FastICA.
336
337
337
338
whiten : str or bool, default="warn"
338
339
Specify the whitening strategy to use.
339
- If 'arbitrary-variance' (default), a whitening with variance arbitrary is used.
340
- If 'unit-variance', the whitening matrix is rescaled to ensure that each
341
- recovered source has unit variance.
342
- If False, the data is already considered to be whitened, and no
343
- whitening is performed.
340
+
341
+ - If 'arbitrary-variance' (default), a whitening with variance
342
+ arbitrary is used.
343
+ - If 'unit-variance', the whitening matrix is rescaled to ensure that
344
+ each recovered source has unit variance.
345
+ - If False, the data is already considered to be whitened, and no
346
+ whitening is performed.
344
347
345
348
.. deprecated:: 1.1
346
- From version 1.3 whiten='unit-variance' will be used by default.
349
+ Starting in v1.3, ` whiten='unit-variance'` will be used by default.
347
350
`whiten=True` is deprecated from 1.1 and will raise ValueError in 1.3.
348
351
Use `whiten=arbitrary-variance` instead.
349
352
@@ -353,24 +356,27 @@ class FastICA(_ClassNamePrefixFeaturesOutMixin, TransformerMixin, BaseEstimator)
353
356
or 'cube'.
354
357
You can also provide your own function. It should return a tuple
355
358
containing the value of the function, and of its derivative, in the
356
- point. Example::
359
+ point. The derivative should be averaged along its last dimension.
360
+ Example::
357
361
358
362
def my_g(x):
359
363
return x ** 3, (3 * x ** 2).mean(axis=-1)
360
364
361
365
fun_args : dict, default=None
362
366
Arguments to send to the functional form.
363
- If empty and if fun='logcosh', fun_args will take value
367
+ If empty or None and if fun='logcosh', fun_args will take value
364
368
{'alpha' : 1.0}.
365
369
366
370
max_iter : int, default=200
367
371
Maximum number of iterations during fit.
368
372
369
373
tol : float, default=1e-4
370
- Tolerance on update at each iteration.
374
+ A positive scalar giving the tolerance at which the
375
+ un-mixing matrix is considered to have converged.
371
376
372
377
w_init : ndarray of shape (n_components, n_components), default=None
373
- The mixing matrix to be used to initialize the algorithm.
378
+ Initial un-mixing array. If `w_init=None`, then an array of values
379
+ drawn from a normal distribution is used.
374
380
375
381
random_state : int, RandomState instance or None, default=None
376
382
Used to initialize ``w_init`` when not specified, with a
@@ -486,14 +492,14 @@ def _fit(self, X, compute_sources=False):
486
492
487
493
if self ._whiten == "warn" :
488
494
warnings .warn (
489
- "From version 1.3 whiten='unit-variance' will be used by default." ,
495
+ "Starting in v1.3, whiten='unit-variance' will be used by default." ,
490
496
FutureWarning ,
491
497
)
492
498
self ._whiten = "arbitrary-variance"
493
499
494
500
if self ._whiten is True :
495
501
warnings .warn (
496
- "From version 1.3 whiten=True should be specified as "
502
+ "Starting in v1.3, whiten=True should be specified as "
497
503
"whiten='arbitrary-variance' (its current behaviour). This "
498
504
"behavior is deprecated in 1.1 and will raise ValueError in 1.3." ,
499
505
FutureWarning ,
0 commit comments