ó
    §ñ:i5	  ã                   ó"   • S SK rSSKJr  SS jrg)é    Né   )Ústable_cumsumc           
      óÊ  ^• U R                   nUS:X  a  U S   $ U R                   S:X  a  U R                  S5      n U R                  UR                  :w  aO  U R                  S   UR                  S   :X  a/  [        R                  " XR                  S   S45      R
                  n[        R                  " U SS9n[        R                  " XSS9n[        USS9nUS-  US   -  nUS:H  n[        R                  " Xx   Xx   S-   5      Xx'   [        R                  " [        UR                  S   5       V	s/ s H#  n	[        R                  " USS2U	4   Xy   5      PM%     sn	5      n
[        R                  " U
5      n
UR                  S   S-
  m[        R                  " U4S	 jSU
S
9n
[        R                  " U R                  S   5      nXJU4   nXU4   nUS:X  a  US   $ U$ s  sn	f )al  Compute weighted percentile

Computes lower weighted percentile. If `array` is a 2D array, the
`percentile` is computed along the axis 0.

    .. versionchanged:: 0.24
        Accepts 2D `array`.

Parameters
----------
array : 1D or 2D array
    Values to take the weighted percentile of.

sample_weight: 1D or 2D array
    Weights for each value in `array`. Must be same shape as `array` or
    of shape `(array.shape[0],)`.

percentile: int or float, default=50
    Percentile to compute. Must be value between 0 and 100.

Returns
-------
percentile : int if `array` 1D, ndarray if `array` 2D
    Weighted percentile.
r   © r   )éÿÿÿÿr   )Úaxiséd   r   Nc                 ó4   >• [         R                  " U ST5      $ )Nr   )ÚnpÚclip)ÚxÚmax_idxs    €ÚV/srv/projetos/modelo_ml_acdoc/venv/lib/python3.13/site-packages/sklearn/utils/stats.pyÚ<lambda>Ú&_weighted_percentile.<locals>.<lambda>?   s   ø€ ”"—'’'˜!˜Q Ô(ó    )r   Úarr)ÚndimÚreshapeÚshaper   ÚtileÚTÚargsortÚtake_along_axisr   Ú	nextafterÚarrayÚrangeÚsearchsortedÚapply_along_axisÚarange)r   Úsample_weightÚ
percentileÚn_dimÚ
sorted_idxÚsorted_weightsÚ
weight_cdfÚadjusted_percentileÚmaskÚiÚpercentile_idxÚ	col_indexÚpercentile_in_sortedr   s                @r   Ú_weighted_percentiler-      s×  ø€ ð4 �J‰J€EØ�ƒzØ�R‰yÐØ‡z�z�QƒØ—‘˜gÓ&ˆà‡{�{�m×)Ñ)Ó)¨e¯k©k¸!©nÀ×@SÑ@SÐTUÑ@VÓ.VÜŸš ·±¸A±ÀÐ/BÓC×EÑEˆÜ—’˜E¨Ñ*€JÜ×'Ò'¨ÈÑJ€Nô ˜~°AÑ6€JØ$ sÑ*¨Z¸©^Ñ;Ðð  !Ñ#€DÜ "§¢ØÑ!Ð#6Ñ#<¸qÑ#@ó!ÐÑô —X’Xô ˜:×+Ñ+¨AÑ.Ô/ó	
â/�ô �OŠO˜J¢q¨! tÑ,Ð.AÑ.DÖEÙ/ñ	
ó€Nô —X’X˜nÓ-€Nà×Ñ˜qÑ! AÑ%€GÜ×(Ò(Ü(¨q°nñ€Nô —	’	˜%Ÿ+™+ a™.Ó)€IØ%°iÐ&?Ñ@ÐØ¨YÐ6Ñ7€JØ! Q›Jˆ:�a‰=Ð6¨JÐ6ùò	
s   Ä1*G )é2   )Únumpyr   Úextmathr   r-   r   r   r   Ú<module>r1      s   ðÛ å "õ?7r   