I would like to have my trained model tested on an imbalanced dataset. Is there any algorithms available to generate synthetic data from a balanced labelled dataset (spam/non-spam)?

  • $\begingroup$ You can always unbalance any data set by simply undersampling one class. $\endgroup$ – user2974951 Sep 19 '18 at 10:54

Try SMOTE, its an algorithm used for over-sampling. It creates synthetic samples from the class you want over-sampled.

You can use this to create any number of samples you need.

  • 1
    $\begingroup$ can SMOTE be used for under-sampling as well? $\endgroup$ – Stuart Peterson Sep 19 '18 at 13:12
  • $\begingroup$ Well, you can obtain undersampling of class A by oversampling class notA ... $\endgroup$ – kjetil b halvorsen Sep 19 '18 at 14:30
  • 3
    $\begingroup$ @StuartPeterson No, SMOTE is an over-sampling algorithm, but there are many other under-sampling algorithms $\endgroup$ – Mary93 Sep 24 '18 at 18:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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