§
    qŠtj
  ã                   ó(   — d Z ddlmZ ddlmZ d„ ZdS )z8Utility function to get the number of bootstrap samples.é    )ÚIntegral)Úwarnc           	      ó&  — |€| S t          |t          ¦  «        r|S |€	| }d|› d�}n|                     ¦   «         }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.
    Nz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         úY/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sklearn/ensemble/_bootstrap.pyÚ_get_n_samples_bootstrapr   
   sþ   € ðD ÐØÐÝ	�K¥Ñ	*Ô	*ð ØÐàÐØ&ÐØ!RÐ=OÐ!RÐ!RÐ!RÐÐà*×.Ò.Ñ0Ô0ÐàGÐ2DÐGÐGÐGð 	õ
 �c +Ð0BÑ"BÑCÔCÀQÑGÔGÐð �S  Y°5Ñ%9Ñ:Ô:Ò:Ð:ÝðH¨+ð Hð HÐ>Tð Hð HØ(;ðHð Hð Hñ	
ô 	
ð 	
ð
 Ðó    N)Ú__doc__Únumbersr   Úwarningsr   r   © r   r   ú<module>r      sJ   ðØ >Ð >ð
 Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð ð;ð ;ð ;ð ;ð ;r   