:orphan: .. _general_examples: General examples ---------------- General-purpose and introductory examples for the `imbalanced-learn` toolbox. .. raw:: html
.. _realword_examples: Examples based on real world datasets ------------------------------------- Examples which use real-word dataset. .. raw:: html
.. only:: html .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_multi_class_under_sampling_thumb.png :ref:`sphx_glr_auto_examples_applications_plot_multi_class_under_sampling.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/applications/plot_multi_class_under_sampling .. raw:: html
.. only:: html .. figure:: /auto_examples/applications/images/thumb/sphx_glr_plot_over_sampling_benchmark_lfw_thumb.png :ref:`sphx_glr_auto_examples_applications_plot_over_sampling_benchmark_lfw.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/applications/plot_over_sampling_benchmark_lfw .. raw:: html
.. _combine_examples: Examples using combine class methods ==================================== Combine methods mixed over- and under-sampling methods. Generally SMOTE is used for over-sampling while some cleaning methods (i.e., ENN and Tomek links) are used to under-sample. .. raw:: html
.. only:: html .. figure:: /auto_examples/combine/images/thumb/sphx_glr_plot_smote_enn_thumb.png :ref:`sphx_glr_auto_examples_combine_plot_smote_enn.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/combine/plot_smote_enn .. raw:: html
.. only:: html .. figure:: /auto_examples/combine/images/thumb/sphx_glr_plot_smote_tomek_thumb.png :ref:`sphx_glr_auto_examples_combine_plot_smote_tomek.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/combine/plot_smote_tomek .. raw:: html
.. _dataset_examples: Dataset examples ----------------------- Examples concerning the :mod:`imblearn.datasets` module. .. raw:: html
.. only:: html .. figure:: /auto_examples/datasets/images/thumb/sphx_glr_plot_make_imbalance_thumb.png :ref:`sphx_glr_auto_examples_datasets_plot_make_imbalance.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/datasets/plot_make_imbalance .. raw:: html
.. _ensemble_examples: Example using ensemble class methods ==================================== Under-sampling methods implies that samples of the majority class are lost during the balancing procedure. Ensemble methods offer an alternative to use most of the samples. In fact, an ensemble of balanced sets is created and used to later train any classifier. .. raw:: html
.. only:: html .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_easy_ensemble_thumb.png :ref:`sphx_glr_auto_examples_ensemble_plot_easy_ensemble.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/ensemble/plot_easy_ensemble .. raw:: html
.. only:: html .. figure:: /auto_examples/ensemble/images/thumb/sphx_glr_plot_balance_cascade_thumb.png :ref:`sphx_glr_auto_examples_ensemble_plot_balance_cascade.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/ensemble/plot_balance_cascade .. raw:: html
.. _evaluation_examples: Evaluation examples ------------------- Examples illustrating how classification using imbalanced dataset can be done. .. raw:: html
.. only:: html .. figure:: /auto_examples/evaluation/images/thumb/sphx_glr_plot_classification_report_thumb.png :ref:`sphx_glr_auto_examples_evaluation_plot_classification_report.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/evaluation/plot_classification_report .. raw:: html
.. only:: html .. figure:: /auto_examples/evaluation/images/thumb/sphx_glr_plot_metrics_thumb.png :ref:`sphx_glr_auto_examples_evaluation_plot_metrics.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/evaluation/plot_metrics .. raw:: html
.. _model_selection_examples: Model Selection --------------- Examples related to the selection of balancing methods. .. raw:: html
.. only:: html .. figure:: /auto_examples/model_selection/images/thumb/sphx_glr_plot_validation_curve_thumb.png :ref:`sphx_glr_auto_examples_model_selection_plot_validation_curve.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/model_selection/plot_validation_curve .. raw:: html
.. _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
.. only:: html .. figure:: /auto_examples/over-sampling/images/thumb/sphx_glr_plot_adasyn_thumb.png :ref:`sphx_glr_auto_examples_over-sampling_plot_adasyn.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/over-sampling/plot_adasyn .. raw:: html
.. only:: html .. figure:: /auto_examples/over-sampling/images/thumb/sphx_glr_plot_random_over_sampling_thumb.png :ref:`sphx_glr_auto_examples_over-sampling_plot_random_over_sampling.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/over-sampling/plot_random_over_sampling .. raw:: html
.. only:: html .. figure:: /auto_examples/over-sampling/images/thumb/sphx_glr_plot_smote_thumb.png :ref:`sphx_glr_auto_examples_over-sampling_plot_smote.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/over-sampling/plot_smote .. raw:: html
.. _pipeline_examples: Pipeline examples ================= Example of how to use the a pipeline to include under-sampling with `scikit-learn` estimators. .. raw:: html
.. only:: html .. figure:: /auto_examples/pipeline/images/thumb/sphx_glr_plot_pipeline_classification_thumb.png :ref:`sphx_glr_auto_examples_pipeline_plot_pipeline_classification.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/pipeline/plot_pipeline_classification .. raw:: html
.. _under_sampling_examples: Example using under-sampling class methods ========================================== Under-sampling refers to the process of reducing the number of samples in the majority classes. The implemented methods can be categorized into 2 groups: (i) fixed under-sampling and (ii) cleaning under-sampling. .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_tomek_links_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_tomek_links.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_tomek_links .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_one_sided_selection_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_one_sided_selection.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_one_sided_selection .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_random_under_sampler_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_random_under_sampler.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_random_under_sampler .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_neighbourhood_cleaning_rule_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_neighbourhood_cleaning_rule.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_neighbourhood_cleaning_rule .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_condensed_nearest_neighbour_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_condensed_nearest_neighbour.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_condensed_nearest_neighbour .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_cluster_centroids_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_cluster_centroids.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_cluster_centroids .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_instance_hardness_threshold_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_instance_hardness_threshold.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_instance_hardness_threshold .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_nearmiss_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_nearmiss.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_nearmiss .. raw:: html
.. only:: html .. figure:: /auto_examples/under-sampling/images/thumb/sphx_glr_plot_enn_renn_allknn_thumb.png :ref:`sphx_glr_auto_examples_under-sampling_plot_enn_renn_allknn.py` .. raw:: html
.. toctree:: :hidden: /auto_examples/under-sampling/plot_enn_renn_allknn .. raw:: html
.. container:: sphx-glr-footer .. container:: sphx-glr-download :download:`Download all examples in Python source code: auto_examples_python.zip ` .. container:: sphx-glr-download :download:`Download all examples in Jupyter notebooks: auto_examples_jupyter.zip ` .. rst-class:: sphx-glr-signature `Generated by Sphinx-Gallery `_