Skip to content

Commit

Permalink
Merge pull request dmlc#830 from fsimond/patch-1
Browse files Browse the repository at this point in the history
Fix CV which was monitoring train-metric
  • Loading branch information
terrytangyuan committed Feb 15, 2016
2 parents 70d9732 + 2443cb9 commit 9b2b81e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R-package/R/xgb.cv.R
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,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]][2 + length(metrics)]
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)) {
Expand Down

0 comments on commit 9b2b81e

Please sign in to comment.