1
votes

iam new in R ,am doing xgboost but it is showing me the following error

preds <- predict(clf, testM)

Error in xgb.DMatrix(newdata) : There are NAN in the matrix, however, you did not set missing=NAN

i have also checked my xgb.DMatrix which is mention in the error where i have already shown :

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

there is no error in xgb.DMatrix when i executed it

Can anyone tell me where is the problem ?

1
Since you are in R you can simply run: install.packages('xgboost'). And then use it with: library(xgboost) - playful

1 Answers

0
votes

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