I am working on a deep learning model using image data. My oversampler is converting all the samples to single class.
Initially I have 7909 images, 2480 images of class 0 and 5429 images of class 1. After applying smote (below code)
#Synthetic Minority Over-sampling Technique
sm = SMOTE(sampling_strategy='auto',random_state=56)
train_data_resampled, train_labels_resampled = sm.fit_resample(train_data.reshape(-1, IMG_SIZE * IMG_SIZE * 3), train_labels)
print(train_data_resampled.shape, train_labels_resampled.shape)
and I also tried adasyn (below code)
from imblearn.over_sampling import ADASYN
adasyn = ADASYN(sampling_strategy='minority', random_state=89, n_neighbors=5)
train_data_resampled, train_labels_resampled = adasyn.fit_resample(train_data.reshape(-1, IMG_SIZE * IMG_SIZE * 3), train_labels)
print(train_data_resampled.shape, train_labels_resampled.shape)
all my train_labels are converted to single class label, i.e., class 0. Can anyone help with this? I am working on my code in kaggle.