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 equal same size
class 0 40000
class 1 40000
class 2 40000
class 3 40000
class 4 40000
class 5 40000
I know how to make oversampling or undersampling for all data but how use them together with multi class classification

I Try this
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)

