My understanding ofcross validation is that, training data is divided in to n folds. For each fold, a model is trained on all other folds and validated on the selected fold. At the end we will have n models and n validation results. We average these result out to get the cross-validation test result.
What I don’t understand is how will this work with early stopping. If I set a early stopping criteria, each model training in cross validation may stop at a different boosting round due to variation in data.
Let’s say if we do a 5 fold cv. What would happen if the 5 models stopped at boosting round 20, 17, 25, 27, 30 respectively due to early stopping? As we know the returned cv_results dataframe shows the average train and test metrics of each boosting rounds. How would it handle this case?
I tried to run a xgb.cv() and could not understand the result returned