Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/28.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R 为什么xgboost在数据参数中返回数据类型错误?_R_Xgboost_Quantmod - Fatal编程技术网

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)