xgboost中的NaN错误

时间:2016-06-23 15:36:50

标签: nan xgboost

我是R的新手,正在做xgboost,但它显示以下错误

  

preds< - predict(clf,testM)

xgb.DMatrix(newdata)中的错误:   矩阵中有NAN,但是,您没有设置missing = NAN

我还检查了我的xgb.DMatrix,我已经在错误中提到过:

  

dtrain< -xgb.DMatrix(data = trainMatrix,label = train_survived,missing = NaN)

执行时xgb.DMatrix没有错误

谁能告诉我问题出在哪里?

1 个答案:

答案 0 :(得分:0)

The first predict line does not contain 'dtrain' at all. I can assume that another line of code was the reason of your error.