繁体   English   中英

使用欠采样和过采样的不平衡分类 pytorch python

[英]imbalanced classification using undersampling and oversampling using pytorch python

I want to use oversampling and under sampling techniques together I have 6 classes with number of samples as following: class 0 250000 class 1 48000 class 2 40000 class 3 38000 class 4 35000 class 5 7000 I want to use smot to make all classes balance and相等相同的尺寸class 0 40000 class 1 40000 class 2 40000 class 3 40000 0000 class 440000型号88398112121212121212195188 4400 y 40000 y44188888888888888888888888888888888888888888888888888888888888888888888888888.

我试试这个

ros = RandomUnderSampler()
X, y=ros.fit_resample(mydata, labels)
strategy = {0:40000, 1:40000, 2:40000, 3:40000, 4:40000, 5:40000}
over = SMOTE(sampling_strategy=strategy)
X, y=over.fit_resample(X, y)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM