0

I have a unbalanced dataset with 5 classes. Now i want so undersample it to make it more balanced. But i can´t find a code for this, just for binary class problems.

Do someone have a sample code?

  • Does this answer your question? [Scikit-learn balanced subsampling](https://stackoverflow.com/questions/23455728/scikit-learn-balanced-subsampling) – ywbaek May 19 '20 at 21:15
  • If you want to be helped more efficiently, you should be more specific by showing a extract of your data, the needed results and the code you have so far or at least a reference to the code you're talking about. – manu190466 May 19 '20 at 21:42

1 Answers1

0

Use SMOTE for that. Here is how you undersample: https://imbalanced-learn.readthedocs.io/en/stable/under_sampling.html

Pascal Zoleko
  • 691
  • 6
  • 8