I have an imbalanced dataset (95% in class 0 and 5% in class 1) and I am using machine learning for classification. The AUC(Area under ROC curve) was high (about 0.86) but AUPRC(Area under precision-recall curve) was very low (about 0.04) because of imbalanced dataset.
I did oversampling on training test but both AUC and AUPRC for test set became too bad!(smaller than 0.1, but for training both were good) According to stratification each class should have same rate on train and test set. so I decided to do undersampling on test set. Eventually, mu model has AUC=0.80 and AUPRC=0.79.
I am not sure this is true or not. where I made mistake? Is it correct to do undersampling on test set?
Is different rate of classes between train and test harmful in oversampling? or my model isn't good?