If a dataset is imbalanced in real life, should I train on my machine learning model on an imbalanced dataset
When I undersample and train my classifier on a balanced dataset and test on a balanced dataset, the results are pretty ok


It's not surprising that the results are good since the job is easier in this case. It's actually a mistake to test on the artificially balanced dataset, since it's not a fair evaluation of how the system will perform with real data.


  Should I train the model on the original imbalanced dataset if I want it to perform well on real world test data that is also imbalanced.


Both training on the original dataset or the balanced dataset are valid methods, choosing between the two options is a matter of design and performance. It's often a good idea to try both and then pick the one which performs better than the other on the real imbalanced dataset.