r - R 中的 xgboost() 错误

标签 r machine-learning xgboost

我正在尝试使用 xgboost(),但出现以下错误:

Error in xgb.DMatrix(data, label = label) : can not open file "0"

If I traceback,

traceback()
4: .Call("XGDMatrixCreateFromFile_R", data, as.integer(FALSE), PACKAGE = "xgboost")
3: xgb.DMatrix(data, label = label)
2: xgb.get.DMatrix(data, label)
1: xgboost(data = as.matrix(trainSet[, 1:13]), label = trainSet[, 
"count"], max.depth = depth, nround = rounds, objective = "reg:linear", 
verbose = 0) at #5

我收到上述错误的任何原因。我将不胜感激任何形式的帮助。

提前致谢!

最佳答案

检查您的数据是否包含字符或因子变量,并尝试将它们转换为数字。

关于r - R 中的 xgboost() 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30515775/

相关文章:

random-forest - 在 H2O 随机森林和 xgboost 中使用权重列

scala - Spark 中的 XGBoost 模型 --> 缺失值处理

python - xgboost 预测对概率的贡献

machine-learning - 如何让机器学习程序学会如何自行计算平均值

r - 部署 Shiny 的应用程序时找不到数据对象

r - 如何使用随机效应进行逐步模型(lme4 + lmerTest?)

r - 使用 auto.Arima() 和 xreg 进行 ARIMA 预测

python - 无法训练 keras 模型来逼近简单函数

python - 使用 SciPy 进行逻辑回归

从 URL 检索文件列表