Data Science Stack Exchange
2026-11-12 16:25 UTC
By GYA007
AI-111-20261112-social-media-61935c3b
Should my dataset be perfectly balanced before training?
I originally pre-processed my discrete dataset of text to class (size of 46260 entries - combined two datasets, changed the label names and etc), during this I obtained a very imbalanced dataset with the proportions below: class 0 0.792131 1 0.153459 2 0.054410 Still pre-processing, I balanced the classes by undersampling the majority class to the minority class to get the proportions below (dataset size is now 7551). class 1 0.333333 0 0.333333 2 0.333333 Of which I will split into training, validation, and test data using the standard k-fold cross validation. I see around that sometimes it's bad to have a dataset this perfectly balanced, as seen above. Would it be better to not balance the data set in pre-processing, instead using stratified k-fold cross validation on the training data and applying SMOTE-N? Especially with the unbalanced-ness of the dataset.
I originally pre-processed my discrete dataset of text to class (size of 46260 entries - combined two datasets, changed the label names and etc), during this I obtained a very imbalanced dataset with the proportions below: class 0 0.792131 1 0.153459 2 0.054410 Still pre-processing, I balanced the classes by undersampling the majority class to the minority class to get the proportions below (dataset size is now 7551). class 1 0.333333 0 0.333333 2 0.333333 Of which I will split into training, validation, and test data using the standard k-fold cross validation. I see around that sometimes it's bad to have a dataset this perfectly balanced, as seen above. Would it be better to not balance the data set in pre-processing, instead using stratified k-fold cross validation on the training data and applying SMOTE-N? Especially with the unbalanced-ness of the dataset.
Full article content could not be extracted automatically. Read the original below.
Source:
Data Science Stack Exchange
· datascience.stackexchange.com