About balancing classes on classification

If my data have highly imbalance does it necessary to balance out the classes of the data. In my opinion, it depends on problems because if in the real world one class is less than another then the model should see that class less than another class so in this case we should not balance our data?

In the ideal world, we should try to have balanced datasets. But ideal world is just that, ideal.

A dataset with class imbalance is prone to get a model with poor performance, so we should try to pre-process the data to improve the balance.

When you have class imbalance, you can try to balance it. There are several techniques to approach this like Data Augmentation.

Also, make sure that you use appropriate metrics. For instance, using accuracy on an imbalanced dataset may not be appropriate. You may want to think about F1 score, among others.

There’s more to say about this - a Google search can provide a wealth of content.