How to balance dataset?

I have a dataset for classification problem which it is imbalanced .it contains 68 samples for class1, 98 samples for class2 and 21 samples for class should i balance my dataset???

train_set = CostumDataset(phase='train')
validation_set = CostumDataset(phase='validation')
test_set = CostumDataset(phase='test') 



There are so many techniques for balancing dataset, but usage of them is depend on type of your data. In fact, these methods known as “data augmentation”.
Image: Data augmentation Techniques
Text: [2107.03158] A Survey on Data Augmentation for Text Classification
Audio: Data Augmentation for Audio. Data Augmentation | by Edward Ma | Medium

thanks .
actually, my data type is correlation matrix from fmri images. should i use augmentation for image?

What do you mean by “correlation matrix”? are you processing “correlation matrix” of FMRI using algorithms?!
If your meaning is FMRI images (without correlation matrix), you can use methods such as rotation, flip, shift, and etc.
Don’t forget, you can use pre-trained models when haven’t enough dataset, such as: ResNet50.

1 Like

actually i use resnet18 thank you :innocent:

1 Like