improve demo of cv in R

This commit is contained in:
hetong007
2015-01-20 14:35:44 -08:00
parent 947f0a926d
commit eb01acfad8
2 changed files with 5 additions and 1 deletions

View File

@@ -45,3 +45,7 @@ param <- list(max.depth=2,eta=1,silent=1)
xgb.cv(param, dtrain, nround, nfold = 5,
obj = logregobj, feval=evalerror)
# do cross validation with prediction values for each fold
res <- xgb.cv(param, dtrain, nround, nfold=5, prediction = TRUE)
res$dt
length(res$pred)