TLDR: Will under/oversampling during the training phase teach the model the wrong distribution and adversely affect accuracy?
Let us assume you want to train a classifier to differentiate between class A and class B. Unfortunately, the population distribution of A and B is unbalanced at a ratio of
[1:100]. As such, you utilize under-sampling or over-sampling such that the training and validation sets effectively achieve a
[1:1] ratio between A and B. You do nothing to the test set. The distributions of the sets and and the training results are in the below table:
Train Val Test A Dist. 0.5 0.5 0.99 B Dist. 0.5 0.5 0.01 Accuracy 1.0 0.999 0.85
You have now trained a model which performs worse on the population than a "classify all as A" approach. Does over-sampling or under-sampling teach a model the wrong distribution - causing it to over-confidently predict minority classes? If not - what could be happening in this example?