Hi all
I am using XGBoostClassifier, setting two parameters num_early_stopping_rounds and maximize_evaluation_metrics. Compared to python package, I found there is no way to set validation set like watchlist. Is this feature supported or still in the plan.
Please let me know, thank you very much
[jvm-packages]xgboost4j support `early stop` on Validation set
Got it ,thank you for your reply
hi,@hcho3
I have tried to use early stop
@v0.81, but i think there’s some mistakes here:
boolean onTrack = false;
float[] criterion = metrics[metrics.length - 1];
for (int shift = 0; shift < Math.min(iter, earlyStoppingRounds) - 1; shift++) {
onTrack |= maximizeEvaluationMetrics ?
criterion[iter - shift] >= criterion[iter - shift - 1] :
criterion[iter - shift] <= criterion[iter - shift - 1];
}
return onTrack;
}
Usualy, iter
starts from 0, so it will never enter the for loop, and onTrack
will allways equal false
, and the training will stop after 1 rounds. Obviously, this is not what we want.