I am trying to solve a classification problem on a highly imbalanced data set. I am using SMOTE to over sample the minority samples and down sample the majority ones. After creating a balanced data set, I applied the random forest model. But, the prediction error for the minority class is extremely high even after using a balanced data set. What could possibly be going wrong?
library(DMwR)
new.data <- SMOTE(Clicked ~ ., train, perc.over = 600, perc.under = 80)
table(new.data$Clicked)
rand.forest <- randomForest(Clicked ~., data=new.data, mtry = 7,
importance = TRUE, proximity=TRUE, ntree = 1000
)
#confusion matrix
table(yhat.rf, test$Clicked)
yhat.rf 0 1
0 889 47
1 57 7