Py之imblearn:imblearn/imbalanced-learn库的简介、安装、使用方法之详细攻略

Py之imblearn:imblearn/imbalanced-learn库的简介、安装、使用方法之详细攻略

 

 

 

目录

imblearn/imbalanced-learn库的简介

imblearn/imbalanced-learn库的安装

imblearn/imbalanced-learn库的使用方法


 

 

imblearn/imbalanced-learn库的简介

        imblearn/imbalanced-learn是一个python包,它提供了许多重采样技术,常用于显示强烈类间不平衡的数据集中。它与scikit learn兼容,是 scikit-learn-contrib 项目的一部分。

在python3.6+下测试了imbalanced-learn。依赖性要求基于上一个scikit学习版本:

  • scipy(>=0.19.1)
  • numpy(>=1.13.3)
  • scikit-learn(>=0.22)
  • joblib(>=0.11)
  • keras 2 (optional)
  • tensorflow (optional)

 

 

 

imblearn/imbalanced-learn库的安装

pip install imblearn
pip install imbalanced-learn
pip install -U imbalanced-learn
conda install -c conda-forge imbalanced-learn

Py之imblearn:imblearn/imbalanced-learn库的简介、安装、使用方法之详细攻略_第1张图片

 

 

imblearn/imbalanced-learn库的使用方法

         大多数分类算法只有在每个类的样本数量大致相同的情况下才能达到最优。高度倾斜的数据集,其中少数被一个或多个类大大超过,已经证明是一个挑战,但同时变得越来越普遍。
解决这个问题的一种方法是通过重新采样数据集来抵消这种不平衡,希望得到一个比其他方法更健壮和公平的决策边界。

Re-sampling techniques are divided in two categories:

  1. Under-sampling the majority class(es).
  2. Over-sampling the minority class.
  3. Combining over- and under-sampling.
  4. Create ensemble balanced sets.

Below is a list of the methods currently implemented in this module.

  • Under-sampling

    1. Random majority under-sampling with replacement
    2. Extraction of majority-minority Tomek links [1]
    3. Under-sampling with Cluster Centroids
    4. NearMiss-(1 & 2 & 3) [2]
    5. Condensed Nearest Neighbour [3]
    6. One-Sided Selection [4]
    7. Neighboorhood Cleaning Rule [5]
    8. Edited Nearest Neighbours [6]
    9. Instance Hardness Threshold [7]
    10. Repeated Edited Nearest Neighbours [14]
    11. AllKNN [14]
  • Over-sampling

    1. Random minority over-sampling with replacement
    2. SMOTE - Synthetic Minority Over-sampling Technique [8]
    3. SMOTENC - SMOTE for Nominal Continuous [8]
    4. bSMOTE(1 & 2) - Borderline SMOTE of types 1 and 2 [9]
    5. SVM SMOTE - Support Vectors SMOTE [10]
    6. ADASYN - Adaptive synthetic sampling approach for imbalanced learning [15]
    7. KMeans-SMOTE [17]
  • Over-sampling followed by under-sampling

    1. SMOTE + Tomek links [12]
    2. SMOTE + ENN [11]
  • Ensemble classifier using samplers internally

    1. Easy Ensemble classifier [13]
    2. Balanced Random Forest [16]
    3. Balanced Bagging
    4. RUSBoost [18]
  • Mini-batch resampling for Keras and Tensorflow

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(Py之imblearn:imblearn/imbalanced-learn库的简介、安装、使用方法之详细攻略)