我尝试在库的函数中使用early.stop.round
参数,但是,我得到了一个错误。在我离开未指定后,该函数运行没有任何问题。我做错了什么?xgb.cv
xgboost
early.stop.round
这是我的示例代码:
library(xgboost)
train = matrix(as.numeric(1:100),20,5)
Y = rep(c(0,1),10)
dtrain = xgb.DMatrix(train, label=Y)
#cross validation when early.stop.round =5, gives an error
CV = xgb.cv(data = dtrain, nround=200, nfold =2, metrics=list("auc"),
objective = "binary:logistic",early.stop.round = 5)
#cross validation when early.stop.round is not specified, works
CV = xgb.cv(data = dtrain, nround=200, nfold =2, metrics=list("auc"),
objective = "binary:logistic")
我在用xgboost_0.4-2