Xgboost Error - Need Help



I am getting the following error while i am trying to model using XGboost. My response is categorical:
Error in xgb.iter.update(bst$handle, dtrain, iteration - 1, obj) :
[17:24:03] amalgamation/…/src/objective/regression_obj.cc:108: label must be in [0,1] for logistic regression
What could be the possible reason for this and how to fix this.


Hello Shekhar,

you need to encode your response variable as numeric.
XGBoost expect response variable as numeric.

For example, if your response is binary categories (Y and N), then we need to code Y as 1 and N as 0

Hope it helps.


Jagdish Joshi