试图在RSME中找到最佳迭代,但没有得到任何值

试图在RSME中找到最佳迭代,但没有得到任何值,r,iteration,xgboost,R,Iteration,Xgboost,我正在用下面的代码安装xgboost型号 dtrain <- xgb.DMatrix(subset(ohlcdfTrn, select = -c(annRet, actualTerm, actualReturn, total_pymnt)), label = ohlcdfTrn[,"actualReturn"]) xgb_Mrcv <- xgb.cv(data = dtrain, nrounds = 1000, max.depth = 4, nfold = 5,

我正在用下面的代码安装xgboost型号

dtrain <- xgb.DMatrix(subset(ohlcdfTrn, select = -c(annRet, actualTerm, actualReturn, total_pymnt)), label = ohlcdfTrn[,"actualReturn"])
xgb_Mrcv <- xgb.cv(data = dtrain, nrounds = 1000, max.depth = 4, nfold = 5, eta = .05, objective = "reg:squarederror")

bestiter <- which.min(xgb_Mrcv$evaluation_log$test_rsme_mean)

dtrain您有一个输入错误,它应该是
xgb\u Mrcv$evaluation\u log$test\u rmse\u mean
您有一个输入错误,它应该是
xgb\u Mrcv$evaluation\u log$test\u rmse\u mean