Update xgb.cv.R

This commit is contained in:
Tong He 2015-05-28 09:30:23 -07:00
parent 733d23aef8
commit f9ae83e951

View File

@ -206,7 +206,7 @@ xgb.cv <- function(params=list(), data, nrounds, nfold, label = NULL, missing =
# early_Stopping
if (!is.null(early.stop.round)){
score = strsplit(ret,'\\s+')[[1]][1+length(metrics)+1]
score = strsplit(ret,'\\s+')[[1]][1+length(metrics)+2]
score = strsplit(score,'\\+|:')[[1]][[2]]
score = as.numeric(score)
if ((maximize && score>bestScore) || (!maximize && score<bestScore)) {