I was going through the article in which the project on imbalanced data was give. However I got stuck in the part where the xgboost technique is to be applied for top 20 features.
Here is the code where I got stuck.
xgb_confused <- confusionMatrix(filtered.data$income_level,xgb_prediction)
Error in confusionMatrix.default(filtered.data$income_level, xgb_prediction) :
The data must contain some levels that overlap the reference.