3
$\begingroup$

I have a dataset in which class A has 99.8%, class B 0.1% and class C 0.1%. If I train my model on this dataset, it predicts always class A. If I do oversampling, it predicts the classes evenly. I want my model to predict class A around 98% of the time, class B 1% and class C 1%. How can I do that?

$\endgroup$
  • $\begingroup$ What do you mean? If you do oversampling, the results of inference will still be correct, with whatever percentage A is and whatever percentage B is and C. $\endgroup$ – Clement Hui Jan 4 at 11:53
  • $\begingroup$ Hi and welcome to this community! You say "If I train my model on this dataset, it predicts always class A", but are you sure it always predicts A? Have you tried to give an input similar to the ones in class B or C and see if it predicts respectively B or C? $\endgroup$ – nbro Jan 4 at 23:27
  • $\begingroup$ @nbro In my test set which has around 80k samples, it always predicts class A. $\endgroup$ – Johnny P. Jan 5 at 18:29
  • $\begingroup$ @JohnnyP. But do you have the labels for your 80k test samples? $\endgroup$ – nbro Jan 5 at 19:36
  • $\begingroup$ @nbro Yes, I have them. $\endgroup$ – Johnny P. Jan 6 at 8:56

Your Answer

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

Browse other questions tagged or ask your own question.