Ë
    ÷Q(hOw  ã                   ó:  — d Z ddlmZmZ ddlZddlmZmZm	Z	m
Z
 ddlmZmZmZ ddlmZ ddlmZmZmZmZmZ dd	lmZ dd
lmZmZ ddlmZ ddlmZm Z m!Z! ddl"m#Z# ddl$m%Z%m&Z&m'Z' d(d„Z(d)d„Z)	 d*d„Z*ddddddddddœ	d„Z+ e!deg eeddd¬«      g eeddd¬«      g eeddd¬«      g e h d£«      g eeddd¬«      g eeddd¬«      g e h d £«      g eeddd¬«      g eeddd¬«      gd!gdegd"œd#¬$«      ddddddddddœ	d%„«       Z, G d&„ d'eeee«      Z-y)+zLocally Linear Embeddingé    )ÚIntegralÚRealN)ÚeighÚqrÚsolveÚsvd)Ú
csr_matrixÚeyeÚ
lil_matrix)Úeigshé   )ÚBaseEstimatorÚClassNamePrefixFeaturesOutMixinÚTransformerMixinÚ_fit_contextÚ_UnstableArchMixin)ÚNearestNeighbors)Úcheck_arrayÚcheck_random_state)Ú_init_arpack_v0)ÚIntervalÚ
StrOptionsÚvalidate_params)Ústable_cumsum)ÚFLOAT_DTYPESÚcheck_is_fittedÚvalidate_dataçü©ñÒMbP?c                 ó’  — t        | t        ¬«      } t        |t        ¬«      }t        |t        ¬«      }|j                  \  }}| j                  d   |k(  sJ ‚t	        j
                  ||f| j                  ¬«      }t	        j                  || j                  ¬«      }t        |«      D ]ž  \  }}	||	   }
|
| |   z
  }t	        j                  ||j                  «      }t	        j                  |«      }|dkD  r||z  }n|}|j                  dd|dz   …xx   |z  cc<   t        ||d¬«      }|t	        j                  |«      z  ||dd…f<   Œ  |S )aÙ  Compute barycenter weights of X from Y along the first axis

    We estimate the weights to assign to each point in Y[indices] to recover
    the point X[i]. The barycenter weights sum to 1.

    Parameters
    ----------
    X : array-like, shape (n_samples, n_dim)

    Y : array-like, shape (n_samples, n_dim)

    indices : array-like, shape (n_samples, n_dim)
            Indices of the points in Y used to compute the barycenter

    reg : float, default=1e-3
        Amount of regularization to add for the problem to be
        well-posed in the case of n_neighbors > n_dim

    Returns
    -------
    B : array-like, shape (n_samples, n_neighbors)

    Notes
    -----
    See developers note for more information.
    ©Údtyper   Né   Úpos)Úassume_a)r   r   ÚintÚshapeÚnpÚemptyr!   ÚonesÚ	enumerateÚdotÚTÚtraceÚflatr   Úsum)ÚXÚYÚindicesÚregÚ	n_samplesÚn_neighborsÚBÚvÚiÚindÚAÚCÚGr-   ÚRÚws                   ú^/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/sklearn/manifold/_locally_linear.pyÚbarycenter_weightsr@      s*  € ô6 	�Aœ\Ô*€AÜ�Aœ\Ô*€AÜ˜'¬Ô-€Gà$Ÿ]™]Ñ€Iˆ{Ø�7‰7�1‰:˜Ò"Ð"Ð"ä
�‰�)˜[Ð)°·±Ô9€AÜ
�‰� 1§7¡7Ô+€Aô ˜GÓ$ò  ‰ˆˆ3Øˆc‰FˆØ��!‘‰HˆÜ�F‰F�1�a—c‘c‹NˆÜ—‘˜“ˆØ�1Š9Ø�e‘‰AàˆAØ	�‰Ñ!�+ ‘/Ð!Ó" aÑ'Ó"Ü�!�Q Ô'ˆØ”b—f‘f˜Q“i‘-ˆˆ!ŠQˆ$Šð ð €Hó    c                 ó\  — t        |dz   |¬«      j                  | «      }|j                  } |j                  }|j	                  | d¬«      dd…dd…f   }t        | | ||¬«      }t        j                  d||z  dz   |«      }t        |j                  «       |j                  «       |f||f¬«      S )	a-  Computes the barycenter weighted graph of k-Neighbors for points in X

    Parameters
    ----------
    X : {array-like, NearestNeighbors}
        Sample data, shape = (n_samples, n_features), in the form of a
        numpy array or a NearestNeighbors object.

    n_neighbors : int
        Number of neighbors for each sample.

    reg : float, default=1e-3
        Amount of regularization when solving the least-squares
        problem. Only relevant if mode='barycenter'. If None, use the
        default.

    n_jobs : int or None, default=None
        The number of parallel jobs to run for neighbors search.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    Returns
    -------
    A : sparse matrix in CSR format, shape = [n_samples, n_samples]
        A[i, j] is assigned the weight of edge that connects i to j.

    See Also
    --------
    sklearn.neighbors.kneighbors_graph
    sklearn.neighbors.radius_neighbors_graph
    r"   ©r5   Ún_jobsF)Úreturn_distanceN©r3   r   ©r&   )
r   ÚfitÚ_fit_XÚn_samples_fit_Ú
kneighborsr@   r'   Úaranger	   Úravel)	r0   r5   r3   rD   Úknnr4   r9   ÚdataÚindptrs	            r?   Úbarycenter_kneighbors_graphrQ   R   s¢   € ôB  {°Q¡¸vÔ
F×
JÑ
JÈ1Ó
M€CØ�
‰
€AØ×"Ñ"€IØ
�.‰.˜¨Eˆ.Ó
2²1°a±b°5Ñ
9€CÜ˜a  C¨SÔ1€DÜ�Y‰Y�q˜) kÑ1°AÑ5°{ÓC€FÜ�t—z‘z“| S§Y¡Y£[°&Ð9À)ÈYÐAWÔXÐXrA   r"   ç�íµ ÷Æ°>éd   c                 óX  — |dk(  r| j                   d   dkD  r||z   dk  rd}nd}|dk(  rTt        | j                   d   |«      }	 t        | ||z   d|||¬«      \  }}	|	d
d
…|d
…f   t        j                  ||d
 «      fS |dk(  r{t        | d«      r| j                  «       } t        | |||z   dz
  fd¬«      \  }}	t        j                  t        j                  |«      «      }|	d
d
…|f   t        j                  |«      fS t	        d|z  «      ‚# t        $ r}
t	        d	|
z  «      |
‚d
}
~
ww xY w)a0  
    Find the null space of a matrix M.

    Parameters
    ----------
    M : {array, matrix, sparse matrix, LinearOperator}
        Input covariance matrix: should be symmetric positive semi-definite

    k : int
        Number of eigenvalues/vectors to return

    k_skip : int, default=1
        Number of low eigenvalues to skip.

    eigen_solver : {'auto', 'arpack', 'dense'}, default='arpack'
        auto : algorithm will attempt to choose the best method for input data
        arpack : use arnoldi iteration in shift-invert mode.
                    For this method, M may be a dense matrix, sparse matrix,
                    or general linear operator.
                    Warning: ARPACK can be unstable for some problems.  It is
                    best to try several random seeds in order to check results.
        dense  : use standard dense matrix operations for the eigenvalue
                    decomposition.  For this method, M must be an array
                    or matrix type.  This method should be avoided for
                    large problems.

    tol : float, default=1e-6
        Tolerance for 'arpack' method.
        Not used if eigen_solver=='dense'.

    max_iter : int, default=100
        Maximum number of iterations for 'arpack' method.
        Not used if eigen_solver=='dense'

    random_state : int, RandomState instance, default=None
        Determines the random number generator when ``solver`` == 'arpack'.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.
    Úautor   éÈ   é
   ÚarpackÚdenseg        )ÚsigmaÚtolÚmaxiterÚv0a	  Error in determining null-space with ARPACK. Error message: '%s'. Note that eigen_solver='arpack' can fail when the weight matrix is singular or otherwise ill-behaved. In that case, eigen_solver='dense' is recommended. See online documentation for more information.NÚtoarrayr"   T)Úsubset_by_indexÚoverwrite_azUnrecognized eigen_solver '%s')r&   r   r   ÚRuntimeErrorÚ
ValueErrorr'   r/   Úhasattrr^   r   ÚargsortÚabs)ÚMÚkÚk_skipÚeigen_solverr[   Úmax_iterÚrandom_stater]   Úeigen_valuesÚeigen_vectorsÚeÚindexs               r?   Ú
null_spacerp   |   sT  € ðT �vÒØ�7‰7�1‰:˜Ò  F¡
¨R¢Ø#‰Là"ˆLà�xÒÜ˜QŸW™W Q™Z¨Ó6ˆð	Ü*/Ø�1�v‘: S¨c¸8Èô+Ñ'ˆL˜-ð šQ ¡˜ZÑ(¬"¯&©&°¸f¸gÐ1FÓ*GÐGÐGØ	˜Ò	 Ü�1�iÔ Ø—	‘	“ˆAÜ&*Ø ¨¨F©
°Q©Ð7ÀTô'
Ñ#ˆ�mô —
‘
œ2Ÿ6™6 ,Ó/Ó0ˆØšQ ˜XÑ&¬¯©¨|Ó(<Ð<Ð<äÐ9¸LÑHÓIÐIøô' ò 	Üð6ð 9:ñ	:óð ðûð	ús   ÁD Ä	D)ÄD$Ä$D)rU   Ústandardç-Cëâ6?çê-�™—q=)	r3   ri   r[   rj   ÚmethodÚhessian_tolÚmodified_tolrk   rD   c          	      óè  — t        |dz   |¬«      }|j                  | «       |j                  } | j                  \  }}||kD  rt	        d«      ‚||k\  rt	        d||fz  «      ‚|dk7  }|rt
        nt        j                  }|dk(  r�t        ||||¬«      }|r3t        |j                  d|j                  iŽ|z
  }|j                  |z  }�nˆ|j                  |z  |j                  z
  |z
  j                  «       }|j                  d d |j                  d	   dz   …xx   dz  cc<   �n/|d
k(  �r||dz   z  dz  }|||z   k  rt	        d«      ‚|j                  | |dz   d¬«      }|d d …dd …f   }t        j                  |d|z   |z   ft        j                   ¬«      }d|d d …d	f<    |||ft        j                   ¬«      }||kD  }t#        |«      D �]i  }| ||      }||j%                  d	«      z  }|rt'        |d	¬«      d	   }n8t        j(                  ||j                  «      }t+        |«      d   d d …d d d…f   }|d d …d |…f   |d d …dd|z   …f<   d|z   }t#        |«      D ]3  }|d d …||dz   …f   |d d …||…f   z  |d d …|||z   |z
  …f<   |||z
  z  }Œ5 t-        |«      \  }}|d d …|dz   d …f   }|j/                  d	«      } d| t        j0                  t3        | «      |k  «      <   || z  }t        j4                  ||   ||   «      \  }!}"||!|"fxx   t        j(                  ||j                  «      z  cc<   �Œl �n|dk(  �r�||k  rt	        d«      ‚|j                  | |dz   d¬«      }|d d …dd …f   }t        j                  |||f«      }#t7        ||«      }$t        j                  ||$g«      }%||kD  }|r;t#        |«      D ]'  }| ||      | |   z
  }&t'        |&d¬«      \  |#|<   |%|<   }'Œ) |%dz  }%nft#        |«      D ]X  }| ||      | |   z
  }&t        j(                  |&|&j                  «      }(t+        |(«      \  })}*|)d d d…   |%|<   |*d d …d d d…f   |#|<   ŒZ d|%j/                  d«      z  }t        j(                  |#j9                  d	dd«      t        j:                  |«      «      }+|+d d …d |$…fxx   |%|d d …d f   z   z  cc<   |+d d …|$d …fxx   |d d …d f   z  cc<   t        j                  ||f«      },t#        |«      D ]!  }t        j(                  |#|   |+|   «      |,|<   Œ# |,|,j/                  d«      d d …d f   z  },|%d d …|d …f   j/                  d«      |%d d …d |…f   j/                  d«      z  }-t        j<                  |-«      }.t        j                  |t>        ¬«      }/tA        |%d«      }0|0d d …dd …f   |0d d …d d…f   z  dz
  }1t#        |«      D ]#  }t        jB                  |1|d d d…f   |.«      |/|<   Œ% |/||$z
  z  }/ |||ft        j                   ¬«      }t#        |«      D �]¦  }|/|   }2|#|d d …||2z
  d …f   }3t        jD                  jG                  |3j/                  d	«      «      t        jH                  |2«      z  }4t        jJ                  |2|4«      t        j(                  |3j                  t        j:                  |«      «      z
  }5t        jD                  jG                  |5«      }6|6|	k  r|5d	z  }5n|5|6z  }5|3dt        jL                  t        j(                  |3|5«      |5«      z  z
  d|4z
  |,|d d …d f   z  z   }7t        j4                  ||   ||   «      \  }!}"||!|"fxx   t        j(                  |7|7j                  «      z  cc<   |7j/                  d«      }8||||   fxx   |8z  cc<   |||   |gfxx   |8z  cc<   |||fxx   |2z  cc<   �Œ© �n„|dk(  �r~|j                  | |dz   d¬«      }|d d …dd …f   } |||ft        j                   ¬«      }||kD  }t#        |«      D �].  }| ||      }9|9|9j%                  d	«      z  }9|rt'        |9d¬«      d	   }:n8t        j(                  |9|9j                  «      }t+        |«      d   d d …d d d…f   }:t        j                  ||dz   f«      }|:d d …d |…f   |d d …dd …f<   dt        jH                  |«      z  |d d …d	f<   t        j(                  ||j                  «      };t        j4                  ||   ||   «      \  }!}"||!|"fxx   |;z  cc<   |||   ||   fxx   t        j:                  |¬«      z  cc<   �Œ1 |rjO                  «       }tQ        |d||||
¬«      S )Nr"   rC   z>output dimension must be less than or equal to input dimensionzHExpected n_neighbors <= n_samples,  but n_samples = %d, n_neighbors = %drY   rq   )r5   r3   rD   Úformatr   Úhessianr   z^for method='hessian', n_neighbors must be greater than [n_components * (n_components + 3) / 2]F©r5   rE   r    )Úfull_matriceséÿÿÿÿÚmodifiedz1modified LLE requires n_neighbors >= n_componentsTr   Últsag      ð?rG   )rh   ri   r[   rj   rk   ))r   rH   rI   r&   rb   r   r'   ÚzerosrQ   r
   rx   r,   r^   r.   rK   r(   Úfloat64ÚrangeÚmeanr   r+   r   r   r/   Úwherere   ÚmeshgridÚminÚ	transposer)   Úmedianr%   r   ÚsearchsortedÚlinalgÚnormÚsqrtÚfullÚouterÚtocsrrp   )<r0   r5   Ún_componentsr3   ri   r[   rj   rt   ru   rv   rk   rD   ÚnbrsÚNÚd_inÚM_sparseÚM_container_constructorÚWrf   ÚdpÚ	neighborsÚYiÚuse_svdr8   ÚGiÚUÚCiÚjrg   ÚQr=   r>   ÚSÚnbrs_xÚnbrs_yÚVÚnevÚevalsÚX_nbrsÚ_ÚC_nbrsÚeviÚviÚtmpÚw_regÚrhoÚetaÚs_rangeÚevals_cumsumÚ	eta_rangeÚs_iÚViÚalpha_iÚhÚnorm_hÚWiÚWi_sum1ÚXir7   ÚGiGiTs<                                                               r?   Ú_locally_linear_embeddingrº   È   sØ	  € ô ¨°a©ÀÔG€DØ‡H�HˆQ„KØ�‰€Aà�g‰g�G€A€tà�dÒÜØLó
ð 	
ð �aÒÜØVØ�+Ðñó
ð 	
ð
 ˜wÑ&€HÙ,4�j¼"¿(¹(Ðà�ÒÜ'Ø˜k¨s¸6ô
ˆñ Ü�Q—W‘WÐ. Q§X¡XÑ.°Ñ2ˆAØ—‘�a‘ŠAà—‘�q‘˜1Ÿ3™3‘ Ñ"×+Ñ+Ó-ˆAØ�F‰FÑ$�a—g‘g˜a‘j 1‘nÐ$Ó%¨Ñ*Õ%à	�9Ó	Ø˜\¨AÑ-Ñ.°!Ñ3ˆà˜,¨Ñ+Ò+Üð:óð ð —O‘OØ˜;¨™?¸Eð $ó 
ˆ	ð ša ¡˜eÑ$ˆ	ä�X‰X�{ A¨Ñ$4°rÑ$9Ð:Ä"Ç*Á*ÔMˆØˆŠ1ˆaˆ4‰á# Q¨ F´"·*±*Ô=ˆà Ñ$ˆä�q“ó 	0ˆAØ�9˜Q‘<‘ˆBØ�"—'‘'˜!“*ÑˆBñ Ü˜¨!Ô,¨QÑ/‘ä—V‘V˜B §¡Ó%�Ü˜“H˜Q‘K¢¡4 R 4 Ñ(�à*+ªA¨}°¨}Ð,<Ñ*=ˆBŠq�!�a˜,Ñ&Ð&Ð&Ñ'à�LÑ ˆAÜ˜<Ó(ò &�Ø23²A°q¸1¸q¹5°y°L±/ÀAÂaÈÈ<ÈÐFWÑDXÑ2X�’1�a˜!˜lÑ*¨QÑ.Ð.Ð.Ñ/Ø�\ AÑ%Ñ%‘ð&ô �b“6‰DˆAˆqà’!�\ AÑ%Ñ'Ð'Ñ(ˆAØ—‘�a“ˆAà01ˆAŒb�h‰h”s˜1“v Ñ+Ó,Ñ-Ø�‰FˆAäŸ[™[¨°1©°yÀ±|ÓD‰NˆF�FØˆf�fˆnÓ¤§¡¨¨1¯3©3£Ñ/Õò7	0ð: 
�:Ó	Ø˜Ò%ÜÐPÓQÐQà—O‘OØ˜;¨™?¸Eð $ó 
ˆ	ð ša ¡˜eÑ$ˆ	ô
 �H‰H�a˜ kÐ2Ó3ˆÜ�$˜Ó$ˆÜ—‘˜!˜S˜Ó"ˆð  Ñ$ˆáÜ˜1“Xò D�Ø˜9 Q™<™¨1¨Q©4Ñ/�Ü$'¨¸dÔ$CÑ!��!‘�e˜A‘h¡ðDð �a‰K‰Eä˜1“Xò #�Ø˜9 Q™<™¨1¨Q©4Ñ/�ÜŸ™ ¨¯©Ó1�Ü˜v›,‘��RØ™t ˜t™9��a‘Øš!™T˜r˜T˜'‘{��!’ð#ð �U—Y‘Y˜q“\Ñ!ˆä�f‰f�Q—[‘[  A qÓ)¬2¯7©7°;Ó+?Ó@ˆØŠAˆt�ˆtˆG‹˜ ¢A t G¡Ñ,Ñ,‹ØŠAˆs‰tˆG‹˜šA˜t˜G™Ñ$‹ä—‘˜!˜[Ð)Ó*ˆÜ�q“ò 	,ˆAÜ—v‘v˜a ™d C¨¡FÓ+ˆE�!ŠHð	,à�—‘˜1“ša ˜gÑ&Ñ&ˆð ’A�|‘}Ð$Ñ%×)Ñ)¨!Ó,¨u²Q¸¸¸Ð5EÑ/F×/JÑ/JÈ1Ó/MÑMˆÜ�i‰i˜‹nˆô
 —(‘(˜1¤CÔ(ˆÜ$ U¨AÓ.ˆØ ¢ B¡C Ñ(¨<º¸3¸B¸3¸Ñ+?Ñ?À!ÑCˆ	Ü�q“ò 	BˆAÜŸ™¨°1±d¸°d°7Ñ);¸SÓAˆG�AŠJð	Bà�; Ñ$Ñ$ˆñ $ Q¨ F´"·*±*Ô=ˆä�q“ó $	ˆAØ˜!‘*ˆCð �1’a˜ sÑ*Ñ,Ð,Ñ-ˆBÜ—i‘i—n‘n R§V¡V¨A£YÓ/´"·'±'¸#³,Ñ>ˆGô
 —‘˜˜WÓ%¬¯©¨r¯t©t´R·W±W¸[Ó5IÓ(JÑJˆAä—Y‘Y—^‘^ AÓ&ˆFØ˜Ò$Ø�Q‘‘à�V‘�ð �aœ"Ÿ(™(¤2§6¡6¨"¨a£=°!Ó4Ñ4Ñ4¸¸G¹ÀuÈQÒPQÐSWÈZÑGXÑ7XÑXˆBô  Ÿ[™[¨°1©°yÀ±|ÓD‰NˆF�FØˆf�fˆnÓ¤§¡¨¨B¯D©DÓ!1Ñ1ÓØ—f‘f˜Q“iˆGØˆa�˜1‘ˆoÓ 'Ñ)ÓØˆi˜‰l˜Q˜CÐÓ  GÑ+Ó Øˆa�ˆd‹G�s‰N�GòI$	ðL 
�6Ó	Ø—O‘OØ˜;¨™?¸Eð $ó 
ˆ	ð ša ¡˜eÑ$ˆ	á# Q¨ F´"·*±*Ô=ˆà Ñ$ˆä�q“ó 	HˆAØ�9˜Q‘<‘ˆBØ�"—'‘'˜!“*ÑˆBñ Ü˜¨$Ô/°Ñ2‘ä—V‘V˜B §¡Ó%�Ü˜“H˜Q‘K¢¡4 R 4 Ñ(�ä—‘˜;¨°qÑ(8Ð9Ó:ˆBØš!˜]˜l˜]Ð*Ñ+ˆBŠq�!‘"ˆu‰IØœRŸW™W [Ó1Ñ1ˆBŠq�!ˆt‰Hä—F‘F˜2˜rŸt™tÓ$ˆEäŸ[™[¨°1©°yÀ±|ÓD‰NˆF�FØˆf�fˆnÓ Ñ&Óàˆi˜‰l˜I a™LÐ(Ó)¬R¯W©W¸;Ô-GÑGÕ)ð)	Hñ, Ø�G‰G‹IˆäØ	ØØØ!ØØØ!ôð rA   z
array-likeÚleft©Úclosed>   rU   rY   rX   >   r~   ry   r}   rq   rk   ©r0   r5   r�   r3   ri   r[   rj   rt   ru   rv   rk   rD   T©Úprefer_skip_nested_validationc                ó0   — t        | |||||||||	|
|¬«      S )a³  Perform a Locally Linear Embedding analysis on the data.

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

    Parameters
    ----------
    X : {array-like, NearestNeighbors}
        Sample data, shape = (n_samples, n_features), in the form of a
        numpy array or a NearestNeighbors object.

    n_neighbors : int
        Number of neighbors to consider for each point.

    n_components : int
        Number of coordinates for the manifold.

    reg : float, default=1e-3
        Regularization constant, multiplies the trace of the local covariance
        matrix of the distances.

    eigen_solver : {'auto', 'arpack', 'dense'}, default='auto'
        auto : algorithm will attempt to choose the best method for input data

        arpack : use arnoldi iteration in shift-invert mode.
                    For this method, M may be a dense matrix, sparse matrix,
                    or general linear operator.
                    Warning: ARPACK can be unstable for some problems.  It is
                    best to try several random seeds in order to check results.

        dense  : use standard dense matrix operations for the eigenvalue
                    decomposition.  For this method, M must be an array
                    or matrix type.  This method should be avoided for
                    large problems.

    tol : float, default=1e-6
        Tolerance for 'arpack' method
        Not used if eigen_solver=='dense'.

    max_iter : int, default=100
        Maximum number of iterations for the arpack solver.

    method : {'standard', 'hessian', 'modified', 'ltsa'}, default='standard'
        standard : use the standard locally linear embedding algorithm.
                   see reference [1]_
        hessian  : use the Hessian eigenmap method.  This method requires
                   n_neighbors > n_components * (1 + (n_components + 1) / 2.
                   see reference [2]_
        modified : use the modified locally linear embedding algorithm.
                   see reference [3]_
        ltsa     : use local tangent space alignment algorithm
                   see reference [4]_

    hessian_tol : float, default=1e-4
        Tolerance for Hessian eigenmapping method.
        Only used if method == 'hessian'.

    modified_tol : float, default=1e-12
        Tolerance for modified LLE method.
        Only used if method == 'modified'.

    random_state : int, RandomState instance, default=None
        Determines the random number generator when ``solver`` == 'arpack'.
        Pass an int for reproducible results across multiple function calls.
        See :term:`Glossary <random_state>`.

    n_jobs : int or None, default=None
        The number of parallel jobs to run for neighbors search.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    Returns
    -------
    Y : ndarray of shape (n_samples, n_components)
        Embedding vectors.

    squared_error : float
        Reconstruction error for the embedding vectors. Equivalent to
        ``norm(Y - W Y, 'fro')**2``, where W are the reconstruction weights.

    References
    ----------

    .. [1] Roweis, S. & Saul, L. Nonlinear dimensionality reduction
        by locally linear embedding.  Science 290:2323 (2000).
    .. [2] Donoho, D. & Grimes, C. Hessian eigenmaps: Locally
        linear embedding techniques for high-dimensional data.
        Proc Natl Acad Sci U S A.  100:5591 (2003).
    .. [3] `Zhang, Z. & Wang, J. MLLE: Modified Locally Linear
        Embedding Using Multiple Weights.
        <https://citeseerx.ist.psu.edu/doc_view/pid/0b060fdbd92cbcc66b383bcaa9ba5e5e624d7ee3>`_
    .. [4] Zhang, Z. & Zha, H. Principal manifolds and nonlinear
        dimensionality reduction via tangent space alignment.
        Journal of Shanghai Univ.  8:406 (2004)

    Examples
    --------
    >>> from sklearn.datasets import load_digits
    >>> from sklearn.manifold import locally_linear_embedding
    >>> X, _ = load_digits(return_X_y=True)
    >>> X.shape
    (1797, 64)
    >>> embedding, _ = locally_linear_embedding(X[:100],n_neighbors=5, n_components=2)
    >>> embedding.shape
    (100, 2)
    r¾   )rº   r¾   s               r?   Úlocally_linear_embeddingrÂ   À  s6   € ôT %Ø
ØØ!ØØ!ØØØØØ!Ø!Øôð rA   c                   ó~  — e Zd ZU dZ eeddd¬«      g eeddd¬«      g eeddd¬«      g eh d£«      g eeddd¬«      g eeddd¬«      g eh d£«      g eeddd¬«      g eeddd¬«      g eh d	£«      gd
gdegdœZe	e
d<   dddddddddddddœd„Zd„ Z ed¬«      dd„«       Z ed¬«      dd„«       Zd„ Zy)ÚLocallyLinearEmbeddinga€  Locally Linear Embedding.

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

    Parameters
    ----------
    n_neighbors : int, default=5
        Number of neighbors to consider for each point.

    n_components : int, default=2
        Number of coordinates for the manifold.

    reg : float, default=1e-3
        Regularization constant, multiplies the trace of the local covariance
        matrix of the distances.

    eigen_solver : {'auto', 'arpack', 'dense'}, default='auto'
        The solver used to compute the eigenvectors. The available options are:

        - `'auto'` : algorithm will attempt to choose the best method for input
          data.
        - `'arpack'` : use arnoldi iteration in shift-invert mode. For this
          method, M may be a dense matrix, sparse matrix, or general linear
          operator.
        - `'dense'`  : use standard dense matrix operations for the eigenvalue
          decomposition. For this method, M must be an array or matrix type.
          This method should be avoided for large problems.

        .. warning::
           ARPACK can be unstable for some problems.  It is best to try several
           random seeds in order to check results.

    tol : float, default=1e-6
        Tolerance for 'arpack' method
        Not used if eigen_solver=='dense'.

    max_iter : int, default=100
        Maximum number of iterations for the arpack solver.
        Not used if eigen_solver=='dense'.

    method : {'standard', 'hessian', 'modified', 'ltsa'}, default='standard'
        - `standard`: use the standard locally linear embedding algorithm. see
          reference [1]_
        - `hessian`: use the Hessian eigenmap method. This method requires
          ``n_neighbors > n_components * (1 + (n_components + 1) / 2``. see
          reference [2]_
        - `modified`: use the modified locally linear embedding algorithm.
          see reference [3]_
        - `ltsa`: use local tangent space alignment algorithm. see
          reference [4]_

    hessian_tol : float, default=1e-4
        Tolerance for Hessian eigenmapping method.
        Only used if ``method == 'hessian'``.

    modified_tol : float, default=1e-12
        Tolerance for modified LLE method.
        Only used if ``method == 'modified'``.

    neighbors_algorithm : {'auto', 'brute', 'kd_tree', 'ball_tree'},                           default='auto'
        Algorithm to use for nearest neighbors search, passed to
        :class:`~sklearn.neighbors.NearestNeighbors` instance.

    random_state : int, RandomState instance, default=None
        Determines the random number generator when
        ``eigen_solver`` == 'arpack'. Pass an int for reproducible results
        across multiple function calls. See :term:`Glossary <random_state>`.

    n_jobs : int or None, default=None
        The number of parallel jobs to run.
        ``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
        ``-1`` means using all processors. See :term:`Glossary <n_jobs>`
        for more details.

    Attributes
    ----------
    embedding_ : array-like, shape [n_samples, n_components]
        Stores the embedding vectors

    reconstruction_error_ : float
        Reconstruction error associated with `embedding_`

    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

    nbrs_ : NearestNeighbors object
        Stores nearest neighbors instance, including BallTree or KDtree
        if applicable.

    See Also
    --------
    SpectralEmbedding : Spectral embedding for non-linear dimensionality
        reduction.
    TSNE : Distributed Stochastic Neighbor Embedding.

    References
    ----------

    .. [1] Roweis, S. & Saul, L. Nonlinear dimensionality reduction
        by locally linear embedding.  Science 290:2323 (2000).
    .. [2] Donoho, D. & Grimes, C. Hessian eigenmaps: Locally
        linear embedding techniques for high-dimensional data.
        Proc Natl Acad Sci U S A.  100:5591 (2003).
    .. [3] `Zhang, Z. & Wang, J. MLLE: Modified Locally Linear
        Embedding Using Multiple Weights.
        <https://citeseerx.ist.psu.edu/doc_view/pid/0b060fdbd92cbcc66b383bcaa9ba5e5e624d7ee3>`_
    .. [4] Zhang, Z. & Zha, H. Principal manifolds and nonlinear
        dimensionality reduction via tangent space alignment.
        Journal of Shanghai Univ.  8:406 (2004)

    Examples
    --------
    >>> from sklearn.datasets import load_digits
    >>> from sklearn.manifold import LocallyLinearEmbedding
    >>> X, _ = load_digits(return_X_y=True)
    >>> X.shape
    (1797, 64)
    >>> embedding = LocallyLinearEmbedding(n_components=2)
    >>> X_transformed = embedding.fit_transform(X[:100])
    >>> X_transformed.shape
    (100, 2)
    r"   Nr»   r¼   r   >   rU   rY   rX   >   r~   ry   r}   rq   >   rU   ÚbruteÚkd_treeÚ	ball_treerk   )r5   r�   r3   ri   r[   rj   rt   ru   rv   Úneighbors_algorithmrk   rD   Ú_parameter_constraintsé   r   r   rU   rR   rS   rq   rr   rs   c                ó¬   — || _         || _        || _        || _        || _        || _        || _        || _        |	| _        || _	        |
| _
        || _        y ©N)r5   r�   r3   ri   r[   rj   rt   ru   rv   rk   rÈ   rD   )Úselfr5   r�   r3   ri   r[   rj   rt   ru   rv   rÈ   rk   rD   s                r?   Ú__init__zLocallyLinearEmbedding.__init__ó  s_   € ð  'ˆÔØ(ˆÔØˆŒØ(ˆÔØˆŒØ ˆŒØˆŒØ&ˆÔØ(ˆÔØ(ˆÔØ#6ˆÔ Øˆ�rA   c                 óJ  — t        | j                  | j                  | j                  ¬«      | _        t        | j                  «      }t        | |t        ¬«      }| j                  j                  |«       t        | j                  | j                  | j                  | j                  | j                  | j                  | j                  | j                   | j"                  || j$                  | j                  ¬«      \  | _        | _        | j&                  j*                  d   | _        y )N)r5   Ú	algorithmrD   r    )r0   r5   r�   ri   r[   rj   rt   ru   rv   rk   r3   rD   r"   )r   r5   rÈ   rD   Únbrs_r   rk   r   ÚfloatrH   rº   r�   ri   r[   rj   rt   ru   rv   r3   Ú
embedding_Úreconstruction_error_r&   Ú_n_features_out)rÍ   r0   rk   s      r?   Ú_fit_transformz%LocallyLinearEmbedding._fit_transform  sÞ   € Ü%Ø×(Ñ(Ø×.Ñ.Ø—;‘;ô
ˆŒ
ô *¨$×*;Ñ*;Ó<ˆÜ˜$ ¬Ô/ˆØ�
‰
�‰�qÔÜ6OØ�j‰jØ×(Ñ(Ø×*Ñ*Ø×*Ñ*Ø—‘Ø—]‘]Ø—;‘;Ø×(Ñ(Ø×*Ñ*Ø%Ø—‘Ø—;‘;ô7
Ñ3ˆŒ˜Ô3ð  $Ÿ™×4Ñ4°QÑ7ˆÕrA   Tr¿   c                 ó(   — | j                  |«       | S )ay  Compute the embedding vectors for data X.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training set.

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

        Returns
        -------
        self : object
            Fitted `LocallyLinearEmbedding` class instance.
        )rÖ   ©rÍ   r0   Úys      r?   rH   zLocallyLinearEmbedding.fit*  s   € ð" 	×Ñ˜AÔØˆrA   c                 ó<   — | j                  |«       | j                  S )aœ  Compute the embedding vectors for data X and transform X.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training set.

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

        Returns
        -------
        X_new : array-like, shape (n_samples, n_components)
            Returns the instance itself.
        )rÖ   rÓ   rØ   s      r?   Úfit_transformz$LocallyLinearEmbedding.fit_transform>  s   € ð" 	×Ñ˜AÔØ�‰ÐrA   c                 óä  — t        | «       t        | |d¬«      }| j                  j                  || j                  d¬«      }t        || j                  j                  || j                  ¬«      }t        j                  |j                  d   | j                  f«      }t        |j                  d   «      D ]8  }t        j                  | j                  ||      j                  ||   «      ||<   Œ: |S )að  
        Transform new points into embedding space.

        Parameters
        ----------
        X : array-like of shape (n_samples, n_features)
            Training set.

        Returns
        -------
        X_new : ndarray of shape (n_samples, n_components)
            Returns the instance itself.

        Notes
        -----
        Because of scaling performed by this method, it is discouraged to use
        it together with methods that are not scale-invariant (like SVMs).
        F)Úresetrz   rF   r   )r   r   rÑ   rK   r5   r@   rI   r3   r'   r(   r&   r�   r�   r+   rÓ   r,   )rÍ   r0   r9   ÚweightsÚX_newr8   s         r?   Ú	transformz LocallyLinearEmbedding.transformR  sÏ   € ô& 	˜Ôä˜$ ¨Ô/ˆØ�j‰j×#Ñ#Ø˜4×+Ñ+¸Uð $ó 
ˆô % Q¨¯
©
×(9Ñ(9¸3ÀDÇHÁHÔMˆÜ—‘˜!Ÿ'™' !™* d×&7Ñ&7Ð8Ó9ˆÜ�q—w‘w˜q‘zÓ"ò 	EˆAÜ—v‘v˜dŸo™o¨c°!©fÑ5×7Ñ7¸À¹ÓDˆE�!ŠHð	EàˆrA   rÌ   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   rÉ   ÚdictÚ__annotations__rÎ   rÖ   r   rH   rÛ   rà   © rA   r?   rÄ   rÄ   Z  s*  … ñBñJ ! ¨1¨d¸6ÔBÐCÙ! (¨A¨t¸FÔCÐDÙ˜˜q $¨vÔ6Ð7Ù#Ò$?Ó@ÐAÙ˜˜q $¨vÔ6Ð7Ù˜h¨¨4¸Ô?Ð@ÙÒIÓJÐKÙ   q¨$°vÔ>Ð?Ù! $¨¨4¸Ô?Ð@Ù *Ò+TÓ UÐVØ'Ð(Ø˜Ð"ñ$Ð˜Dó ð$ ØØØØØØØØØ"ØØôò:8ñ4 °Ô5òó 6ðñ& °Ô5òó 6ðó&rA   rÄ   )r   )r   N)r"   rX   rR   rS   N).rä   Únumbersr   r   Únumpyr'   Úscipy.linalgr   r   r   r   Úscipy.sparser	   r
   r   Úscipy.sparse.linalgr   Úbaser   r   r   r   r   r—   r   Úutilsr   r   Úutils._arpackr   Úutils._param_validationr   r   r   Úutils.extmathr   Úutils.validationr   r   r   r@   rQ   rp   rº   rÂ   rÄ   rç   rA   r?   ú<module>ró      s„  ðÙ ÷
 #ã ß -Ó -ß 4Ñ 4Ý %÷õ õ )ß 3Ý +ß KÑ KÝ )ß KÑ Kó3ól'YðV QUóIJðb 	ØØØØØØØØôuñp àÐ,Ð-Ù  ¨1¨d¸6ÔBÐCÙ! (¨A¨t¸FÔCÐDÙ˜˜q $¨vÔ6Ð7Ù#Ò$?Ó@ÐAÙ˜˜q $¨vÔ6Ð7Ù˜h¨¨4¸Ô?Ð@ÙÒIÓJÐKÙ   q¨$°vÔ>Ð?Ù! $¨¨4¸Ô?Ð@Ø'Ð(Ø˜Ð"ñð #'ôð, 	ØØØØØØØØóFó#ð"FôRUØ#ØØØõ	UrA   