lib/xgboost.rb in xgb-0.5.0 vs lib/xgboost.rb in xgb-0.5.1
- old
+ new
@@ -59,10 +59,10 @@
# TODO handle larger better
if best_score.nil? || score < best_score
best_score = score
best_iter = iteration
best_message = message
- elsif iteration - best_iter >= early_stopping_rounds
+ elsif early_stopping_rounds && iteration - best_iter >= early_stopping_rounds
booster.best_iteration = best_iter
puts "Stopping. Best iteration:\n#{best_message}" if verbose_eval
break
end
end