
    -i                     (    S SK JrJr  SS jrSS jrg)   )_find_matching_floating_dtypeget_namespace_and_deviceNc           
         [        U 5      u  p4n[        XS9nUR                  XUS9n UR                  XUS9nU R                  nUS:X  a  U $ U R                  S:X  a  UR	                  U S5      n U R
                  UR
                  :w  aJ  U R
                  S   UR
                  S   :X  a*  UR                  XR
                  S   S45      R                  nUR                  U SS9nUR                  XSS9n	U R
                  S   n
U US   UR                  XS94   nUR                  UR                  U5      5      (       a$  UR                  UR                  U 5      USS9nSX'   UR                  U	R                  SS9nUS	-  US
   -  nUS:H  nUR                  X   X   S-   5      X'   UR                  [!        UR
                  S   5       Vs/ s H  nUR#                  UUS4   UU   5      PM     sn5      nUR
                  S   S-
  nUR%                  USU5      nUR                  U R
                  S   US9nUUU4   nU UU4   nUS:X  a  US   $ U$ s  snf )a  Compute the weighted percentile with method 'inverted_cdf'.

When the percentile lies between two data points of `array`, the function returns
the lower value.

If `array` is a 2D array, the `values` are selected along axis 0.

`NaN` values are ignored by setting their weights to 0. If `array` is 2D, this
is done in a column-isolated manner: a `NaN` in the second column, does not impact
the percentile computed for the first column even if `sample_weight` is 1D.

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

    .. versionchanged:: 1.7
        Supports handling of `NaN` values.

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_rank: int or float, default=50
    The probability level of the percentile to compute, in percent. Must be between
    0 and 100.

xp : array_namespace, default=None
    The standard-compatible namespace for `array`. Default: infer.

Returns
-------
percentile : scalar or 0D array if `array` 1D (or 0D), array if `array` 2D
    Weighted percentile at the requested probability level.
xp)dtypedevice       )r   )axis)r   .)r	   d   ).r   .)r   r   asarrayndimreshapeshapetileTargsorttake_along_axisarangeanyisnancumulative_sum	nextafterstackrangesearchsortedclip)arraysample_weightpercentile_rankr   _r	   floating_dtypen_dim
sorted_idxsorted_weights
n_featureslargest_value_per_columnsorted_nan_mask
weight_cdfadjusted_percentile_rankmaskfeature_idxpercentile_indicesmax_idxcol_indicespercentile_in_sortedresults                         F/var/www/html/venv/lib/python3.13/site-packages/sklearn/utils/stats.py_weighted_percentiler5   
   s   N -U3MB625@NJJu6JBEJJ}6JRMJJEzzzQ

5'*{{m)))ekk!n@S@STU@V.VA/BCEEE*J'''JN QJ$7RYYzYAA  
vvbhh/011,,RXXe_jq,Q*+' "">#3#3!"<J.4z'7JJ $q(D%'\\ &(@(F(J&" 
  %Z%5%5a%89		
  : OO;+,.F{.S  :		
 q!A%G!3Q@))EKKN6):K%&8+&EF'45F
6!9..!	
s   $Ic                 >    [        XX#S9[        U * USU-
  US9-
  S-  $ )Nr   r   r   )r5   )r    r!   r"   r   s       r4   _averaged_weighted_percentiler7   v   s5    U?J
v}cO6KPR
S	T	
 
    )2   N)utils._array_apir   r   r5   r7    r8   r4   <module>r<      s   g/X
r8   