
    Q3j
                     &    d Z ddlmZ ddlmZ d Zy)z8Utility function to get the number of bootstrap samples.    )Integral)warnc           	          || S t        |t              r|S |	| }d| d}n|j                         }d| d}t        t	        ||z        d      }|t        d| dz        k  rt        d|d| d	| d
       |S )a  
    Get the number of samples in a bootstrap sample.

    Notes
    -----
    The frequency semantics of :term:`sample_weight` is guaranteed when
    `max_samples` is a float or integer, but not when `max_samples` is None. The
    returned `n_samples_bootstrap` will be the same between a weighted dataset
    with integer `sample_weights` and a dataset with as many rows repeated when
    `max_samples` is a float or integer. They will differ when `max_samples` is
    None (the weighted and repeated datasets do not have the same number of rows).

    Parameters
    ----------
    n_samples : int
        Number of samples in the dataset.

    max_samples : None, int or float
        The maximum number of samples to draw.

        - If None, then draw `n_samples` samples.
        - If int, then draw `max_samples` samples.
        - If float, then draw `max_samples * n_samples` unweighted samples or
          `max_samples * sample_weight.sum()` weighted samples.

    sample_weight : array of shape (n_samples,) or None
        Sample weights.

    Returns
    -------
    n_samples_bootstrap : int
        The total number of samples to draw for the bootstrap sample.
    zthe number of samples is  z#the total sum of sample weights is    
   gUUUUUU?z'Using the fractional value max_samples=z when zresults in a low number (zQ) of bootstrap samples. We recommend passing `max_samples` as an integer instead.)
isinstancer   summaxintr   )	n_samplesmax_samplessample_weightweighted_n_samplesweighted_n_samples_msgn_samples_bootstraps         H/DATA/.local/lib/python3.12/site-packages/sklearn/ensemble/_bootstrap.py_get_n_samples_bootstrapr   
   s    D 	K	*&#<=O<PPQ!R*..012D1EQG 	
 c+0B"BCQG SY5%9::6+v>T=U'(;'< =HH	

     N)__doc__numbersr   warningsr   r    r   r   <module>r      s    >
  ;r   