Open smi45 opened 4 years ago
You can use my code and replace the cat1 and cat2 for your imbalance classes from sklearn.utils import resample cat_1= df[df.school_handle == 'ourmedschool'] cat_2= df[df.school_handle == 'ucfcah']
cat_large = df[df.school_handle == 'UCFCECS'] cat_1 = resample(cat_1, replace=True, n_samples=len(cat_large), random_state=RANDOM_SEED) cat_2 = resample(cat_2, replace=True, n_samples=len(cat_large), random_state=RANDOM_SEED)
df1 = pd.merge(cat_1,cat_large,how='outer') df1 = pd.merge(df1,cat_2,how='outer') df1 sns.countplot(df1.school_handle) plt.xlabel('College')
Hi, I have a use case wherein there are two classes and are hugely imbalanced. How can i fix this issue.
I have used the source code.
Sentiment Analysis with BERT