ó
    §ñ:iLg  ã                   ó0  • S r SSKrSSKJrJr  SSKrSSKJr  SSK	J
r
JrJrJr  SSKJr  SSKJrJrJr  SS	KJrJrJrJr  SS
KJr  SS/rS rS rS rS rS#S jr S r!S r"\" S/S/S/S/S.SS9 S#SSSSSSSSSSSSS .S! jj5       r# " S" S\\\
5      r$g)$z�
Python implementation of the fast ICA algorithms.

Reference: Tables 8.3 and 8.4 page 196 in the book:
Independent Component Analysis, by  Hyvarinen et al.
é    N)ÚIntegralÚReal)Úlinalgé   )ÚBaseEstimatorÚClassNamePrefixFeaturesOutMixinÚTransformerMixinÚ_fit_context)ÚConvergenceWarning)Úas_float_arrayÚcheck_arrayÚcheck_random_state)ÚIntervalÚOptionsÚ
StrOptionsÚvalidate_params)Úcheck_is_fittedÚfasticaÚFastICAc                 ón   • U [         R                  R                  XSU R                  USU /5      -  n U $ )aU  
Orthonormalize w wrt the first j rows of W.

Parameters
----------
w : ndarray of shape (n,)
    Array to be orthogonalized

W : ndarray of shape (p, n)
    Null space definition

j : int < p
    The no of (from the first) rows of Null space W wrt which w is
    orthogonalized.

Notes
-----
Assumes that W is orthogonal
w changed in place
N)Únpr   Ú	multi_dotÚT)ÚwÚWÚjs      Úa/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/sklearn/decomposition/_fastica.pyÚ_gs_decorrelationr       s7   € ð* Œ�‰×	Ñ	˜a 2 A §¡¨!¨B¨Q¨%Ð0Ó	1Ñ1€AØ€Hó    c                 óv  • [         R                  " [        R                  " X R                  5      5      u  p[        R
                  " U[        R                  " U R                  5      R                  SS9n[        R                   R                  US[        R                  " U5      -  -  UR                  U /5      $ )z8Symmetric decorrelation
i.e. W <- (W * W.T) ^{-1/2} * W
N)Úa_minÚa_maxç      ð?)r   Úeighr   Údotr   ÚclipÚfinfoÚdtypeÚtinyr   Úsqrt)r   ÚsÚus      r   Ú_sym_decorrelationr-   9   s{   € ô �;Š;”r—v’v˜a§¡“~Ó&�D€Aô 	�Š�œŸš !§'¡'Ó*×/Ñ/°tÑ<€Aô �9‰9×Ñ  S¬2¯7ª7°1«:Ñ%5Ñ 6¸¿¹¸QÐ?Ó@Ð@r   c                 ó  • UR                   S   n[        R                  " Xf4U R                  S9n/ n[	        U5       GH=  n	XYSS24   R                  5       n
U
[        R                  " U
S-  R                  5       5      -  n
[	        U5       HÎ  nU" [        R                  " U
R                  U 5      U5      u  pÍX-  R                  SS9UR                  5       U
-  -
  n[        XçU	5        U[        R                  " US-  R                  5       5      -  n[        R                  " [        R                  " Xê-  R                  5       5      S-
  5      nUn
Xñ:  d  MÎ    O   UR                  WS-   5        X§U	SS24'   GM@     U[        U5      4$ )z[Deflationary FastICA using fun approx to neg-entropy function

Used internally by FastICA.
r   ©r(   Nr   é   ©Úaxis)Úshaper   Úzerosr(   ÚrangeÚcopyr*   Úsumr%   r   Úmeanr   ÚabsÚappendÚmax)ÚXÚtolÚgÚfun_argsÚmax_iterÚw_initÚn_componentsr   Ún_iterr   r   ÚiÚgwtxÚg_wtxÚw1Úlims                   r   Ú_ica_defrI   H   s@  € ð —<‘< ‘?€LÜ
�Š�,Ð-°Q·W±WÑ=€AØ€Fô �<× ˆØ’a�4‰L×ÑÓˆØ	ŒR�WŠW�a˜‘d—Z‘Z“\Ó"Ñ"ˆä�x–ˆAÙœBŸFšF 1§3¡3¨›N¨HÓ5‰KˆDà‘(—‘ a�Ð(¨5¯:©:«<¸!Ñ+;Ñ;ˆBä˜b QÔ'à”"—'’'˜2˜q™5Ÿ+™+›-Ó(Ñ(ˆBä—&’&œŸš ¡§¡£Ó/°!Ñ3Ó4ˆCØˆAØ�yÙñ !ð 	�‰�a˜!‘eÔØˆ!ŠQˆ$Œñ' !ð* Œc�&‹kˆ>Ðr   c                 óþ  • [        U5      nA[        U R                  S   5      n[        U5       H©  nU" [        R
                  " X`5      U5      u  pš[        [        R
                  " X�R                  5      U-  U
SS2[        R                  4   U-  -
  5      nA	A
[        [        [        [        R                  " SX¶5      5      S-
  5      5      nUnXÁ:  d  M©    O   [        R                  " S[        5        UWS-   4$ )z;Parallel FastICA.

Used internally by FastICA --main loop

r0   Nzij,ij->iz\FastICA did not converge. Consider increasing tolerance or the maximum number of iterations.)r-   Úfloatr3   r5   r   r%   r   Únewaxisr;   r9   ÚeinsumÚwarningsÚwarnr   )r<   r=   r>   r?   r@   rA   r   Úp_ÚiirE   rF   ÚW1rH   s                r   Ú_ica_parrS   k   sÜ   € ô 	˜6Ó"€AØÜ	ˆq�w‰w�q‰zÓ	€BÜ�HŽoˆÙœŸš˜q› hÓ/‰ˆÜ¤§¢ t¯S©SÓ 1°BÑ 6¸ºqÄ"Ç*Á*¸}Ñ9MÐPQÑ9QÑ QÓRˆØ�%ô ”#”cœ"Ÿ)š) J°Ó6Ó7¸!Ñ;Ó<Ó=ˆØˆØ�9Ùñ ô 	�ŠðAô ô	
ð ˆb�1‰fˆ9Ðr   c                 ó  • UR                  SS5      nX-  n [        R                  " X 5      n[        R                  " U R                  S   U R
                  S9n[        U5       H   u  pVUSUS-  -
  -  R                  5       XE'   M"     X44$ )NÚalphar#   r   r/   r0   r   )Úgetr   ÚtanhÚemptyr3   r(   Ú	enumerater8   )Úxr?   rU   ÚgxÚg_xrD   Úgx_is          r   Ú_logcoshr^   �   sv   € Ø�L‰L˜ #Ó&€Eà�J€AÜ	�Š�‹€BÜ
�(Š(�1—7‘7˜1‘: Q§W¡WÑ
-€Cä˜R–=‰ˆØ˜1˜t Q™w™;Ñ'×-Ñ-Ó/ˆ‹ñ !àˆ7€Nr   c                 óz   • [         R                  " U S-  * S-  5      nX-  nSU S-  -
  U-  nX4R                  SS94$ )Nr   r0   éÿÿÿÿr1   )r   Úexpr8   )rZ   r?   ra   r[   r\   s        r   Ú_exprb   ™   sG   € Ü
�&Š&�1�a‘4�˜1‘Ó
€CØ	
‰€BØˆq�!‰t‰8�sÑ
€CØ�x‰x˜RˆxÐ Ð Ð r   c                 ó6   • U S-  SU S-  -  R                  SS94$ )Né   r   r`   r1   )r8   )rZ   r?   s     r   Ú_cubere       s$   € Øˆa‰4�!�a˜‘d‘(—‘ b�Ð)Ð)Ð)r   ú
array-likeÚboolean)r<   Úreturn_X_meanÚcompute_sourcesÚreturn_n_iterF©Úprefer_skip_nested_validationÚparallelúunit-varianceÚlogcoshéÈ   ç-Cëâ6?ÚsvdT)Ú	algorithmÚwhitenÚfunr?   r@   r=   rA   Úwhiten_solverÚrandom_staterh   ri   rj   c                óT  • [        UUUUUUUUU	U
S9
nUR                  5         UR                  XS9nUR                  S;   a  UR                  nUR
                  nOSnSnUUR                  U/nU(       a  UR                  U5        U(       a  UR                  UR                  5        U$ )aW  Perform Fast Independent Component Analysis.

The implementation is based on [1]_.

Read more in the :ref:`User Guide <ICA>`.

Parameters
----------
X : array-like of shape (n_samples, n_features)
    Training vector, where `n_samples` is the number of samples and
    `n_features` is the number of features.

n_components : int, default=None
    Number of components to use. If None is passed, all are used.

algorithm : {'parallel', 'deflation'}, default='parallel'
    Specify which algorithm to use for FastICA.

whiten : str or bool, default='unit-variance'
    Specify the whitening strategy to use.

    - If 'arbitrary-variance', a whitening with variance
      arbitrary is used.
    - If 'unit-variance', the whitening matrix is rescaled to ensure that
      each recovered source has unit variance.
    - If False, the data is already considered to be whitened, and no
      whitening is performed.

    .. versionchanged:: 1.3
        The default value of `whiten` changed to 'unit-variance' in 1.3.

fun : {'logcosh', 'exp', 'cube'} or callable, default='logcosh'
    The functional form of the G function used in the
    approximation to neg-entropy. Could be either 'logcosh', 'exp',
    or 'cube'.
    You can also provide your own function. It should return a tuple
    containing the value of the function, and of its derivative, in the
    point. The derivative should be averaged along its last dimension.
    Example::

        def my_g(x):
            return x ** 3, (3 * x ** 2).mean(axis=-1)

fun_args : dict, default=None
    Arguments to send to the functional form.
    If empty or None and if fun='logcosh', fun_args will take value
    {'alpha' : 1.0}.

max_iter : int, default=200
    Maximum number of iterations to perform.

tol : float, default=1e-4
    A positive scalar giving the tolerance at which the
    un-mixing matrix is considered to have converged.

w_init : ndarray of shape (n_components, n_components), default=None
    Initial un-mixing array. If `w_init=None`, then an array of values
    drawn from a normal distribution is used.

whiten_solver : {"eigh", "svd"}, default="svd"
    The solver to use for whitening.

    - "svd" is more stable numerically if the problem is degenerate, and
      often faster when `n_samples <= n_features`.

    - "eigh" is generally more memory efficient when
      `n_samples >= n_features`, and can be faster when
      `n_samples >= 50 * n_features`.

    .. versionadded:: 1.2

random_state : int, RandomState instance or None, default=None
    Used to initialize ``w_init`` when not specified, with a
    normal distribution. Pass an int, for reproducible results
    across multiple function calls.
    See :term:`Glossary <random_state>`.

return_X_mean : bool, default=False
    If True, X_mean is returned too.

compute_sources : bool, default=True
    If False, sources are not computed, but only the rotation matrix.
    This can save memory when working with big data. Defaults to True.

return_n_iter : bool, default=False
    Whether or not to return the number of iterations.

Returns
-------
K : ndarray of shape (n_components, n_features) or None
    If whiten is 'True', K is the pre-whitening matrix that projects data
    onto the first n_components principal components. If whiten is 'False',
    K is 'None'.

W : ndarray of shape (n_components, n_components)
    The square matrix that unmixes the data after whitening.
    The mixing matrix is the pseudo-inverse of matrix ``W K``
    if K is not None, else it is the inverse of W.

S : ndarray of shape (n_samples, n_components) or None
    Estimated source matrix.

X_mean : ndarray of shape (n_features,)
    The mean over features. Returned only if return_X_mean is True.

n_iter : int
    If the algorithm is "deflation", n_iter is the
    maximum number of iterations run across all components. Else
    they are just the number of iterations taken to converge. This is
    returned only when return_n_iter is set to `True`.

Notes
-----
The data matrix X is considered to be a linear combination of
non-Gaussian (independent) components i.e. X = AS where columns of S
contain the independent components and A is a linear mixing
matrix. In short ICA attempts to `un-mix' the data by estimating an
un-mixing matrix W where ``S = W K X.``
While FastICA was proposed to estimate as many sources
as features, it is possible to estimate less by setting
n_components < n_features. It this case K is not a square matrix
and the estimated A is the pseudo-inverse of ``W K``.

This implementation was originally made for data of shape
[n_features, n_samples]. Now the input is transposed
before the algorithm is applied. This makes it slightly
faster for Fortran-ordered input.

References
----------
.. [1] A. Hyvarinen and E. Oja, "Fast Independent Component Analysis",
       Algorithms and Applications, Neural Networks, 13(4-5), 2000,
       pp. 411-430.

Examples
--------
>>> from sklearn.datasets import load_digits
>>> from sklearn.decomposition import fastica
>>> X, _ = load_digits(return_X_y=True)
>>> K, W, S = fastica(X, n_components=7, random_state=0, whiten='unit-variance')
>>> K.shape
(7, 64)
>>> W.shape
(7, 7)
>>> S.shape
(1797, 7)
©
rB   rs   rt   ru   r?   r@   r=   rA   rv   rw   ©ri   )rn   úarbitrary-varianceN)	r   Ú_validate_paramsÚ_fit_transformrt   Ú
whitening_Úmean_Ú	_unmixingr:   Ún_iter_)r<   rB   rs   rt   ru   r?   r@   r=   rA   rv   rw   rh   ri   rj   ÚestÚSÚKÚX_meanÚreturned_valuess                      r   r   r   ¤   s³   € ôZ Ø!ØØØØØØØØ#Ø!ñ€Cð ×ÑÔØ×Ñ˜1ÐÐ>€Aà
‡z�zÐ<Ó<Ø�N‰NˆØ—‘‰àˆØˆà˜#Ÿ-™-¨Ð+€OÞØ×Ñ˜vÔ&ÞØ×Ñ˜sŸ{™{Ô+àÐr   c                   ót  ^ • \ rS rSr% Sr\" \SSSS9S/\" SS15      /\" S	S
15      \" \	S15      /\" 1 Sk5      \
/\S/\" \SSSS9/\" \SSSS9/SS/\" SS15      /S/S.
r\\S'    S#SS
SSSSSSSS.	U 4S jjjrS$S jr\" SS9S#S j5       r\" SS9S#S j5       rS%S jrS%S jr\S  5       rS! rS"rU =r$ )&r   ip  aY  FastICA: a fast algorithm for Independent Component Analysis.

The implementation is based on [1]_.

Read more in the :ref:`User Guide <ICA>`.

Parameters
----------
n_components : int, default=None
    Number of components to use. If None is passed, all are used.

algorithm : {'parallel', 'deflation'}, default='parallel'
    Specify which algorithm to use for FastICA.

whiten : str or bool, default='unit-variance'
    Specify the whitening strategy to use.

    - If 'arbitrary-variance', a whitening with variance
      arbitrary is used.
    - If 'unit-variance', the whitening matrix is rescaled to ensure that
      each recovered source has unit variance.
    - If False, the data is already considered to be whitened, and no
      whitening is performed.

    .. versionchanged:: 1.3
        The default value of `whiten` changed to 'unit-variance' in 1.3.

fun : {'logcosh', 'exp', 'cube'} or callable, default='logcosh'
    The functional form of the G function used in the
    approximation to neg-entropy. Could be either 'logcosh', 'exp',
    or 'cube'.
    You can also provide your own function. It should return a tuple
    containing the value of the function, and of its derivative, in the
    point. The derivative should be averaged along its last dimension.
    Example::

        def my_g(x):
            return x ** 3, (3 * x ** 2).mean(axis=-1)

fun_args : dict, default=None
    Arguments to send to the functional form.
    If empty or None and if fun='logcosh', fun_args will take value
    {'alpha' : 1.0}.

max_iter : int, default=200
    Maximum number of iterations during fit.

tol : float, default=1e-4
    A positive scalar giving the tolerance at which the
    un-mixing matrix is considered to have converged.

w_init : array-like of shape (n_components, n_components), default=None
    Initial un-mixing array. If `w_init=None`, then an array of values
    drawn from a normal distribution is used.

whiten_solver : {"eigh", "svd"}, default="svd"
    The solver to use for whitening.

    - "svd" is more stable numerically if the problem is degenerate, and
      often faster when `n_samples <= n_features`.

    - "eigh" is generally more memory efficient when
      `n_samples >= n_features`, and can be faster when
      `n_samples >= 50 * n_features`.

    .. versionadded:: 1.2

random_state : int, RandomState instance or None, default=None
    Used to initialize ``w_init`` when not specified, with a
    normal distribution. Pass an int, for reproducible results
    across multiple function calls.
    See :term:`Glossary <random_state>`.

Attributes
----------
components_ : ndarray of shape (n_components, n_features)
    The linear operator to apply to the data to get the independent
    sources. This is equal to the unmixing matrix when ``whiten`` is
    False, and equal to ``np.dot(unmixing_matrix, self.whitening_)`` when
    ``whiten`` is True.

mixing_ : ndarray of shape (n_features, n_components)
    The pseudo-inverse of ``components_``. It is the linear operator
    that maps independent sources to the data.

mean_ : ndarray of shape(n_features,)
    The mean over features. Only set if `self.whiten` is True.

n_features_in_ : int
    Number of features seen during :term:`fit`.

    .. versionadded:: 0.24

feature_names_in_ : ndarray of shape (`n_features_in_`,)
    Names of features seen during :term:`fit`. Defined only when `X`
    has feature names that are all strings.

    .. versionadded:: 1.0

n_iter_ : int
    If the algorithm is "deflation", n_iter is the
    maximum number of iterations run across all components. Else
    they are just the number of iterations taken to converge.

whitening_ : ndarray of shape (n_components, n_features)
    Only set if whiten is 'True'. This is the pre-whitening matrix
    that projects data onto the first `n_components` principal components.

See Also
--------
PCA : Principal component analysis (PCA).
IncrementalPCA : Incremental principal components analysis (IPCA).
KernelPCA : Kernel Principal component analysis (KPCA).
MiniBatchSparsePCA : Mini-batch Sparse Principal Components Analysis.
SparsePCA : Sparse Principal Components Analysis (SparsePCA).

References
----------
.. [1] A. Hyvarinen and E. Oja, Independent Component Analysis:
       Algorithms and Applications, Neural Networks, 13(4-5), 2000,
       pp. 411-430.

Examples
--------
>>> from sklearn.datasets import load_digits
>>> from sklearn.decomposition import FastICA
>>> X, _ = load_digits(return_X_y=True)
>>> transformer = FastICA(n_components=7,
...         random_state=0,
...         whiten='unit-variance')
>>> X_transformed = transformer.fit_transform(X)
>>> X_transformed.shape
(1797, 7)
r0   NÚleft)Úclosedrm   Ú	deflationr{   rn   F>   ra   Úcubero   g        rf   r$   rr   rw   ry   Ú_parameter_constraintsro   rp   rq   )	rs   rt   ru   r?   r@   r=   rA   rv   rw   c       	         óš   >• [         TU ]  5         Xl        X l        X0l        X@l        XPl        X`l        Xpl        X€l	        X�l
        X l        g ©N)ÚsuperÚ__init__rB   rs   rt   ru   r?   r@   r=   rA   rv   rw   )ÚselfrB   rs   rt   ru   r?   r@   r=   rA   rv   rw   Ú	__class__s              €r   r�   ÚFastICA.__init__  sE   ø€ ô 	‰ÑÔØ(ÔØ"ŒØŒØŒØ ŒØ ŒØŒØŒØ*ÔØ(Õr   c                 ó¬
  ^ • T R                  UT R                  [        R                  [        R                  /SS9R
                  nT R                  c  0 OT R                  n[        T R                  5      nUR                  SS5      nSUs=::  a  S::  d  O  [        S5      eT R                  S:X  a  [        nONT R                  S	:X  a  [        nO7T R                  S
:X  a  [        nO [        T R                  5      (       a  U 4S jnUR                   u  p‰T R"                  n
T R                  (       d  U
b  Sn
[$        R&                  " S5        U
c  [)        X˜5      n
U
[)        X˜5      :”  a$  [)        X˜5      n
[$        R&                  " SU
-  5        T R                  (       GaŽ  UR+                  SS9nX;SS2[        R,                  4   -  nT R.                  S:X  aÊ  [0        R2                  " UR5                  U5      5      u  pÍ[        R6                  " U5      SSS2   n[        R8                  " UR:                  5      R<                  S-  nXÏ:  n[        R>                  " U5      (       a  [$        R&                  " S5        XüU'   [        R@                  " XÌS9  XÎ   USS2U4   pÜO+T R.                  S:X  a  [0        RB                  " USSS9SS u  pÜW[        RD                  " US   5      -  nUW-  R
                  SU
 nAA[        R4                  " UU5      nU[        R@                  " U	5      -  nO
[G        USS9nT RH                  nUc.  [        RJ                  " URM                  Xª4S9UR:                  S9nO8[        RJ                  " U5      nUR                   Xª4:w  a  [        SSXª40-  5      eT RN                  WUT RP                  US.nT RR                  S:X  a  [U        U40 UD6u  nnOT RR                  S:X  a  [W        U40 UD6u  nnAWT l,        U(       a`  T R                  (       a-  [        R0                  R[                  WWU/5      R
                  nO$[        R4                  " WU5      R
                  nOSnT R                  (       a˜  T R                  S :X  a]  U(       d,  [        R0                  R[                  WWU/5      R
                  n[        R\                  " USS!S"9nUU-  nWUR
                  -  n[        R4                  " WW5      T l/        WT l0        UT l1        OWT l/        [0        Rd                  " T R^                  SS#9T l3        UT l4        U$ )$aü  Fit the model.

Parameters
----------
X : array-like of shape (n_samples, n_features)
    Training data, where `n_samples` is the number of samples
    and `n_features` is the number of features.

compute_sources : bool, default=False
    If False, sources are not computes but only the rotation matrix.
    This can save memory when working with big data. Defaults to False.

Returns
-------
S : ndarray of shape (n_samples, n_components) or None
    Sources matrix. `None` if `compute_sources` is `False`.
r   )r6   r(   Úensure_min_samplesNrU   r#   r0   zalpha must be in [1,2]ro   ra   r‹   c                 ó*   >• TR                   " U 40 UD6$ rŽ   )ru   )rZ   r?   r‘   s     €r   r>   Ú!FastICA._fit_transform.<locals>.gF  s   ø€ Ø—x’x Ñ. XÑ.Ð.r   z(Ignoring n_components with whiten=False.z/n_components is too large: it will be set to %sr`   r1   r$   é
   zfThere are some small singular values, using whiten_solver = 'svd' might lead to more accurate results.)Úoutrr   F)Úfull_matricesÚcheck_finiter   )r6   )Úsizer/   z/w_init has invalid shape -- should be %(shape)sr3   )r=   r>   r?   r@   rA   rm   rŠ   rn   T)r2   Úkeepdims)r›   )5Ú_validate_datart   r   Úfloat64Úfloat32r   r?   r   rw   rV   Ú
ValueErrorru   r^   rb   re   Úcallabler3   rB   rN   rO   Úminr8   rL   rv   r   r$   r%   Úargsortr'   r(   ÚepsÚanyr*   rr   Úsignr   rA   ÚasarrayÚnormalr=   r@   rs   rS   rI   r�   r   ÚstdÚcomponents_r   r~   ÚpinvÚmixing_r€   )r‘   r<   ri   ÚXTr?   rw   rU   r>   Ú
n_featuresÚ	n_samplesrB   r…   Údr,   Úsort_indicesr¥   Údegenerate_idxr„   ÚX1rA   Úkwargsr   rC   rƒ   ÚS_stds   `                        r   r}   ÚFastICA._fit_transform"  su  ø€ ð$ × Ñ Ø�D—K‘K¬¯
©
´B·J±JÐ'?ÐTUð !ð 
ç
‰!ð 	ð Ÿ™Ñ.‘2°D·M±MˆÜ)¨$×*;Ñ*;Ó<ˆà—‘˜W cÓ*ˆØ�E�˜Q�ÜÐ5Ó6Ð6à�8‰8�yÓ Ü‰AØ�X‰X˜ÓÜ‰AØ�X‰X˜ÓÜ‰AÜ�d—h‘h×Ñõ/ð !#§¡Ñˆ
Ø×(Ñ(ˆØ�{�{˜|Ñ7ØˆLÜ�MŠMÐDÔEàÑÜ˜yÓ5ˆLØœ#˜iÓ4Ó4Ü˜yÓ5ˆLÜ�MŠMØAÀLÑPôð �;�;ˆ;à—W‘W "�WÐ%ˆFØšœBŸJ™J˜Ñ'Ñ'ˆBð ×!Ñ! VÓ+ä—{’{ 2§6¡6¨!£9Ó-‘�Ü!Ÿzšz¨!›}©T¨r¨TÑ2�Ü—h’h˜qŸw™wÓ'×+Ñ+¨bÑ0�Ø!"¡�Ü—6’6˜.×)Ñ)Ü—M’Mð,ôð
 %(�.Ñ!Ü—’˜Ò!Ø‘¨ª!¨\¨/Ñ(:‘1Ø×#Ñ# uÓ,Ü—z’z "°EÈÑNÈrÐPQÐR‘�ð ”—’˜˜1™“ÑˆAà�Q‘—	‘	˜-˜<Ð(ˆAØ�1Ü—’˜˜2“ˆBð ”"—'’'˜)Ó$Ñ$‰Bô   ¨Ñ/ˆBà—‘ˆØ‰>Ü—Z’ZØ×#Ñ#¨,Ð)EÐ#ÐFÈbÏhÉhñ‰Fô
 —Z’Z Ó'ˆFØ�|‰| Ð;Ó;Ü ØEØ Ð <Ð=ñ>óð ð —8‘8ØØ ØŸ™Øñ
ˆð �>‰>˜ZÓ'Ü  Ñ. vÑ.‰IˆA‰vØ�^‰^˜{Ó*Ü  Ñ. vÑ.‰IˆAˆvØàˆŒæØ�{�{Ü—I‘I×'Ñ'¨¨A¨r¨
Ó3×5Ñ5‘ä—F’F˜1˜b“M—O‘O‘àˆAà�;�;Ø�{‰{˜oÓ-Þ&ÜŸ	™	×+Ñ+¨Q°°2¨JÓ7×9Ñ9�AÜŸš˜q q°4Ñ8�Ø�U‘
�Ø�U—W‘W‘�ä!Ÿvšv a¨›|ˆDÔØˆDŒJØˆD�Oà ˆDÔä—{’{ 4×#3Ñ#3À%ÑHˆŒØˆŒàˆr   Trk   c                 ó"   • U R                  USS9$ )aÍ  Fit the model and recover the sources from X.

Parameters
----------
X : array-like of shape (n_samples, n_features)
    Training data, where `n_samples` is the number of samples
    and `n_features` is the number of features.

y : Ignored
    Not used, present for API consistency by convention.

Returns
-------
X_new : ndarray of shape (n_samples, n_components)
    Estimated sources obtained by transforming the data with the
    estimated unmixing matrix.
Trz   ©r}   ©r‘   r<   Úys      r   Úfit_transformÚFastICA.fit_transform¶  s   € ð& ×"Ñ" 1°dÐ"Ð;Ð;r   c                 ó&   • U R                  USS9  U $ )aO  Fit the model to X.

Parameters
----------
X : array-like of shape (n_samples, n_features)
    Training data, where `n_samples` is the number of samples
    and `n_features` is the number of features.

y : Ignored
    Not used, present for API consistency by convention.

Returns
-------
self : object
    Returns the instance itself.
Frz   r¹   rº   s      r   ÚfitÚFastICA.fitË  s   € ð$ 	×Ñ˜A¨uÐÑ5Øˆr   c                 ó.  • [        U 5        U R                  X=(       a    U R                  [        R                  [        R
                  /SS9nU R                  (       a  XR                  -  n[        R                  " XR                  R                  5      $ )a÷  Recover the sources from X (apply the unmixing matrix).

Parameters
----------
X : array-like of shape (n_samples, n_features)
    Data to transform, where `n_samples` is the number of samples
    and `n_features` is the number of features.

copy : bool, default=True
    If False, data passed to fit can be overwritten. Defaults to True.

Returns
-------
X_new : ndarray of shape (n_samples, n_components)
    Estimated sources obtained by transforming the data with the
    estimated unmixing matrix.
F)r6   r(   Úreset)
r   rž   rt   r   rŸ   r    r   r%   r«   r   ©r‘   r<   r6   s      r   Ú	transformÚFastICA.transformà  sn   € ô$ 	˜Ôà×ÑØ×)˜dŸk™k´2·:±:¼r¿z¹zÐ2JÐRWð  ð 
ˆð �;�;Ø—‘‰OˆAä�vŠv�a×)Ñ)×+Ñ+Ó,Ð,r   c                 ó$  • [        U 5        [        X=(       a    U R                  [        R                  [        R
                  /S9n[        R                  " XR                  R                  5      nU R                  (       a  XR                  -  nU$ )aÑ  Transform the sources back to the mixed data (apply mixing matrix).

Parameters
----------
X : array-like of shape (n_samples, n_components)
    Sources, where `n_samples` is the number of samples
    and `n_components` is the number of components.
copy : bool, default=True
    If False, data passed to fit are overwritten. Defaults to True.

Returns
-------
X_new : ndarray of shape (n_samples, n_features)
    Reconstructed data obtained with the mixing matrix.
)r6   r(   )
r   r   rt   r   rŸ   r    r%   r­   r   r   rÃ   s      r   Úinverse_transformÚFastICA.inverse_transformü  s[   € ô  	˜Ôä˜×!5¨$¯+©+¼r¿z¹zÌ2Ï:É:Ð>VÑWˆÜ�FŠF�1—l‘l—n‘nÓ%ˆØ�;�;Ø—‘‰OˆAàˆr   c                 ó4   • U R                   R                  S   $ )z&Number of transformed output features.r   )r«   r3   ©r‘   s    r   Ú_n_features_outÚFastICA._n_features_out  s   € ð ×Ñ×%Ñ% aÑ(Ð(r   c                 óF   • S[         R                  [         R                  /0$ )NÚpreserves_dtype)r   r    rŸ   rÊ   s    r   Ú
_more_tagsÚFastICA._more_tags  s   € Ø!¤B§J¡J´·
±
Ð#;Ð<Ð<r   )r€   rs   r«   ru   r?   r@   r   r­   rB   r�   rw   r=   rA   rt   rv   r~   rŽ   )F)T)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r   Úboolr¢   Údictr   rŒ   Ú__annotations__r�   r}   r
   r¼   r¿   rÄ   rÇ   ÚpropertyrË   rÏ   Ú__static_attributes__Ú__classcell__)r’   s   @r   r   r   p  sE  ø‡ ñEñP " (¨A¨t¸FÑCÀTÐJÙ  *¨kÐ!:Ó;Ð<áÐ,¨oÐ>Ó?Ù�D˜5˜'Ó"ð
ñ Ò5Ó6¸ÐAØ˜4�LÙ˜h¨¨4¸Ñ?Ð@Ù˜˜s D°Ñ8Ð9Ø Ð&Ù$ f¨e _Ó5Ð6Ø'Ð(ñ$Ð˜Dó ð$ ð)ð ØØØØØØØØ÷)ñ )ô4Rñh °Ñ5ó<ó 6ð<ñ( °Ñ5óó 6ðô(-ô8ð2 ñ)ó ð)÷=ð =r   rŽ   )%rÕ   rN   Únumbersr   r   Únumpyr   Úscipyr   Úbaser   r   r	   r
   Ú
exceptionsr   Úutilsr   r   r   Úutils._param_validationr   r   r   r   Úutils.validationr   Ú__all__r   r-   rI   rS   r^   rb   re   r   r   © r   r   Ú<module>ræ      så   ðñó ß "ã Ý ÷ó õ ,ß CÑ Cß TÓ TÝ .à�iÐ
 €òò2Aò òFôD	ò!ò*ñ àˆ^Ø#˜Ø%˜;Ø#˜ñ	ð #(ñð ð@ð ØØØØØØØØØØØõ@óð@ôFk=Ð-Ð/?Àõ k=r   