

.. _sphx_glr_auto_examples_over-sampling:

.. _over_sampling_examples:

Example using over-sampling class methods
=========================================

Data balancing can be performed by over-sampling such that new samples are generated in the minority class to reach a given balancing ratio.



.. raw:: html

    <div class="sphx-glr-thumbnails">

.. thumbnail-parent-div-open

.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example illustrates how a new sample is generated taking into account the neighbourhood of this sample. A new sample is generated by selecting the randomly 2 samples of the same class and interpolating a point between these samples.">

.. only:: html

  .. image:: /auto_examples/over-sampling/images/thumb/sphx_glr_plot_illustration_generation_sample_thumb.png
    :alt:

  :doc:`/auto_examples/over-sampling/plot_illustration_generation_sample`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Sample generator used in SMOTE-like samplers</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="This example shows the effect of the shrinkage factor used to generate the smoothed bootstrap using the RandomOverSampler.">

.. only:: html

  .. image:: /auto_examples/over-sampling/images/thumb/sphx_glr_plot_shrinkage_effect_thumb.png
    :alt:

  :doc:`/auto_examples/over-sampling/plot_shrinkage_effect`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Effect of the shrinkage factor in random over-sampling</div>
    </div>


.. raw:: html

    <div class="sphx-glr-thumbcontainer" tooltip="The following example attends to make a qualitative comparison between the different over-sampling algorithms available in the imbalanced-learn package.">

.. only:: html

  .. image:: /auto_examples/over-sampling/images/thumb/sphx_glr_plot_comparison_over_sampling_thumb.png
    :alt:

  :doc:`/auto_examples/over-sampling/plot_comparison_over_sampling`

.. raw:: html

      <div class="sphx-glr-thumbnail-title">Compare over-sampling samplers</div>
    </div>


.. thumbnail-parent-div-close

.. raw:: html

    </div>


.. toctree::
   :hidden:

   /auto_examples/over-sampling/plot_illustration_generation_sample
   /auto_examples/over-sampling/plot_shrinkage_effect
   /auto_examples/over-sampling/plot_comparison_over_sampling

