Imbalance classes problem I have a dataset of 4 classes with the following number of instances:


Class 0:  13175 
Class 1:  82 
Class 2:  75 
Class 3:  121


Have have applied several subsampling and oversampling methods from the Python imbalance-learn API but none of them had a good performance for all classes. I have applied:


Undersampling: CondensedNearestNeighbour, EditedNearestNeighbours, NeighbourhoodCleaningRule, RandomUnderSampler.
Oversampling: SMOTE, ADASYN
class_weight:['balanced'] parameter option in my grid search 
costcla library, but it does not work with more than two classes.


And I was not successful. Could you suggest a solution for this problem?
I think you're in a pretty difficult state. I think the class imbalance techniques you're using are fine. I would advise you to try framing your problem in a hierarchical classification manner.

Level 1 Classifier

classifier_A between class 0 &amp; class (1 + 2 + 3)

Note: Apply all sort of class imbalance methods to get good accuracy here

Level 2 Classifier

classifier_B between class 1, class 2, class 3

Final pseudo model

if predict_classifier_A(x_test) == "class 0":
   result = "class 0"
 else:
   result = predict_classifier_B(x_test)




I'm not sure will it work or not but its worth a try. Let us know if it worked better.