ó
    †ñ:i•O  ã                   ó€   • S SK r S SKrS SKrS SKJr  S SKJr  SSK	J
r
Jr  SSKJrJrJr  SSKJr   " S	 S
\5      rS rg)é    N)Úissparse)Útqdmé   )ÚlinksÚmaskers)ÚDimensionErrorÚInvalidFeaturePerturbationErrorÚInvalidModelErroré   )Ú	Explainerc                   ó|   ^ • \ rS rSrSr\R                  SS4U 4S jjrS r\	S 5       r
\	S 5       rS	 rS
 rSrU =r$ )ÚLinearExplaineré   aö  Computes SHAP values for a linear model, optionally accounting for inter-feature correlations.

This computes the SHAP values for a linear model and can account for the
correlations among the input features. Assuming features are independent
leads to interventional SHAP values which for a linear model are ``coef[i] *
(x[i] - X.mean(0)[i])`` for the ith feature. If instead we account for
correlations, then we prevent any problems arising from collinearity and
share credit among correlated features. Accounting for correlations can be
computationally challenging, but ``LinearExplainer`` uses sampling to
estimate a transform that can then be applied to explain any prediction of
the model.

Parameters
----------
model : (coef, intercept) or sklearn.linear_model.*
    User supplied linear model either as either a parameter pair or sklearn object.

masker : function, numpy.array, pandas.DataFrame, tuple of (mean, cov), shap.maskers.Masker
    A callable Python object used to "mask" out hidden features of the form
    ``masker(binary_mask, x)``. It takes a single input sample and a binary
    mask and returns a matrix of masked samples. These masked samples are
    evaluated using the model function and the outputs are then averaged.

    As a shortcut for the standard masking using by SHAP you can pass a
    background data matrix instead of a function and that matrix will be
    used for masking.

    You can also provide a tuple of ``(mean, covariance)``, or pass in a
    masker meant for tabular data (i.e., :class:`.maskers.Independent`,
    :class:`.maskers.Impute`, or :class:`.maskers.Partition`) directly.

data : (mean, cov), numpy.array, pandas.DataFrame, iml.DenseData or scipy.csr_matrix
    The background dataset to use for computing conditional expectations.
    Note that only the mean and covariance of the dataset are used. This
    means passing a raw data matrix is just a convenient alternative to
    passing the mean and covariance directly.

nsamples : int
    Number of samples to use when estimating the transformation matrix used
    to account for feature correlations.

feature_perturbation : None (default), "interventional" or "correlation_dependent"

    DEPRECATED: this option is now deprecated in favor of using the appropriate
    tabular masker and will be removed in a future release.

    There are two ways we might want to compute SHAP values, either the full
    conditional SHAP values or the interventional SHAP values.

    - For interventional SHAP values we break any dependence structure between
      features in the model and so uncover how the model would behave if we
      intervened and changed some of the inputs. This approach is used by the
      Independent and Partition maskers.
    - For the full conditional SHAP values we respect the correlations among the
      input features, so if the model depends on one input but that input is
      correlated with another input, then both get some credit for the model's
      behavior. This approach is used by the Impute masker.

    The interventional option stays "true to the model" meaning it will only
    give credit to features that are actually used by the model, while the
    correlation option stays "true to the data" in the sense that it only
    considers how the model would behave when respecting the correlations in
    the input data. For sparse case only interventional option is supported.


Examples
--------
See `Linear explainer examples <https://shap.readthedocs.io/en/latest/api_examples/explainers/LinearExplainer.html>`_

éè  Nc                 óØ  >• SU;   a  Sn[        U5      eUb  Sn[        R                  " U[        5        OSnUS;  a  Sn[	        U5      eXPl        [        U[        R                  5      (       dH  [        U[        R                  5      (       d  [        U5      (       aW  [        UR                  5      S:X  a>  U R
                  S:X  a  [        R                  " U5      nO’[        R                   " U5      nO{[#        [%        U5      [&        5      (       a]  [        U5      S:X  aN  U R
                  S:X  a  [        R                  " US	   US
   S.SS9nO[        R                   " US	   US
   S.5      n[(        TU ]T  " X4SU0UD6  X@l        [.        R1                  U5      u  U l        U l        [#        [%        U R6                  5      [        R                   [        R8                  45      (       a  SU l        OE[#        [%        U R6                  5      [        R                  5      (       a  SU l        O[;        S5      e[=        U R6                  SS 5      n	[        U	[        R                  5      (       a  U	R>                  n	[=        U R6                  SS 5      b8  U R6                  R@                  U l         U R6                  RB                  U l!        GOX[        U	[D        5      (       a­  [        U	5      S:X  až  U	S   U l         [        U R@                  [        RF                  5      (       a  U R@                  R>                  U l         U	S   U l!        [        U RB                  [        R                  5      (       a  U RB                  R>                  U l!        GO–[        U	[&        5      (       a¬  [        U	5      S:X  a�  U	S	   U l         [        U R@                  [        RF                  5      (       a  U R@                  R>                  U l         U	S
   U l!        [        U RB                  [        R                  5      (       a  U RB                  R>                  U l!        OÕU	c  [        S5      e[        U	5      (       aO  [        RH                  " [        R@                  " U	S	5      5      S	   U l         U R
                  S:w  a  [;        S5      eOh[        RH                  " [        R@                  " U	S	5      5      RK                  5       U l         U R
                  S:X  a  [        RB                  " U	SS9U l!        [        U R@                  5      (       d2  [M        [%        U R@                  5      5      RO                  S5      (       a”  [        RP                  " U R2                  U R@                  5      U R4                  -   U l)        [        U RR                  5      S
:X  a  U RR                  S   U l)        Of[        RH                  " U RR                  5      S	   U l)        O=[        RP                  " U R2                  U R@                  5      U R4                  -   U l)        [        U R@                  5      U l*        U R
                  S:X  Ga9  [        RV                  " [        RX                  " U RB                  5      S:„  5      S	   U l-        U R@                  U RZ                     U l         U RB                  S S 2U RZ                  4   U RZ                  S S 24   U l!        U R2                  U RZ                     U l        []        U RB                  5      u  U l/        n
[        R`                  " [        R`                  " U R^                  U RB                  5      U R^                  Rb                  5      U l!        [        R`                  " U R^                  U R@                  5      U l         [        R`                  " X R2                  5      U l        [        Rd                  Rg                  U RB                  5      u  p¼URi                  5       S:  aB  U RB                  [        Rj                  " U RB                  R                  S	   5      S-  -   U l!        U Rm                  U5      u  pÞ[        R`                  " XÐR@                  5      U l7        Xàl8        g U R
                  S:X  a  US:w  a  [        R                  " S5        g g [	        SU R
                  -   5      e)NÚfeature_dependencezGThe option feature_dependence has been renamed to feature_perturbation!z–The feature_perturbation option is now deprecated in favor of using the appropriate masker (maskers.Independent, maskers.Partition or maskers.Impute).Úinterventional)r   Úcorrelation_dependentzOfeature_perturbation must be one of 'interventional' or 'correlation_dependent'r   r   r   r   )ÚmeanÚcovÚlinear)ÚmethodÚlinkz\The Linear explainer only supports the Independent, Partition, and Impute maskers right now!Údatar   r   z0A background data distribution must be provided!úIOnly feature_perturbation = 'interventional' is supported for sparse dataF)Úrowvarzmatrix'>©r   r   ç:Œ0âŽyE>gH¯¼šò×z>g�íµ ÷Æ°>r   zLSetting nsamples has no effect when feature_perturbation = 'interventional'!z/Unknown type of feature_perturbation provided: )9Ú
ValueErrorÚwarningsÚwarnÚFutureWarningr	   Úfeature_perturbationÚ
isinstanceÚpdÚ	DataFrameÚnpÚndarrayr   ÚlenÚshaper   ÚImputeÚIndependentÚ
issubclassÚtypeÚtupleÚsuperÚ__init__Únsamplesr   Ú_parse_modelÚcoefÚ	interceptÚmaskerÚ	PartitionÚNotImplementedErrorÚgetattrÚvaluesr   r   ÚdictÚSeriesÚarrayÚflattenÚstrÚendswithÚdotÚexpected_valueÚMÚwhereÚdiagÚ
valid_indsÚduplicate_componentsÚavg_projÚmatmulÚTÚlinalgÚeigÚminÚeyeÚ_estimate_transformsÚmean_transformedÚx_transform)ÚselfÚmodelr6   r   r2   r#   ÚkwargsÚemsgÚwmsgr   Úsum_projÚeÚ_Úmean_transformrQ   Ú	__class__s                  €ÚZ/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/shap/explainers/_linear.pyr1   ÚLinearExplainer.__init__Y   sR  ø€ Ø 6Ó)Ø\ˆDÜ˜TÓ"Ð"àÑ+ðUð ô �MŠM˜$¤Õ.à#3Ð àÐ'RÓRØdˆDÜ1°$Ó7Ð7Ø$8Ô!ô
 �fœbŸl™l×+Ñ+Ü˜¤§
¡
×+Ñ+¬x¸×/?Ñ/?ÄSÈÏÉÓEVÐZ[ÓE[à×(Ñ(Ð,CÓCÜ Ÿš¨Ó/‘ä ×,Ò,¨VÓ4‘Üœ˜V›¤e×,Ñ,´°V³ÀÓ1AØ×(Ñ(Ð,CÓCÜ Ÿš°¸±À6È!Á9Ñ(MÐV^Ñ_‘ä ×,Ò,°f¸Q±iÈÈqÉ	Ñ-RÓS�ä‰Ò˜Ñ<¨TÐ<°VÒ<à Œô %4×$@Ñ$@ÀÓ$GÑ!ˆŒ	�4”>ô ”d˜4Ÿ;™;Ó'¬'×*=Ñ*=¼w×?PÑ?PÐ)Q×RÑRØ(8ˆDÕ%Üœ˜TŸ[™[Ó)¬7¯>©>×:Ñ:Ø(?ˆDÕ%ä%Ønóð ô �t—{‘{ F¨DÓ1ˆô �dœBŸL™L×)Ñ)Ø—;‘;ˆDô �4—;‘; ¨Ó-Ñ9ØŸ™×(Ñ(ˆDŒIØ—{‘{—‘ˆDŽHÜ˜œd×#Ñ#¬¨D«	°Q«Ø˜V™ˆDŒIÜ˜$Ÿ)™)¤R§Y¡Y×/Ñ/Ø ŸI™I×,Ñ,�”	à˜E‘{ˆDŒHÜ˜$Ÿ(™(¤B§L¡L×1Ñ1ØŸ8™8Ÿ?™?�”ùÜ˜œe×$Ñ$¬¨T«°a«Ø˜Q™ˆDŒIÜ˜$Ÿ)™)¤R§Y¡Y×/Ñ/Ø ŸI™I×,Ñ,�”	à˜A‘wˆDŒHÜ˜$Ÿ(™(¤B§L¡L×1Ñ1ØŸ8™8Ÿ?™?�”øØ‰\ÜÐOÓPÐPä˜�~‰~ÜŸHšH¤R§W¢W¨T°1Ó%5Ó6°qÑ9�”	Ø×,Ñ,Ð0@Ó@Ü-Øcóð ð Aô
 ŸHšH¤R§W¢W¨T°1Ó%5Ó6×>Ñ>Ó@�”	Ø×,Ñ,Ð0GÓGÜ!Ÿvšv d°5Ñ9�D”Hô �D—I‘I×Ñ¤#¤d¨4¯9©9£oÓ"6×"?Ñ"?À
×"KÑ"Kô #%§&¢&¨¯©°D·I±IÓ">ÀÇÁÑ"OˆDÔô �4×&Ñ&Ó'¨1Ó,Ø&*×&9Ñ&9¸$Ñ&?�Õ#ä&(§h¢h¨t×/BÑ/BÓ&CÀAÑ&F�Õ#ä"$§&¢&¨¯©°D·I±IÓ">ÀÇÁÑ"OˆDÔä�T—Y‘Y“ˆŒð ×$Ñ$Ð(?Ô?Ü Ÿhšh¤r§w¢w¨t¯x©xÓ'8¸4Ñ'?Ó@ÀÑCˆDŒOØŸ	™	 $§/¡/Ñ2ˆDŒIØ—x‘x¢ 4§?¡?Ð 2Ñ3°D·O±OÂQÐ4FÑGˆDŒHØŸ	™	 $§/¡/Ñ2ˆDŒIô ';¸4¿8¹8Ó&DÑ#ˆDŒM˜8Ü—y’y¤§¢¨4¯=©=¸$¿(¹(Ó!CÀTÇ]Á]Ç_Á_ÓUˆDŒHÜŸ	š	 $§-¡-°·±Ó;ˆDŒIÜŸ	š	 (¯I©IÓ6ˆDŒIô —9‘9—=‘= §¡Ó*‰DˆAØ�u‰u‹w˜‹~ØŸ8™8¤b§f¢f¨T¯X©X¯^©^¸AÑ->Ó&?À$Ñ&FÑF�”à*.×*CÑ*CÀHÓ*MÑ'ˆNÜ$&§I¢I¨n¿i¹iÓ$HˆDÔ!Ø*ÕØ×&Ñ&Ð*:Ó:Ø˜4ÓÜ—’ÐlÕmð  ô 2ØAÀD×D]ÑD]Ñ]óð ó    c           	      óž  • [        U R                  5      n[        R                  " X"45      n[        R                  " X"45      n[        R                  " U[
        S9n[        [        U5      S5       GHM  n[        R                  R                  U5        [        R                  " S5      n[        R                  " US45      n[        U5       GHì  n	XY   n
UnUnU R                  SS2USU	S-    4   nXŠSS24   R                  n[        R                  " XÍ5      nU R                  Xª4   nU[        R                  " UR                  U5      -
  n[        R                  " U	S-   U	S-   45      nU	S:”  a;  U[        R                  " Xî5      U-  -   USS2SS24'   U* U-  =USS2S4'   USSS24'   SU-  US'   X:U
4==   U R                  U
   -  ss'   [        R                  " U R                  XYS-   S    [        R                  " X‡5      XYS-   S    5      nX:USU	S-    4==   U-  ss'   [        R                  " U R                  XYS    [        R                  " X¼5      XYS    5      nX:USU	 4==   U-  ss'   XJU
4==   U R                  U
   -  ss'   XJUSU	S-    4==   U-  ss'   XJUSU	 4==   U-  ss'   GMï     GMP     X1-  nXA-  nX44$ )	a  Uses block matrix inversion identities to quickly estimate transforms.

After a bit of matrix math we can isolate a transform matrix (# features x # features)
that is independent of any sample we are explaining. It is the result of averaging over
all feature permutations, but we just use a fixed number of samples to estimate the value.

TODO: Do a brute force enumeration when # feature subsets is less than nsamples. This could
      happen through a recursive method that uses the same block matrix inversion as below.
©ÚdtypezEstimating transformsr   r   Nr   éÿÿÿÿ)rb   rb   )r)   r4   r'   ÚzerosÚarangeÚintr   ÚrangeÚrandomÚshuffler   rJ   rI   Úouter)rR   r2   rC   rZ   rQ   ÚindsrY   Úcov_inv_SiSiÚcov_SiÚjÚiÚcov_SÚ
cov_inv_SSÚdÚtÚZÚuÚ	coef_R_SiÚcoef_R_Ss                      r\   rO   Ú$LinearExplainer._estimate_transformsâ   sÍ  € ô �—	‘	‹NˆäŸš 1 &Ó)ˆÜ—h’h ˜vÓ&ˆÜ�yŠy˜¤#Ñ&ˆÜ”e˜H“oÐ'>×?ˆAÜ�I‰I×Ñ˜dÔ#ÜŸ8š8 FÓ+ˆLÜ—X’X˜q !˜fÓ%ˆFÜ˜1—X�Ø‘G�ð �Ø)�
ð Ÿ™¢! T¨'¨A°©E ]Ð"2Ñ3�ð ˜c˜r˜c˜6‘N×$Ñ$�Ü—I’I˜jÓ,�Ø—H‘H˜Q˜T‘N�ØœŸ	š	 !§#¡# qÓ)Ñ)�Ü!Ÿxšx¨¨Q©°°A±¨Ó7�Ø�q“5Ø-7¼"¿(º(À1».È1Ñ:LÑ-L�L  "  c r c Ñ*ØEFÀBÈÁFÐJ�L  "  b Ñ)¨L¸¸S¸b¸S¸Ñ,AØ'(¨1¡u�˜VÑ$ð  !˜tÓ$¨¯	©	°!©Ñ4Ó$ô ŸIšI d§i¡i°¸±U°W°Ñ&>ÄÇ	Â	È&Ó@_Ð`dÐijÑejÐelÐ`mÑ@nÓo�	Ø $ w¨¨Q© -Ð/Ó0°IÑ=Ó0ô Ÿ9š9 T§Y¡Y¨t°B¨xÑ%8¼"¿)º)ÀEÓ:VÐW[Ð\^ÐW_Ñ:`Óa�Ø $ r¨ (˜{Ó+¨xÑ7Ó+ð ˜q˜DÓ! T§Y¡Y¨q¡\Ñ1Ó!ð ˜t G a¨!¡e˜}Ð,Ó-°Ñ:Ó-ð ˜t B Q˜x˜KÓ(¨HÑ4Ö(ôO ñ	 @ðZ 	Ñ"ˆØÑˆØÐ*Ð*r^   c                 ó  • [        U [        5      (       a  [        U 5      S:X  a  U S   nU S   nX4$ [        U S5      (       aŒ  [        U S5      (       a{  [        U R                  R
                  5      S:”  a=  U R                  R
                  S   S:X  a   U R                  S   n U R                  S   nOU R                  nU R                  nX4$ [        S[        [        U 5      5      -   5      e! [         a    U R                  n N;f = f)zOAttempt to pull out the coefficients and intercept from the given model object.r   r   r   Úcoef_Ú
intercept_z"An unknown model type was passed: )r$   r/   r)   Úhasattrry   r*   rz   Ú	TypeErrorr
   r?   r.   )rS   r4   r5   s      r\   r3   ÚLinearExplainer._parse_model"  sú   € ô �eœU×#Ñ#¬¨E«
°a«Ø˜‘8ˆDØ˜a™ˆIð" ˆÐô �U˜G×$Ñ$¬°¸×)EÑ)Eä�5—;‘;×$Ñ$Ó%¨Ó)¨e¯k©k×.?Ñ.?ÀÑ.BÀaÓ.GØ—{‘{ 1‘~�ð1Ø %× 0Ñ 0°Ñ 3‘Ið —{‘{�Ø!×,Ñ,�	ð ˆÐô $Ð$HÌ3ÌtÐTYË{ÓK[Ñ$[Ó\Ð\øô !ó 1Ø %× 0Ñ 0’Ið1ús   Â$C/ Ã/DÄDc                 óÎ   • [        U[        R                  [        R                  [        R                  45      (       d  g [
        R                  U 5        g! [         a     gf = f)z+Determines if we can parse the given model.FT)r$   r   r,   r7   r+   r   r3   Ú	Exception)rS   r6   s     r\   Úsupports_model_with_maskerÚ*LinearExplainer.supports_model_with_masker;  sW   € ô ˜&¤7×#6Ñ#6¼×8IÑ8IÌ7Ï>É>Ð"Z×[Ñ[Øð	Ü×(Ñ(¨Ô/ð øô ó 	Ùð	ús   ÁA Á
A$Á#A$c                ó  • [        U5      S:X  d   S5       eUS   n[        UR                  5      S:X  a  UR                  SS5      n[        U[        R
                  [        R                  45      (       a  UR                  n[        UR                  5      S;  a!  [        S[        UR                  5       35      eU R                  S:X  añ  [        U5      (       a  [        S5      e[        R                  " [        R                  " US	S	2U R                  4   U R                  R                   5      U R"                  R                   5      U R$                  -
  n	[        R                  " X�R                  5      n	[        R&                  " U	R                  S   U R(                  45      n
XšS	S	2U R                  4'   U
n	O‘U R                  S
:X  a�  [        U5      (       aB  [        R*                  " [        R,                  " X€R.                  -
  U R0                  5      5      n	O/[        R*                  " X€R.                  -
  5      U R0                  -  n	W	R                   U R2                  UR                  SS	 4U	R                   S	S.$ )z_Explains a single row and returns the tuple (row_values, row_expected_values, row_mask_shapes).r   zEOnly single-argument functions are supported by the Linear explainer!r   rb   ©r   r   ú+Instance must have 1 or 2 dimensions! Not: r   r   Nr   )r:   Úexpected_valuesÚmask_shapesÚmain_effectsÚ
clustering)r)   r*   Úreshaper$   r%   r<   r&   r:   r   r#   r   r	   r'   rI   rF   rH   rJ   rQ   rP   rc   rC   r=   Úmultiplyr   r4   rB   )rR   Ú	max_evalsr‡   Úerror_boundsÚ
batch_sizeÚoutputsÚsilentÚrow_argsÚXÚphiÚfull_phis              r\   Úexplain_rowÚLinearExplainer.explain_rowG  sä  € ä�8‹} Ó!ÐjÐ#jÓjÐ!à�Q‰KˆÜˆq�w‰w‹<˜1ÓØ—	‘	˜!˜RÓ ˆAô �aœ"Ÿ)™)¤R§\¡\Ð2×3Ñ3Ø—‘ˆAäˆq�w‰w‹<˜vÓ%Ü Ð#NÌsÐST×SZÑSZË|ÈnÐ!]Ó^Ð^à×$Ñ$Ð(?Ó?Ü˜�{‰{Ü5Ø_óð ô —	’	œ"Ÿ)š) A¢a¨¯©Ð&8Ñ$9¸4¿=¹=¿?¹?ÓKÈT×M]ÑM]×M_ÑM_Ó`Ðcg×cxÑcxÑxð ô —)’)˜C§¡Ó/ˆCä—x’x §¡¨1¡¨t¯v©vÐ 6Ó7ˆHØ+.’Q˜Ÿ™Ð'Ñ(Ø‰Cà×&Ñ&Ð*:Ó:Ü˜�{‰{Ü—h’hœrŸ{š{¨1¯y©y©=¸$¿)¹)ÓDÓE‘ô —h’h˜q§9¡9™}Ó-°·	±	Ñ9�ð —e‘eØ#×2Ñ2ØŸG™G A B˜K˜>ØŸE™EØñ
ð 	
r^   c                 ó¬  • [        U[        R                  [        R                  45      (       a  UR                  n[        UR                  5      S;  a!  [        S[        UR                  5       35      eU R                  S:X  að  [        U5      (       a  [        S5      e[        R                  " [        R                  " USS2U R                  4   U R                  R                  5      U R                   R                  5      U R"                  -
  n[        R                  " X R                  5      n[        R$                  " UR                  S   U R&                  45      nX#SS2U R                  4'   U$ U R                  S:X  GaÄ  [        U5      (       aì  [        U R(                  R                  5      S:X  aA  [        R*                  " [        R,                  " XR.                  -
  U R(                  5      5      $ [        R0                  " [3        U R(                  R                  S   5       Vs/ s HG  n[        R*                  " [        R,                  " XR.                  -
  U R(                  U   5      5      PMI     snS	S
9$ [        U R(                  R                  5      S:X  a/  [        R*                  " XR.                  -
  5      U R(                  -  $ [        R0                  " [3        U R(                  R                  S   5       Vs/ s H5  n[        R*                  " XR.                  -
  5      U R(                  U   -  PM7     snS	S
9$ gs  snf s  snf )ag  Estimate the SHAP values for a set of samples.

Parameters
----------
X : numpy.array, pandas.DataFrame or scipy.csr_matrix
    A matrix of samples (# samples x # features) on which to explain the model's output.

Returns
-------
np.array
    Estimated SHAP values, usually of shape ``(# samples x # features)``.

    Each row sums to the difference between the model output for that
    sample and the expected value of the model output (which is stored
    as the ``expected_value`` attribute of the explainer).

    The shape of the returned array depends on the number of model outputs:

    * one output: array of shape ``(#num_samples, *X.shape[1:])``.
    * multiple outputs: array of shape ``(#num_samples, *X.shape[1:],
      #num_outputs)``.

    .. versionchanged:: 0.45.0
        Return type for models with multiple outputs changed from list to np.ndarray.

rƒ   r„   r   r   Nr   r   r   rb   )Úaxis)r$   r%   r<   r&   r:   r)   r*   r   r#   r   r	   r'   rI   rF   rH   rJ   rQ   rP   rc   rC   r4   r=   rŠ   r   Ústackrf   )rR   r‘   r’   r“   rn   s        r\   Úshap_valuesÚLinearExplainer.shap_values|  sg  € ô8 �aœ"Ÿ)™)¤R§\¡\Ð2×3Ñ3Ø—‘ˆAô ˆq�w‰w‹<˜vÓ%Ü Ð#NÌsÐST×SZÑSZË|ÈnÐ!]Ó^Ð^à×$Ñ$Ð(?Ó?Ü˜�{‰{Ü5Ø_óð ô —	’	œ"Ÿ)š) A¢a¨¯©Ð&8Ñ$9¸4¿=¹=¿?¹?ÓKÈT×M]ÑM]×M_ÑM_Ó`Ðcg×cxÑcxÑxð ô —)’)˜C§¡Ó/ˆCä—x’x §¡¨1¡¨t¯v©vÐ 6Ó7ˆHØ+.’Q˜Ÿ™Ð'Ñ(àˆOà×&Ñ&Ð*:Ô:Ü˜�{‰{Ü�t—y‘y—‘Ó'¨1Ó,ÜŸ8š8¤B§K¢K°·I±I±¸t¿y¹yÓ$IÓJÐJäŸ8š8ÜUZÐ[_×[dÑ[d×[jÑ[jÐklÑ[mÔUnÓoÒUnÐPQœŸš¤"§+¢+¨a·)±)©m¸T¿Y¹YÀq¹\Ó"JÖKÑUnÑoÐvxñð ô �t—y‘y—‘Ó'¨1Ó,ÜŸ8š8 A¯	©	¡MÓ2°T·Y±YÑ>Ð>äŸ8š8ÜINÈtÏyÉyÏÉÐ_`ÑOaÔIbÓcÒIbÀAœŸš !§i¡i¡-Ó0°4·9±9¸Q±<Ô?ÑIbÑcÐjlñð ð ;ùò pùò ds   È/AMÌ	<M)rC   rH   r4   r   rB   r#   r5   r   rP   r2   rF   rQ   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Úidentityr1   rO   Ústaticmethodr3   r€   r”   r™   Ú__static_attributes__Ú__classcell__)r[   s   @r\   r   r      s_   ø† ñEðN ,1¯>©>ÀDÐ_c÷ GòR>+ð@ ñó ðð0 ñ	ó ð	ò3
÷j@ð @r^   r   c                 óz  • [         R                  " S[         R                  " [         R                  " U 5      5      -  5      n[         R                  " [         R                  " X5      U5      n [         R                  " U R
                  S   [        S9* nSn[        U R
                  S   5       Hq  nSn[        U R
                  S   5       HP  nX&   S:  d  M  [         R                  " SXU4   -  XU4   -
  XU4   -
  5      S:  d  M>  U(       d  US-  nSnX2U'   MR     Ms     [         R                  " [        [         R                  " U5      5      U R
                  S   45      nSUS	'   [        SU R
                  S   5       H  nSXrU   U4'   M     UR                  UR                  S5      -  R                  U4$ )
Nr   r   r`   rb   Fr   r   Tr   )r'   rE   ÚsqrtrI   Úonesr*   re   rf   Úabsrc   r)   ÚuniquerJ   Úsum)ÚCÚDÚ
componentsÚcountrn   Úfound_grouprm   Úprojs           r\   rG   rG   ¿  sc  € Ü
�Š�”B—G’GœBŸGšG A›JÓ'Ñ'Ó(€AÜ
�	Š	”"—)’)˜A“/ 1Ó%€AÜ—'’'˜!Ÿ'™' !™*¬CÑ0Ð0€JØ€EÜ�1—7‘7˜1‘:ÖˆØˆÜ�q—w‘w˜q‘zÖ"ˆAØ‰}˜qÕ ¤R§V¢V¨A°°Q°$±©K¸!¸q¸D¹'Ñ,AÀAÈÀdÁGÑ,KÓ%LÈtÕ%SÞ"Ø˜Q‘J�EØ"&�KØ %˜1“ó #ñ ô �8Š8”SœŸš :Ó.Ó/°·±¸±Ð<Ó=€DØ€Dˆ�JÜ�1�a—g‘g˜a‘jÖ!ˆØ!"ˆ˜‰]˜AÐÓñ "à�F‰F�T—X‘X˜a“[Ñ ×#Ñ# TÐ)Ð)r^   )r    Únumpyr'   Úpandasr%   Úscipy.sparser   Ú	tqdm.autor   Ú r   r   Úutils._exceptionsr   r	   r
   Ú
_explainerr   r   rG   © r^   r\   Ú<module>r¸      s:   ðÛ ã Û Ý !Ý ç ÷ñ õ
 "ôk�iô kó\*r^   