Machine Learning Project on Imbalanced Data


#1

@Manish
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.


#2

Hi @nishanthballal.9

From next time, I would suggest you to share your reproducible code also.
As of now, there isn’t enough information for me to resolve this problem.

However, let me try:
According to the error statement, this error says 'the xgb prediction isn’t in 0/1 format, whereas filtered.data$income_level is in 0/1 format. Check your predict.type prediction parameter. It should be set to response which creating the learner.

Regards
Manish


#3

ML_Project.zip (3.5 KB)
Hi @Manish
I have attached the code. The problem could not be solved. Kindly check the code.
It is showing an error in the 280th line. I’m unable to create a confusion matrix for the filtered data.


#4

@Manish
Could you please check the code and respond?