Hi all,
I’m using the XGBoostRegressor, setting two parameters num_early_stopping_rounds
and maximize_evaluation_metrics
. Is there any way I can get the num of iter when the early stopping happen?
As show in the source code XGBoost.scala
:
if (earlyStoppingRounds > 0) {
boolean onTrack = judgeIfTrainingOnTrack(params, earlyStoppingRounds, metrics, iter);
if (!onTrack) {
String reversedDirection = getReversedDirection(params);
Rabit.trackerPrint(String.format(
"early stopping after %d %s rounds", earlyStoppingRounds, reversedDirection));
break;
}
The iter
here could be the best num of round for training the model, but I have no idea how to extract this variable.
Thank you so much.