ó
    †ñ:i …  ã                  ó€  • S SK Jr  S SKrS SKrS SKJrJr  S SKrS SKJ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  SS	KJr  S
SKJr  S
SKJr  S
SKJrJr  SSS\R@                  SSSSSSSSSSSS4                           SS jjr!SS jr"SS jr#SS jr$                  SS jr%g)é    )ÚannotationsN)ÚAnyÚLiteral)ÚMarkerStyleé   )ÚExplanation)Úapproximate_interactionsÚconvert_name)ÚDimensionError)Úencode_array_if_neededé   )Úcolors)Úlabels)ÚAxisLimitSpecÚparse_axis_limitú#1E88E5Tú#333333é   Úautog      ð?z
SHAP valuec                ó’!  • [        U [        5      (       d  [        S5      e[        U R                  [        5      (       Gd!  [        U R                  5      S:”  Ga  Ub  [        S5      e[        R                  " [        R                  " U R                  5      R                  S5      5      n[        X°R                  SS9n[        XÀR                  SS9n[        X¼U R                  5      u  p¼[        R                  " S[        U5      [!        S[        U5      -  S	5      S
4S9nU GH  n[        R"                  " S[        U5      US-   5      n[%        U SS2U4   USXëUS9  Ubk  / SQn['        U5       HX  u  nnUU   n[        UU   S   S   [(        [*        45      (       d  M1  [        R,                  " UU   S   UU   S   SUU   US9  MZ     US:X  a  UR/                  U5        MÃ  UR/                  S5        UR1                  / 5        UR2                  S   R5                  S5        GM     Ub  [        R6                  " 5         U(       a  [        R8                  " 5         g[        U R:                  5      S:w  a  [=        S5      eU R                  /nSnU R                  R?                  SS5      nU R@                  R?                  SS5      nU RB                  c  UnOU RB                  R?                  SS5      nSn[        U[        RD                  5      (       a  [        USUS9n[        U[        5      (       GaG  Un[G        [I        UR                  5      [        [*        45      (       Ga#  URK                  UR                  5        [        RL                  " UUR                  R?                  S[        U5      S-
  5      /5      n[        RL                  " UUR@                  R?                  S[        U5      S-
  5      /5      nURB                  c@  [        RL                  " UUR@                  R?                  S[        U5      S-
  5      /5      nGO.[        RL                  " UURB                  R?                  S[        U5      S-
  5      /5      nOï[        RN                  " UR                  5      nUS   U:H  ) n URQ                  UU    5        [        RL                  " UUR                  SS2U 4   /5      n[        RL                  " UUR@                  SS2U 4   /5      nURB                  c*  [        RL                  " UUR@                  SS2U 4   /5      nO)[        RL                  " UURB                  SS2U 4   /5      nSnSn[        U[R        5      (       a  [        S5      e[        U[T        RV                  5      (       a  Uc  URX                  nUR                  nUc;  [[        UR:                  S   5       Vs/ s H  n[\        S   [	        U5      -  PM     nn[        UR:                  5      S:X  a"  [        R>                  " U[        U5      S45      n[        UR:                  5      S:X  a"  [        R>                  " U[        U5      S45      nUS:X  a  [_        USS2U4   5      nUS:X  a  [a        UUU5      S   n[c        UUU5      nSn!Uc$  UU:w  a  Ub  SOSn"[        R                  " U"S9u  nnUR:                  S   UR:                  S   :X  d   S5       eUR:                  S   UR:                  S   :X  d   S5       e[        Rd                  " UR:                  S   5      n#[        Rf                  Ri                  U#5        [k        UU#U4   5      n$UU#U4   n%UU#U4   n&[        U%S   [        5      (       aA  0 n'[[        [        U$5      5       H  nU$U   U'U%U   '   M     [S        U'Rm                  5       5      n([        U[        5      (       a  U/nUU   nSn)UGb  [k        USS2U4   5      n*U*n+USS2U4   n,[        Rn                  " U+Rq                  [(        5      S
5      n-[        Rn                  " U+Rq                  [(        5      S5      n.U-U.:X  aR  [        Rr                  " U+Rq                  [(        5      5      n-[        Rt                  " U+Rq                  [(        5      5      n.[        U,S   [        5      (       aD  0 n/[[        [        U+5      5       H  nU+U   U/U,U   '   M     [S        U/Rm                  5       5      n0Sn!OU-S-  S:X  a  U.S-  S:X  a  U.U--
  S:  a  Sn!U!(       aÃ  U-U.:w  a½  [        Rr                  " U+Rq                  [(        5      5      n-[        Rt                  " U+Rq                  [(        5      5      n.[        Rv                  " U-U.[!        [+        U.U--
  S-   5      URx                  S-
  5      5      n1[z        R|                  R                  U1URx                  S-
  5      n)U$R�                  5       n2US:”  aå  US:”  a  SnU$R�                  5       n3[        U3S   [(        5      (       a/  U3Rq                  [(        5      n3U3[        R‚                  " U35      )    n3[        R„                  " U35      n3[        U35      S:¼  aa  [        R                   " [        R†                  " U35      5      n4UU4-  n5U$[        Rf                  R‰                  [        U$5      S 9U5-  U5S-  -
  -  n$[        R‚                  " U$5      n6[        RŠ                  " U65      n7UbÎ  [k        UU#U4   5      Rq                  [        RŒ                  5      n8U8R�                  5       n9W-W.-   S!-  U9[        R‚                  " U85      '   U.U8U9U.:„  '   U-U8U9U-:  '   U)c  U-n:U.n;OS=n:n;UR�                  SS"S#S$SS%9  UR%                  U$U7   U&U7   USU8U7   UUU:U;U)[        U$5      S&:„  S'9n<U<R‘                  U8U7   5        O UR%                  U$U&USX[        U$5      S&:„  S(9n<UU:w  Ga^  UGbZ  [        W,S   [        5      (       a{  [        RN                  " W0 V=s/ s H  n=W/U=   PM
     sn=5      n>U>SS[        U05      -  -
  -  n>U>S#W.W--
  -  U.U--
  S-   -  -  n>[        R’                  " U<U>US)S*9n?U?R•                  U05        O[        R’                  " U<US)S+9n?[        U[*        [        R–                  45      (       d   S,[I        U5      < 35       eU?R™                  UU   S-S 9  U?Rš                  R�                  S.S/9  U!(       a  U?Rš                  R�                  SS09  U?RŸ                  S5        U?R                   R5                  S5        [        U	U$SS9n	[        U
U$SS9n
[        UU&SS9n[        UU&SS9nU	c  U
b  UR¢                  " [        XšU$5      6   Uc  Ub  UR¤                  " [        X¼U&5      6   UR§                  5       n@Ubc  UR%                  W@S   [        R¨                  " U6R«                  5       5      -  U&U6   [­        S5      SW9U6   UUW-W.S19	n<U<R‘                  W8U6   5        OGUR%                  W@S   [        R¨                  " U6R«                  5       5      -  U&U6   [­        S5      SXS29  UR£                  W@5        U(       a  [¯        UU$U25        [        R°                  " U5        UR³                  UUS-S39  UR/                  [\        S4   U-  US-S39  Ub  URµ                  XƒS-S39  UR¶                  R¹                  S55        URº                  R¹                  S5        UR2                  S6   R5                  S5        UR2                  S7   R5                  S5        UR�                  X3S.S89  UR2                  R                  5        H  nAUAR½                  U5        M     [        U%S   [        5      (       a=  UR¿                  W( V=s/ s H  n=W'U=   PM
     sn=5        URÁ                  U([Ã        S9S.S:9S;9  U(       aO  [Ä        RÆ                  " 5          [Ä        RÈ                  " S<[Ê        5        [        R8                  " 5         SSS5        gU$ s  snf s  sn=f s  sn=f ! , (       d  f       g= f)=aJ  Create a SHAP dependence scatter plot, optionally colored by an interaction feature.

Plots the value of the feature on the x-axis and the SHAP value of the same feature
on the y-axis. This shows how the model depends on the given feature, and is like a
richer extension of classical partial dependence plots. Vertical dispersion of the
data points represents interaction effects. Grey ticks along the y-axis are data
points where the feature's value was NaN.

Note that if you want to change the data being displayed, you can update the
``shap_values.display_features`` attribute and it will then be used for plotting instead of
``shap_values.data``.

Parameters
----------
shap_values : shap.Explanation
    Typically a single column of an :class:`.Explanation` object
    (i.e. ``shap_values[:, "Feature A"]``).

    Alternatively, pass multiple columns to create several subplots
    (i.e. ``shap_values[:, ["Feature A", "Feature B"]]``).

color : string or shap.Explanation, optional
    How to color the scatter plot points. This can be a fixed color string, or an
    :class:`.Explanation` object.

    If it is an :class:`.Explanation` object, then the scatter plot points are
    colored by the feature that seems to have the strongest interaction effect with
    the feature given by the ``shap_values`` argument. This is calculated using
    :func:`shap.utils.approximate_interactions`.

    If only a single column of an :class:`.Explanation` object is passed, then that
    feature column will be used to color the data points.

hist : bool
    Whether to show a light histogram along the x-axis to show the density of the
    data. Note that the histogram is normalized such that if all the points were in
    a single bin, then that bin would span the full height of the plot. Defaults to
    ``True``.

x_jitter : 'auto' or float
    Adds random jitter to feature values by specifying a float between 0 to 1. May
    increase plot readability when a feature is discrete. By default, ``x_jitter``
    is chosen based on auto-detection of categorical features.

title: str, optional
    Plot title.

alpha : float
    The transparency of the data points (between 0 and 1). This can be useful to
    show the density of the data points when using a large dataset.

xmin, xmax, ymin, ymax : float, string, aggregated Explanation or None
    Desired axis limits. Can be a float to specify a fixed limit.

    It can be a string of the format ``"percentile(float)"`` to denote that
    percentile of the feature's value.

    It can also be an aggregated column of a single column of an :class:`.Explanation`,
    such as ``explanation[:, "feature_name"].percentile(20)``.

overlay: dict, optional
    Optional dictionary of up to three additional curves to overlay as line plots.

    The dictionary maps a curve name to a list of (xvalues, yvalues) pairs, where
    there is one pair for each feature to be plotted.

ax : matplotlib Axes, optional
    Optionally specify an existing :external+mpl:class:`matplotlib.axes.Axes` object, into which
    the plot will be placed.

    Only supported when plotting a single feature.

show : bool
    Whether :external+mpl:func:`matplotlib.pyplot.show()` is called before returning.

    Setting this to ``False`` allows the plot to be customized further after it
    has been created.

Returns
-------
ax : matplotlib Axes object
    Returns the :external+mpl:class:`~matplotlib.axes.Axes` object with the plot drawn onto it. Only
    returned if ``show=False``.

Examples
--------
See `scatter plot examples <https://shap.readthedocs.io/en/latest/example_notebooks/api_examples/plots/scatter.html>`_.

z<The shap_values parameter must be a shap.Explanation object!r   NzAThe ax parameter is not supported when plotting multiple featuresT)Úis_shap_axisr   é   é   é   ©ÚfigsizeF)ÚcolorÚshowÚaxÚyminÚymax)ÚsolidÚdottedÚdashedú#000000)r   Ú	linestyleÚlabelÚ ÚleftzŠThe passed Explanation object has multiple columns. Please pass a single feature column to shap.plots.scatter like: shap_values[:, column]éÿÿÿÿ)ÚvaluesÚbase_valuesÚdatar   z¸The passed shap_values_arr are a list not an array! If you have a list of explanations try passing shap_values_arr[0] instead to explain the first output class of a multi-output model.ÚFEATURE©g      @r   ©r   r   zJ'shap_values_arr' and 'features' values must have the same number of rows!zE'shap_values_arr' must have the same number of columns as 'features'!é_   é
   r   ©Úsizeç       @z#888888ç      à?)r   r   )r   ÚlwÚdashesÚzorderéô  )	ÚsÚ	linewidthÚcÚcmapÚalphaÚvminÚvmaxÚnormÚ
rasterized©r;   r<   r   r?   rC   éP   ©Úticksr   Úaspect©r   rH   z#Unexpected type(interaction_index)=é   é   ©Ú	labelsize©Úlength©Úmarkerr<   r=   r>   r?   r@   rA   ©rQ   r<   r   r?   ©r   ÚfontsizeÚ	VALUE_FORÚbottomÚrightÚtop©r   Ú
labelcolorrM   Úvertical©ÚrotationrT   ©ÚfontdictÚignore)fÚ
isinstancer   Ú	TypeErrorÚfeature_namesÚstrÚlenÚ
ValueErrorÚnpÚargsortÚabsr+   Úmeanr   Ú_suggest_buffered_limitsÚpltÚsubplotsÚminÚsubplotÚscatterÚ	enumerateÚfloatÚintÚplotÚ
set_ylabelÚ
set_yticksÚspinesÚset_visibleÚlegendr   Úshaper   Úreshaper-   Údisplay_dataÚndarrayÚ
issubclassÚtypeÚappendÚhstackÚarrayÚextendÚlistÚpdÚ	DataFrameÚcolumnsÚranger   Ú_suggest_x_jitterr	   r
   ÚarangeÚrandomÚshuffler   ÚkeysÚnanpercentileÚastypeÚnanminÚnanmaxÚlinspaceÚNÚ
matplotlibr   ÚBoundaryNormÚcopyÚisnanÚuniqueÚdiffÚrandom_sampleÚinvertÚfloat64ÚaxhlineÚ	set_arrayÚcolorbarÚset_ticklabelsÚintegerÚ	set_labelr   Útick_paramsÚ	set_alphaÚoutlineÚset_xlimÚset_ylimÚget_xlimÚonesÚsumr   Ú_plot_histogramÚscaÚ
set_xlabelÚ	set_titleÚxaxisÚset_ticks_positionÚyaxisÚset_edgecolorÚ
set_xticksÚset_xticklabelsÚdictÚwarningsÚcatch_warningsÚsimplefilterÚRuntimeWarning)BÚshap_valuesr   ÚhistÚ
axis_colorr>   Údot_sizeÚx_jitterr?   ÚtitleÚxminÚxmaxr    r!   Úoverlayr   Úylabelr   ÚindsÚ_ÚiÚline_stylesÚjÚnameÚvalsrc   ÚindÚshap_values_arrÚfeaturesÚdisplay_featuresÚinteraction_indexÚshap_values2Úfeature_names2ÚmaskÚcategorical_interactionr   ÚoindsÚxvÚxdr;   Úname_mapÚxnamesÚ
color_normÚinteraction_feature_valuesÚcvÚcdÚclowÚchighÚ	cname_mapÚcnamesÚboundsÚxv_no_jitterÚxvalsÚsmallest_diffÚjitter_amountÚxv_nanÚ	xv_notnanÚcvalsÚ	cvals_impr@   rA   ÚpÚnÚtick_positionsÚcbÚxlimÚspinesB                                                                     ÚV/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/shap/plots/_scatter.pyrp   rp      sè  € ôX �k¤;×/Ñ/ÜÐVÓWÐWô �k×/Ñ/´×5Ò5¼#¸k×>WÑ>WÓ:XÐ[\Ô:\Ø‰>ÜÐ`ÓaÐaä�zŠzœ"Ÿ&š& ×!3Ñ!3Ó4×9Ñ9¸!Ó<Ó=ˆÜ ×&8Ñ&8ÀtÑLˆÜ ×&8Ñ&8ÀtÑLˆÜ-¨d¸+×:LÑ:LÓM‰
ˆÜ�LŠL˜œC ›I´°A¼¸D»	±MÀ2Ó0FÈÐ/JÑKˆÜˆAÜ—’˜Q¤ D£	¨1¨q©5Ó1ˆBÜ�K¢ 1 Ñ%¨U¸À2ÐW[Ò\ØÑ"Ú;�Ü(¨Ö1‘G�A�tØ" 4™=�DÜ! $ q¡'¨!¡*¨Q¡-´%¼°×>Ó>ÜŸš  a¡¨¡¨T°!©W°Q©Z¸yÐT_Ð`aÑTbÐjnÔoñ  2ð �A‹vØ—‘˜fÖ%à—‘˜bÔ!Ø—‘˜bÔ!Ø—	‘	˜&Ñ!×-Ñ-¨e×4ñ ð ÑÜ�JŠJŒLÞÜ�HŠHŒJØä
ˆ;×ÑÓ Ó"Üð>ó
ð 	
ð !×.Ñ.Ð/€MØ€CØ!×(Ñ(×0Ñ0°°QÓ7€OØ×Ñ×'Ñ'¨¨AÓ.€HØ×ÑÑ'Ø#Ñà&×3Ñ3×;Ñ;¸BÀÓBÐØ*.Ðô �%œŸ™×$Ñ$Ü 5°dÀÑGˆô �%œ×%Ò%ØˆÜ”d˜<×5Ñ5Ó6¼¼c¸
×CÒCØ× Ñ  ×!;Ñ!;Ô<Ü Ÿiši¨¸,×:MÑ:M×:UÑ:UÐVXÔZ]Ð^kÓZlÐopÑZpÓ:qÐ(rÓsˆOÜ—y’y (¨L×,=Ñ,=×,EÑ,EÀbÌ#ÈmÓJ\Ð_`ÑJ`Ó,aÐ!bÓcˆHØ×(Ñ(Ñ0Ü#%§9¢9Ð.>À×@QÑ@Q×@YÑ@YÐZ\Ô^aÐboÓ^pÐstÑ^tÓ@uÐ-vÓ#wÒ ä#%§9¢9Ø% |×'@Ñ'@×'HÑ'HÈÌSÐQ^ÓM_ÐbcÑMcÓ'dÐeó$Ñ ô  ŸXšX l×&@Ñ&@ÓAˆNØ" 1Ñ%¨Ñ7Ð8ˆDØ× Ñ  °Ñ!5Ô6Ü Ÿiši¨¸,×:MÑ:MÊaÐQUÈgÑ:VÐ(WÓXˆOÜ—y’y (¨L×,=Ñ,=ºaÀ¸gÑ,FÐ!GÓHˆHØ×(Ñ(Ñ0Ü#%§9¢9Ð.>À×@QÑ@QÒRSÐUYÐRYÑ@ZÐ-[Ó#\Ñ ä#%§9¢9Ð.>À×@YÑ@YÒZ[Ð]aÐZaÑ@bÐ-cÓ#dÐ ØˆØ"Ðä�/¤4×(Ñ(Üðló
ð 	
ô �(œBŸL™L×)Ñ)ØÑ Ø$×,Ñ,ˆMØ—?‘?ˆàÑÜ=BÀ?×CXÑCXÐYZÑC[Ô=\Ó]Ò=\¸œ 	Ñ*¬S°«VÔ3Ñ=\ˆÐ]ô ˆ?× Ñ Ó! QÓ&ÜŸ*š* _´s¸?Ó7KÈQÐ6OÓPˆÜ
ˆ8�>‰>Ó˜aÓÜ—:’:˜h¬¨X«¸Ð(:Ó;ˆð �6ÓÜ$ Xªa°¨fÑ%5Ó6ˆð ˜FÓ"Ü4°S¸/È8ÓTÐUVÑWÐÜ$Ð%6¸ÈÓWÐØ#Ðð 
�zØ/°3Ó6Ð;LÑ;X‘(Ð^dˆÜ—’ WÑ-‰ˆˆ2à× Ñ  Ñ# x§~¡~°aÑ'8Ó8ð ØTóÐ8ð × Ñ  Ñ# x§~¡~°aÑ'8Ó8ð ØOóÐ8ô
 �IŠIØ×Ñ˜aÑ ó€Eô ‡I�I×Ñ�eÔÜ	 ¨°¨Ñ 4Ó	5€BØ	˜% ˜*Ñ	%€Bà˜˜s˜
Ñ#€AÜ�"�Q‘%œ×ÑØˆÜ”s˜2“w–ˆAØ  ™eˆH�R˜‘U‹Oñ  ä�h—m‘m“oÓ&ˆô �-¤×%Ñ%Ø&˜ˆØ˜Ñ€Dð €JØÒ$Ü%;¸HÂQÐHYÐEYÑ<ZÓ%[Ð"Ø'ˆØšaÐ!2Ð2Ñ3ˆÜ×Ò §	¡	¬%Ó 0°!Ó4ˆÜ× Ò  §¡¬5Ó!1°2Ó6ˆØ�5‹=Ü—9’9˜RŸY™Y¤uÓ-Ó.ˆDÜ—I’I˜bŸi™i¬Ó.Ó/ˆEÜ�b˜‘eœS×!Ñ!ØˆIÜœ3˜r›7–^�Ø#% a¡5�	˜"˜Q™%Ó ñ $ä˜)Ÿ.™.Ó*Ó+ˆFØ&*Ñ#Ø�A‰X˜‹]˜u q™y¨A›~°%¸$±,ÀÓ2CØ&*Ð#ö # t¨u£}Ü—9’9˜RŸY™Y¤uÓ-Ó.ˆDÜ—I’I˜bŸi™i¬Ó.Ó/ˆEÜ—[’[  u¬c´#°e¸d±lÀQÑ6FÓ2GÈÏÉÐRSÉÓ.TÓUˆFÜ#×*Ñ*×7Ñ7¸ÀÇÁÈÁ
ÓKˆJð —7‘7“9€LØ�!ƒ|Ø�a‹<ØˆHØ—‘“	ˆÜ�e˜A‘h¤×&Ñ&Ø—L‘L¤Ó'ˆEØœ2Ÿ8š8 E›?Ð*Ñ+ˆEÜ—	’	˜%Ó ˆÜˆu‹:˜‹?ÜŸFšF¤2§7¢7¨5£>Ó2ˆMØ$ }Ñ4ˆMØ”2—9‘9×*Ñ*´°B³Ð*Ð8¸=ÑHÈ]Ð]^ÑM^Ñ_Ñ_ˆBô �XŠX�b‹\€FÜ—	’	˜&Ó!€IØÑ$ä& x°Ð7HÐ0HÑ'IÓJ×QÑQÔRT×R\ÑR\Ó]ˆØ—J‘J“Lˆ	Ø&*¨U¡l°cÑ%9ˆ	”"—(’(˜5“/Ñ"Ø#(ˆˆi˜%ÑÑ Ø"&ˆˆi˜$ÑÑØÑØˆDØ‰DàÐˆD�4Ø
�
‰
�1˜I¨#°fÀRˆ
ÑHØ�J‰JØˆy‰MØˆi‰LØØØ�IÑØØØØØÜ˜2“w ‘}ð ð 
ˆð 	
�‰�E˜)Ñ$Õ%à�J‰J�r˜1 °A¸UÔ\_Ð`bÓ\cÐfiÑ\iˆJÐjˆà˜CÔÐ$5Ò$Aä�b˜‘eœS×!Ñ!ÜŸXšX¹VÓ&DºV¸ y°¤|¹VÑ&DÓEˆNØ˜a !¤c¨&£k¡/Ñ1Ñ1ˆNØ˜c U¨T¡\Ñ2°e¸d±lÀQÑ6FÑGÑGˆNÜ—’˜a ~¸"ÀRÑHˆBØ×Ñ˜fÕ%ä—’˜a B¨rÑ2ˆBô Ð+¬c´2·:±:Ð->×?Ñ?ÐiÐCgÌtÐTeÓOfÑNhÐAiÓiÐ?Ø
�‰�]Ð#4Ñ5¸BˆÑ?Ø
�‰×Ñ BÐÑ'Þ"Ø�E‰E×Ñ QÐÑ'Ø
�‰�QŒØ
�
‰
×Ñ˜uÔ%ô ˜D "°5Ñ9€DÜ˜D "°5Ñ9€DÜ˜D !°$Ñ7€DÜ˜D !°$Ñ7€DØÑ˜4Ñ+Ø
�ŠÔ-¨d¸"Ó=Ñ>ØÑ˜4Ñ+Ø
�ŠÔ-¨d¸!Ó<Ñ=ð �;‰;‹=€DØÑ$Ø�J‰JØ�‰G”b—g’g˜fŸj™j›lÓ+Ñ+Øˆf‰IÜ˜q“>ØØ˜ÑØØØØð ð 

ˆð 	
�‰�E˜&‘MÕ"à
�
‰
Ø�‰G”b—g’g˜fŸj™j›lÓ+Ñ+¨Q¨v©Y¼{È1»~ÐYZÐbgð 	ñ 	
ð ‡K�K�Ôö Ü˜˜B Ô-ä‡G‚GˆB„Kð ‡M�M�$˜j°2€MÑ6Ø‡M�M”&˜Ñ%¨Ñ,°JÈ€MÑLØÑØ
�‰�U°rˆÑ:Ø‡H�H×Ñ Ô)Ø‡H�H×Ñ Ô'Ø‡I�IˆgÑ×"Ñ" 5Ô)Ø‡I�IˆeÑ× Ñ  Ô'Ø‡N�N˜Àb€NÑIØ—‘×!Ñ!Ö#ˆØ×Ñ˜JÖ'ñ $ä�"�Q‘%œ×ÑØ
�‰©FÓ3ªF q�x ”{©FÑ3Ô4Ø
×Ñ˜6¬D¸*ÈrÑ,RÐÑSÞÜ×$Ò$Õ&Ü×!Ò! (¬NÔ;Ü�HŠHŒJ÷ 'Ð&ð ˆ	ùòW ^ùò@ 'EùòH 4÷ 'Õ&ús&   ×9AB)ñ9AB.Á@#AB3ÁA-1AB8ÁB8
ACc                óÂ   • Uc  [         R                  " U5      OUnU c  [         R                  " U5      OU nX4-
  S-  nU c  [        XE-
  5      n Uc  [        X5-   5      nX4$ )zNIf either limit is None, suggest suitable value including a buffer either sideé   )rg   r‘   r�   rr   )Úax_minÚax_maxr+   Únan_maxÚnan_minÚbuffers         rð   rk   rk   ¯  sc   € à#)¡>Œb�iŠi˜Ô°v€GØ#)¡>Œb�iŠi˜Ô°v€GØÑ 2Ñ%€FØ�~Ü�wÑ'Ó(ˆØ�~Ü�wÑ'Ó(ˆØˆ>Ðó    c                ót  • [         R                  " [         R                  " U 5      5      n[        U5      S:  a  g [         R                  " U5      n[         R
                  " X"S:„     5      n[        U 5      [        U5      -  nUS:  a  SnU$ US:  a  US-  nU$ US	-  nU$ ! [        [        4 a    Sn NIf = f)
zKSuggest a suitable x_jitter value based on the unique values in the featurer   g        g:Œ0âŽyE>r   r2   r   éd   çš™™™™™¹?çš™™™™™É?)rg   Úsortr˜   re   r™   rn   rb   rf   )r+   Úunique_valsÚdiffsÚmin_distÚnum_points_per_valuer¾   s         rð   r‰   r‰   »  sÀ   € ä—'’'œ"Ÿ)š) FÓ+Ó,€KÜ
ˆ;Ó˜!Óàðä—’˜Ó$ˆÜ—6’6˜%¨¡Ñ-Ó.ˆô
 ˜v›;¬¨[Ó)9Ñ9ÐØ˜bÓ àˆð €Oð 
 Ó	#à˜c‘>ˆð €Oð ˜c‘>ˆØ€Oøô ”zÐ"ó àŠðús   ¼1B" Â"B7Â6B7c           
     ó  • [         R                  " SU R                  5       5      nU R                  5       n[        R
                  " U5      n[        U5      [        U5      -  S:  GaG  [        U5      S:  Ga7  [        R                  " U5      S:  Ga  [        R                  " U5      S:¼  Ga  [        R                  " U5        / n[        [        [        R                  " U5      S-   5      5       H  nUR                  US-
  5        M     UR                  [        [        R                  " U5      5      S-   5        [        R                  " [        R                  " U5      S-
  5      S-   [        R                  " [        R                  " U5      S-   5      S-
  4nU R                  U5        O8[        U5      S:¼  a  SnO&[        U5      S	:¼  a  S
nO[        U5      S:¼  a  SnOSnUR!                  U[        R"                  " U5      )    USSSUS   US   4SS9  UR%                  S[        U5      5        UR&                  R)                  S5        UR*                  R)                  S5        UR*                  R-                  / 5        UR.                  S   R1                  S5        UR.                  S   R1                  S5        UR.                  S   R1                  S5        UR.                  S   R1                  S5        g)z8Add a histogram of the data on a matching secondary axesúplt.Axesrü   éK   r   r   r6   r:   é2   éÈ   rò   rú   r2   r   Fr%   rû   r*   )ÚdensityÚ	facecolorr?   rˆ   r9   rV   r)   rW   rX   N)ÚtypingÚcastÚtwinxr¨   rg   r˜   re   Úmaxrn   rý   rˆ   rs   r€   ÚfloorÚceilr¦   r»   r—   r§   r¯   r°   r±   Ú	set_ticksrw   rx   )	r   rÕ   râ   Úax2rî   rã   ÚbinsrÆ   Úlims	            rð   r«   r«   Ö  sI  € ä
�+Š+�j "§(¡(£*Ó
-€CØ�;‰;‹=€DÜ�IŠI�lÓ#€Eô ˆ5ƒz”C˜Ó%Ñ%¨Ô+´°E³
¸R´ÄBÇFÂFÈ5ÃMÐTVÔDVÔ[]×[aÒ[aÐbgÓ[hÐlmÔ[mÜ
�Š�ŒØˆÜ”sœ2Ÿ6š6 %›=¨1Ñ,Ó-Ö.ˆAØ�K‰K˜˜C™Ö ñ /à�‰”CœŸš˜u›Ó&¨Ñ,Ô-ä�hŠh”r—v’v˜e“} sÑ*Ó+¨cÑ1´2·7²7¼2¿6º6À%»=È3Ñ;NÓ3OÐRUÑ3UÐUˆØ
�‰�CÕäˆ|Ó Ó#Ø‰DÜ�Ó #Ó%Ø‰DÜ�Ó #Ó%Ø‰DàˆDð ‡H�HØ
ŒB�HŠH�R‹Lˆ=ÑØØØØØ�A‰w˜˜Q™Ð Øð ñ ð ‡L�L�”C˜“GÔØ‡I�I× Ñ  Ô*Ø‡I�I× Ñ  Ô(Ø‡I�I×Ñ˜ÔØ‡J�JˆwÑ×#Ñ# EÔ*Ø‡J�JˆuÑ×!Ñ! %Ô(Ø‡J�JˆvÑ×"Ñ" 5Ô)Ø‡J�JˆxÑ×$Ñ$ UÕ+rø   c                ó*  • Uc  [         R                  n[        U[        5      (       a  [	        S5      e[        U[
        R                  5      (       a  Uc  UR                  nUR                  n[        U[
        R                  5      (       a  Uc  UR                  nUR                  nOUc  UnUc;  [        UR                  S   5       Vs/ s H  n[        S   [        U5      -  PM     nn[        UR                  5      S:X  a"  [        R                  " U[        U5      S45      n[        UR                  5      S:X  a"  [        R                  " U[        U5      S45      n[!        XU5      n [#        U S5      (       d!  US:X  a  [%        XU5      S   n[!        XQU5      nSnU(       d1  XP:w  a  Ub  S	OS
n[&        R(                  " US9nUR+                  5       nOUR-                  5       n[        UR                  5      S:X  aø  [#        U S5      (       aç  [        U 5      S:X  aØ  [!        U S   X5      n[!        U S   X5      nUU:X  a  USS2USS24   nOUSS2USS24   S-  nUU:X  a  UR/                  SSSS9  [1        UUUUUU:X  a  SOUUUSUUU
US9  UU:X  a  UR3                  [        S   UU   -  5        O#UR3                  [        S   UU   UU   4-  5        U(       a  [&        R4                  " 5         gUR                  S   UR                  S   :X  d   S5       eUR                  S   UR                  S   :X  d   S5       e[        R6                  " UR                  S   5      n[        R8                  R;                  U5        [=        UUU 4   5      nUUU 4   nUUU 4   n[        US   [        5      (       aA  0 n[        [        U5      5       H  nUU   UUU   '   M     [        UR?                  5       5      n[        U[        5      (       a  U/nX0   n Sn!UGb  [=        USS2U4   5      n"U"n#USS2U4   n$[        R@                  " U#RC                  [D        5      S5      n%[        R@                  " U#RC                  [D        5      S5      n&U%U&:X  aR  [        RF                  " U#RC                  [D        5      5      n%[        RH                  " U#RC                  [D        5      5      n&[        U$S   [        5      (       aD  0 n'[        [        U#5      5       H  nU#U   U'U$U   '   M     [        U'R?                  5       5      n(SnOU%S-  S:X  a  U&S-  S:X  a  U&U%-
  S:  a  SnU(       aÃ  U%U&:w  a½  [        RF                  " U#RC                  [D        5      5      n%[        RH                  " U#RC                  [D        5      5      n&[        RJ                  " U%U&[M        [O        U&U%-
  S-   5      URP                  S-
  5      5      n)[R        R                   RU                  U)URP                  S-
  5      n!U
S:”  aå  U
S:”  a  Sn
URW                  5       n*[        U*S   [D        5      (       a/  U*RC                  [D        5      n*U*[        RX                  " U*5      )    n*[        RZ                  " U*5      n*[        U*5      S:¼  aa  [        RL                  " [        R\                  " U*5      5      n+U
U+-  n,U[        R8                  R_                  [        U5      S9U,-  U,S-  -
  -  n[        RX                  " U5      n-[        R`                  " U-5      n.Ub¢  W"U   RC                  [        Rb                  5      n/U/RW                  5       n0W%W&-   S-  U0[        RX                  " U/5      '   U&U/U0U&:„  '   U%U/U0U%:  '   URe                  UU.   UU.   U	SU/U.   UUU![        U5      S:„  S9	n1U1Rg                  U/U.   5        O URe                  UUU	SXk[        U5      S:„  S9n1XP:w  Ga  UGb  [        W$S   [        5      (       ag  W( V2s/ s H  n2W'U2   PM
     n3n2[        U35      S:X  a  U3S==   S-  ss'   U3S==   S-  ss'   [&        Rh                  " U1U3USS 9n4U4Rk                  U(5        O[&        Rh                  " U1USS!9n4U4Rm                  X5   S"S9  U4Rn                  Rq                  S#S$9  U(       a  U4Rn                  Rq                  SS%9  U4Rs                  S5        U4Rt                  Rw                  S5        Uc  UGbM  [        U[        5      (       a9  URy                  S&5      (       a#  [        R@                  " U[E        US#S' 5      5      n[        U[        5      (       a9  URy                  S&5      (       a#  [        R@                  " U[E        US#S' 5      5      nUb  U[        RF                  " U5      :X  a3  [        RF                  " U5      U[        RF                  " U5      -
  S(-  -
  nUb  U[        RH                  " U5      :X  a3  [        RH                  " U5      [        RH                  " U5      U-
  S(-  -   nUR{                  XÞ5        UR}                  5       n5UbZ  URe                  U5S   [        R~                  " U-R�                  5       5      -  UU-   SSW0U-   UUW%W&S)9	n1U1Rg                  W/U-   5        O>URe                  U5S   [        R~                  " U-R�                  5       5      -  UU-   SSXkS*9  UR{                  U55        URƒ                  U US"S+9  UR3                  [        S,   U -  US"S+9  Uc  Ub  Uc  U* nUc  U* nUR…                  UU5        Ub  UR‡                  XÇS"S+9  URˆ                  R‹                  S-5        URŒ                  R‹                  S.5        URŽ                  S/   Rw                  S5        URŽ                  S0   Rw                  S5        URq                  XwS#S19  URŽ                  R                  5        H  n6U6R‘                  U5        M     [        US   [        5      (       a=  UR“                  W V2s/ s H  n2WU2   PM
     sn25        UR•                  U[—        S2S#S39S49  U(       aO  [˜        Rš                  " 5          [˜        Rœ                  " S5[ž        5        [&        R4                  " 5         SSS5        ggs  snf s  sn2f s  sn2f ! , (       d  f       g= f)6aó	  Create a SHAP dependence plot, colored by an interaction feature.

Plots the value of the feature on the x-axis and the SHAP value of the same feature
on the y-axis. This shows how the model depends on the given feature, and is like a
richer extension of the classical partial dependence plots. Vertical dispersion of the
data points represents interaction effects. Grey ticks along the y-axis are data
points where the feature's value was NaN.


Parameters
----------
ind : int or string
    If this is an int it is the index of the feature to plot. If this is a string it is
    either the name of the feature to plot, or it can have the form "rank(int)" to specify
    the feature with that rank (ordered by mean absolute SHAP value over all the samples).

shap_values : numpy.array
    Matrix of SHAP values (# samples x # features).

features : numpy.array or pandas.DataFrame
    Matrix of feature values (# samples x # features).

feature_names : list
    Names of the features (length # features).

display_features : numpy.array or pandas.DataFrame
    Matrix of feature values for visual display (such as strings instead of coded values).

interaction_index : "auto", None, int, or string
    The index of the feature used to color the plot. The name of a feature can also be passed
    as a string. If "auto" then shap.common.approximate_interactions is used to pick what
    seems to be the strongest interaction (note that to find to true stongest interaction you
    need to compute the SHAP interaction values).

x_jitter : float (0 - 1)
    Adds random jitter to feature values. May increase plot readability when feature
    is discrete.

alpha : float
    The transparency of the data points (between 0 and 1). This can be useful to the
    show density of the data points when using a large dataset.

xmin : float or string
    Represents the lower bound of the plot's x-axis. It can be a string of the format
    "percentile(float)" to denote that percentile of the feature's value used on the x-axis.

xmax : float or string
    Represents the upper bound of the plot's x-axis. It can be a string of the format
    "percentile(float)" to denote that percentile of the feature's value used on the x-axis.

ax : matplotlib Axes object
     Optionally specify an existing matplotlib Axes object, into which the plot will be placed.
     In this case we do not create a Figure, otherwise we do.

ymin : float
    Represents the lower bound of the plot's y-axis.

ymax : float
    Represents the upper bound of the plot's y-axis.

Nz°The passed shap_values are a list not an array! If you have a list of explanations try passing shap_values[0] instead to explain the first output class of a multi-output model.r   r.   Ú__len__r   r   Fr/   r0   r   é   r   r   r   T)Úforward)	rc   rÏ   rÎ   r   r   rÀ   rÁ   r¾   r?   ÚMAIN_EFFECTÚINTERACTION_EFFECTzF'shap_values' and 'features' values must have the same number of rows!zA'shap_values' must have the same number of columns as 'features'!r1   r2   r3   r5   r:   )r;   r<   r=   r>   r?   rB   rC   rD   g      Ð?rE   rF   rI   rJ   rK   rL   rN   Ú
percentiler*   rò   rP   rR   rS   rU   rV   r)   rW   rX   rY   r[   r\   r^   r`   )Pr   Úred_bluera   r„   rb   r…   r†   r‡   r+   rˆ   rz   r   rd   re   rg   r{   r
   Úhasattrr	   rl   ÚfigureÚgcaÚ
get_figureÚset_size_inchesÚdependence_legacyru   r   rŠ   r‹   rŒ   r   r�   rŽ   r�   rr   r�   r‘   r’   rn   rs   r“   r”   r•   r–   r—   r˜   r™   rš   r›   rœ   rp   rž   rŸ   r    r¢   r   r£   r¤   r¥   rx   Ú
startswithr¦   r¨   r©   rª   r­   r§   r®   r¯   r°   r±   rw   r²   r³   r´   rµ   r¶   r·   r¸   r¹   )7rË   rº   rÍ   rc   rÎ   rÏ   r   r¼   r>   r½   r¾   r?   r¿   rÀ   rÁ   r   r   r    r!   rÆ   rÓ   r   ÚfigÚind1Úind2Úproj_shap_valuesrÔ   rÕ   rÖ   r;   r×   rØ   rÉ   rÙ   rÚ   rÛ   rÜ   rÝ   rÞ   rß   rà   rá   rã   rä   rå   ræ   rç   rè   ré   rê   rë   rì   rí   rî   rï   s7                                                          rð   r   r     s”  € ðd �|Ü�‰ˆä�+œt×$Ñ$Üðhó
ð 	
ô �(œBŸL™L×)Ñ)ØÑ Ø$×,Ñ,ˆMØ—?‘?ˆÜÐ"¤B§L¡L×1Ñ1ØÑ Ø,×4Ñ4ˆMØ+×2Ñ2ÑØ	Ñ	!Ø#ÐàÑÜ=BÀ;×CTÑCTÐUVÑCWÔ=XÓYÒ=X¸œ 	Ñ*¬S°«VÔ3Ñ=XˆÐYô ˆ;×ÑÓ Ó"Ü—j’j ¬s°;Ó/?ÀÐ.CÓDˆÜ
ˆ8�>‰>Ó˜aÓÜ—:’:˜h¬¨X«¸Ð(:Ó;ˆä
�s¨Ó
7€Cô �3˜	×"Ñ"Ø Ó&Ü 8¸È8Ó TÐUVÑ WÐÜ(Ð):ÈÓWÐØ#Ðö Ø/Ó6Ð;LÑ;X‘(Ð^dˆÜ�jŠj Ñ)ˆØ�W‰W‹Y‰à�m‰m‹oˆô ˆ;×ÑÓ Ó"¤w¨s°I×'>Ñ'>Ä3ÀsÃ8ÈqÃ=Ü˜C ™F KÓ?ˆÜ˜C ™F KÓ?ˆØ�4‹<Ø*ª1¨d²A¨:Ñ6Ñà*ª1¨d²A¨:Ñ6¸Ñ:Ðð �4‹<Ø×Ñ  1¨dÐÑ3ô 	ØØØØ'Ø'+¨t£|™t¸Ø-ØØØØØØò	
ð �4‹<Ø�M‰Mœ& Ñ/°-ÀÑ2EÑEÕFà�M‰Mœ&Ð!5Ñ6¸-ÈÑ:MÈ}Ð]aÑObÐ9cÑcÔdæÜ�HŠHŒJØà×Ñ˜QÑ 8§>¡>°!Ñ#4Ó4ð ØPóÐ4ð ×Ñ˜QÑ 8§>¡>°!Ñ#4Ó4ð ØKóÐ4ô
 �IŠIØ×Ñ˜!Ñó€Eô ‡I�I×Ñ�eÔä	 ¨°¨Ñ 4Ó	5€Bà	˜% ˜*Ñ	%€BØ�E˜3�JÑ€AÜ�"�Q‘%œ×ÑØˆÜ”s˜2“w–ˆAØ  ™eˆH�R˜‘U‹Oñ  ä�h—m‘m“oÓ&ˆô �-¤×%Ñ%Ø&˜ˆØÑ€Dð €JØÒ$Ü%;¸HÂQÐHYÐEYÑ<ZÓ%[Ð"Ø'ˆØšaÐ!2Ð2Ñ3ˆÜ×Ò §	¡	¬%Ó 0°!Ó4ˆÜ× Ò  §¡¬5Ó!1°2Ó6ˆØ�5‹=Ü—9’9˜RŸY™Y¤uÓ-Ó.ˆDÜ—I’I˜bŸi™i¬Ó.Ó/ˆEÜ�b˜‘eœS×!Ñ!ØˆIÜœ3˜r›7–^�Ø#% a¡5�	˜"˜Q™%Ó ñ $ä˜)Ÿ.™.Ó*Ó+ˆFØ&*Ñ#Ø�A‰X˜‹]˜u q™y¨A›~°%¸$±,ÀÓ2CØ&*Ð#ö # t¨u£}Ü—9’9˜RŸY™Y¤uÓ-Ó.ˆDÜ—I’I˜bŸi™i¬Ó.Ó/ˆEÜ—[’[  u¬c´#°e¸d±lÀQÑ6FÓ2GÈÏÉÐRSÉÓ.TÓUˆFÜ#×*Ñ*×7Ñ7¸ÀÇÁÈÁ
ÓKˆJð �!ƒ|Ø�a‹<ØˆHØ—‘“	ˆÜ�e˜A‘h¤×&Ñ&Ø—L‘L¤Ó'ˆEØœ2Ÿ8š8 E›?Ð*Ñ+ˆEÜ—	’	˜%Ó ˆÜˆu‹:˜‹?ÜŸFšF¤2§7¢7¨5£>Ó2ˆMØ$ }Ñ4ˆMØ”2—9‘9×*Ñ*´°B³Ð*Ð8¸=ÑHÈ]Ð]^ÑM^Ñ_Ñ_ˆBô �XŠX�b‹\€FÜ—	’	˜&Ó!€IØÑ$à*¨5Ñ1×8Ñ8¼¿¹ÓDˆØ—J‘J“Lˆ	Ø&*¨U¡l°cÑ%9ˆ	”"—(’(˜5“/Ñ"Ø#(ˆˆi˜%ÑÑ Ø"&ˆˆi˜$ÑÑØ�J‰JØˆy‰MØˆi‰LØØØ�IÑØØØÜ˜2“w ‘}ð ð 

ˆð 	
�‰�E˜)Ñ$Õ%à�J‰J�r˜1 °A¸UÔ\_Ð`bÓ\cÐfiÑ\iˆJÐjˆàÔÐ$5Ò$Aä�b˜‘eœS×!Ñ!Ù4:Ó;²F¨q˜i¨œl±FˆNÐ;Ü�>Ó" aÓ'Ø˜qÓ! TÑ)Ó!Ø˜qÓ! TÑ)Ó!Ü—’˜a ~¸"ÀRÑHˆBØ×Ñ˜fÕ%ä—’˜a B¨rÑ2ˆBà
�‰�]Ñ5¸BˆÑ?Ø
�‰×Ñ BÐÑ'Þ"Ø�E‰E×Ñ QÐÑ'Ø
�‰�QŒØ
�
‰
×Ñ˜uÔ%ð Ñ˜4Ò+Ü�dœC× Ñ  T§_¡_°\×%BÑ%BÜ×#Ò# B¬¨d°2°b¨kÓ(:Ó;ˆDÜ�dœC× Ñ  T§_¡_°\×%BÑ%BÜ×#Ò# B¬¨d°2°b¨kÓ(:Ó;ˆDà‰<˜4¤2§9¢9¨R£=Ó0Ü—9’9˜R“= D¬2¯9ª9°R«=Ñ$8¸BÑ#>Ñ>ˆDØ‰<˜4¤2§9¢9¨R£=Ó0Ü—9’9˜R“=¤B§I¢I¨b£M°DÑ$8¸BÑ#>Ñ>ˆDà
�‰�DÔð �;‰;‹=€DØÑ$Ø�J‰JØ�‰G”b—g’g˜fŸj™j›lÓ+Ñ+Øˆf‰IØØØ˜ÑØØØØð ð 

ˆð 	
�‰�E˜&‘MÕ"à
�
‰
�4˜‘7œRŸWšW V§Z¡Z£\Ó2Ñ2°A°f±IÀaÐSTÐ\aˆ
ÑoØ‡K�K�Ôð ‡M�M�$˜j°2€MÑ6Ø‡M�M”&˜Ñ%¨Ñ,°JÈ€MÑLàÑ˜dÑ.Ø‰<Ø�5ˆDØ‰<Ø�5ˆDà
�‰�D˜$ÔàÑØ
�‰�U°rˆÑ:Ø‡H�H×Ñ Ô)Ø‡H�H×Ñ Ô'Ø‡I�IˆgÑ×"Ñ" 5Ô)Ø‡I�IˆeÑ× Ñ  Ô'Ø‡N�N˜Àb€NÑIØ—‘×!Ñ!Ö#ˆØ×Ñ˜JÖ'ñ $ä�"�Q‘%œ×ÑØ
�‰©FÓ3ªF q�x ”{©FÑ3Ô4Ø
×Ñ˜6¬D¸*ÈrÑ,RÐÑSÞÜ×$Ò$Õ&Ü×!Ò! (¬NÔ;Ü�HŠHŒJ÷ 'Ð&ð ùòW Zùò~ <ùòT 4÷ 'Õ&ús   Ãs5à2s:ñ0s?ò:1tô
t)rº   r   r   zstr | Explanation | Noner»   Úboolr¾   zfloat | Literal['auto']r?   rr   r¿   z
str | NonerÀ   r   rÁ   r   r    r   r!   r   rÂ   zdict[str, Any] | Noner   zplt.Axes | NonerÃ   rd   r   r&  )ró   úfloat | Nonerô   r'  r+   ú
np.ndarrayÚreturnztuple[float, float])r+   r(  r)  rr   )r   r  )NNNNr   r   r   Nr   r   r   NNNNTNN)&Ú
__future__r   r	  r¶   r   r   r”   Úmatplotlib.pyplotÚpyplotrl   Únumpyrg   Úpandasr…   Úmatplotlib.markersr   Ú_explanationr   Úutilsr	   r
   Úutils._exceptionsr   Úutils._generalr   r(   r   Ú_labelsr   Ú_utilsr   r   r  rp   rk   r‰   r«   r   © rø   rð   Ú<module>r7     sV  ðÝ "ã Û ß ã Ý Û Û Ý *å &ß :Ý .Ý 3Ý Ý ß 3ð '0ØØØ	�‰ØØ(.ØØØØØØØ%)ØØØð#UØðUà#ðUð ðUð &ðUð ðUð ðUð ðUð ðUð ðUð ðUð #ðUð 	ðUð  ð!Uð" õ#Uôp	ôô6,,ðb ØØØØØ
ØØ	ØØØ
Ø
Ø	Ø	ØØ	Ø	Ø	õ'Vrø   