imbalanced-learn: Deal with an Imbalanced Dataset

When training a sensitive classifier using an imbalanced dataset, it might work well on the majority class but work poorly on the minority class.

To deal with an imbalanced dataset, we can use imbalanced-learn to generate new samples in the classes which are under-represented. 

The image above shows an imbalanced dataset before and after using RandomOverSampler from imbalanced-learn.

Link to imbalanced-learn.

Code to create the image above.

Scroll to Top