R 为什么xgboost在数据参数中返回数据类型错误?
我差一点用叉子叉了 但是在R 为什么xgboost在数据参数中返回数据类型错误?,r,xgboost,quantmod,R,Xgboost,Quantmod,我差一点用叉子叉了 但是在 bstXGBoost无法接受字符数据。你忘了里面有一个字符类型的东西。您需要删除它或以某种方式处理它(例如一种热编码)XGBoost无法接受字符数据。你忘了里面有一个字符类型的东西。您需要删除它或以某种方式处理它(例如,一个热编码) bst <- xgboost(data = as.matrix(train[,predictorNames]), label = train$outcome, verbose = 0,
bstXGBoost无法接受字符数据。你忘了里面有一个字符类型的东西。您需要删除它或以某种方式处理它(例如一种热编码)XGBoost无法接受字符数据。你忘了里面有一个字符类型的东西。您需要删除它或以某种方式处理它(例如,一个热编码)
bst <- xgboost(data = as.matrix(train[,predictorNames]),
label = train$outcome,
verbose = 0,
eta = 0.1,
gamma = 50,
nround = 50,
colsample_bytree = 0.1,
subsample = 8.6,
objective="binary:logistic")
predictions <- predict(bst, as.matrix(test[,predictorNames]), outputmargin=TRUE)