My dataset has the following class distribution

2          22696
4          2541
1          2093
5          1298
3          1116
0          960
6          14

definitely I would want to generate a new sample, for that I will use python imblearn , I have three options:

  1. oversample the minority classes
  2. undersample the majority classes
  3. choose a median class and apply both undersample the majority classes and oversamples the minority classes to equal the median class.

Later I will use the generated dataset to train three estimators RandomForest classifier, SVC and ensemble of both. I will choose the one with the best f-1 score. what would be the best option and which oversampling/undersampling algo should I use?


1 Answer 1


In general, undersampling is not very useful because you are throwing any information about the features.

SMOTE - Synthetic Minority Over-sampling Technique is useful for oversampling.

You might want to think about dropping Class #6. 14 is not a large enough sample for machine learning.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.