Geetanjali Bisht
Geetanjali Bisht

Reputation: 57

Error while running Xgboost

train_data <- sample(seq_len(nrow(completeData)),size = floor(0.75 * nrow(new_data1)))
train <- completeData[train_data, ]
test <- completeData[-train_data, ]
library(dplyr)
data <- select(train,-cardspent)
library(xgboost)
dtrain <- xgb.DMatrix(data = data, label = train$cardspent)

I was trying to run this code but after the last step I got an error saying:

Error in xgb.DMatrix(data = data, label = train$cardspent) : xgb.DMatrix: does not support to construct from list

Can anyone help me with this? Or has a better code for running Xgboost?

Upvotes: 0

Views: 641

Answers (1)

wolfe
wolfe

Reputation: 123

This may help you

?xgb.DMatrix

xgb.DMatrix

Upvotes: 1

Related Questions