
    ZPhW                     r    d Z ddlZddlmZ ddlmZmZ ddlmZ  G d de          Z	 G d	 d
e          Z
dS )z+
Base class for the under-sampling method.
    N)Mapping)Interval
StrOptions   )BaseSamplerc                       e Zd ZU dZdZd                                Zd eej	        ddd           e
h d	          eegiZeed
<   dS )BaseUnderSamplerBase class for under-sampling algorithms.

    Warning: This class should not be used directly. Use the derive classes
    instead.
    zunder-samplinga\  sampling_strategy : float, str, dict, callable, default='auto'
        Sampling information to sample the data set.

        - When ``float``, it corresponds to the desired ratio of the number of
          samples in the minority class over the number of samples in the
          majority class after resampling. Therefore, the ratio is expressed as
          :math:`\alpha_{us} = N_{m} / N_{rM}` where :math:`N_{m}` is the
          number of samples in the minority class and
          :math:`N_{rM}` is the number of samples in the majority class
          after resampling.

          .. warning::
             ``float`` is only available for **binary** classification. An
             error is raised for multi-class classification.

        - When ``str``, specify the class targeted by the resampling. The
          number of samples in the different classes will be equalized.
          Possible choices are:

            ``'majority'``: resample only the majority class;

            ``'not minority'``: resample all classes but the minority class;

            ``'not majority'``: resample all classes but the majority class;

            ``'all'``: resample all classes;

            ``'auto'``: equivalent to ``'not minority'``.

        - When ``dict``, the keys correspond to the targeted classes. The
          values correspond to the desired number of samples for each targeted
          class.

        - When callable, function taking ``y`` and returns a ``dict``. The keys
          correspond to the targeted classes. The values correspond to the
          desired number of samples for each class.
        sampling_strategyr      rightclosed>   allautomajoritynot majoritynot minority_parameter_constraintsN)__name__
__module____qualname____doc___sampling_typerstrip_sampling_strategy_docstringr   numbersRealr   r   callabler   dict__annotations__     \/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/imblearn/under_sampling/base.pyr	   r	      s           &N$	H FHHK !R 	HW\1a888JRRRSS	
$D     r#   r	   c                       e Zd ZU dZdZd                                Zd eej	        ddd           e
h d	          eegiZeed
<   dS )BaseCleaningSamplerr
   zclean-samplinga  sampling_strategy : str, list or callable
        Sampling information to sample the data set.

        - When ``str``, specify the class targeted by the resampling. Note the
          the number of samples will not be equal in each. Possible choices
          are:

            ``'majority'``: resample only the majority class;

            ``'not minority'``: resample all classes but the minority class;

            ``'not majority'``: resample all classes but the majority class;

            ``'all'``: resample all classes;

            ``'auto'``: equivalent to ``'not minority'``.

        - When ``list``, the list contains the classes targeted by the
          resampling.

        - When callable, function taking ``y`` and returns a ``dict``. The keys
          correspond to the targeted classes. The values correspond to the
          desired number of samples for each class.
        r   r   r   r   r   >   r   r   r   r   r   r   N)r   r   r   r   r   r   r   r   r   r   r   listr   r   r    r!   r"   r#   r$   r&   r&   J   s           &N$. FHH/ !4 	HW\1a888JRRRSS	
$D     r#   r&   )r   r   collections.abcr   sklearn.utils._param_validationr   r   baser   r	   r&   r"   r#   r$   <module>r+      s      # # # # # # @ @ @ @ @ @ @ @      8 8 8 8 8{ 8 8 8v) ) ) ) )+ ) ) ) ) )r#   