【发布时间】:2019-09-08 03:42:23
【问题描述】:
我正在尝试使用 SMOTE 来处理二进制分类中的不平衡类数据,我知道的是:如果我们使用,例如
sm = SMOTE(ratio = 1.0, random_state=10)
Before OverSampling, counts of label '1': [78]
Before OverSampling, counts of label '0': [6266]
After OverSampling, counts of label '1': 6266
After OverSampling, counts of label '0': 6266
对于 1 类为少数的情况,将导致 0 类和 1 类的数量为 50:50
和
sm = SMOTE(ratio = 0.5, random_state=10)
Before OverSampling, counts of label '1': [78]
Before OverSampling, counts of label '0': [6266]
After OverSampling, counts of label '1': 3133
After OverSampling, counts of label '0': 6266
将导致类 1 的大小减半。
我的问题:
我们如何设置比率以使 1 类比 0 类获得更多,例如 75:25?
【问题讨论】:
标签: python pandas scikit-learn preprocessor smote