I'm trying to set up a xgboost model and a piece of my code is:
dtrain <- xgb.DMatrix(data = new_tr,label = labels)
dtest <- xgb.DMatrix(data = new_ts,label=labels_test)
but I have this error:
> dtrain <- xgb.DMatrix(data = new_tr,label = labels)
Error in setinfo.xgb.DMatrix(dmat, names(p), p[[1]]) :
The length of labels must equal to the number of rows in the input data
the lenght of my data are:
Someone can help me to find what is the problem?