fix early stopping

This commit is contained in:
hetong007
2015-05-11 16:53:51 -07:00
parent 83ace55f51
commit 90096e718c
3 changed files with 4 additions and 4 deletions

View File

@@ -187,7 +187,7 @@ xgb.train <- function(params=list(), data, nrounds, watchlist = list(),
bestScore = score
bestInd = i
} else {
if (i-bestInd>early_stop_round) {
if (i-bestInd>=early_stop_round) {
earlyStopflag = TRUE
cat('Stopping. Best iteration:',bestInd)
break