我的数据集具有以下分布:
class frequency
0 960
1 2093
2 22696
3 1116
4 2541
5 1298
6 14
我正在使用python-imblearn
对少数群体进行过度抽样。使用regular
后,我可以生成200个6级样本,但l1borderline
或l2borderline
我无法这样做。
from imblearn.over_sampling import SMOTE
sm=SMOTE(ratio={6:200})
# output
>>> Presampled shape Counter({2: 22696, 4: 2541, 1: 2093, 5: 1298, 3: 1116, 0: 960, 6: 14})
>>> resampled shape Counter({2: 22696, 4: 2541, 1: 2093, 5: 1298, 3: 1116, 0: 960, 6: 200})
sm=SMOTE(kind='borderline1',ratio={6:200})
# output
>>> Presampled shape Counter({2: 22696, 4: 2541, 1: 2093, 5: 1298, 3: 1116, 0: 960, 6: 14})
>>> resampled shape Counter({2: 22696, 4: 2541, 1: 2093, 5: 1298, 3: 1116, 0: 960, 6: 14})
sm=SMOTE(kind='borderline2',ratio={6:200})
# output
>>> Presampled shape Counter({2: 22696, 4: 2541, 1: 2093, 5: 1298, 3: 1116, 0: 960, 6: 14})
>>> resampled shape Counter({2: 22696, 4: 2541, 1: 2093, 5: 1298, 3: 1116, 0: 960, 6: 14})
有什么数学或我遗失的东西吗?