In the context of machine learning, let's say you have a problem in which classes in the real population are not balanced - eg Class A occurs 80% of the time and Class B occurs 20% of the time.
In such a case, is it generally better to have a given ML algorithm rely on data with the same 80/20 class ratio, or data with a balanced (50/50) ratio? a) with regards to training data b) with regards to test data
A followup question: In case the answer for (a) or (b) happens to be going with the balanced 50/50 ratio, then does this preference generally still persist even in the practical context where the data one has access to happens to be of the 80/20 ratio? In other words, would the benefit of using a balanced ratio to train and/or test outweigh the cost of enforcing that ratio (e.g. by discarding instances from the majority class or generating new synthetic samples of the minority class)?