In the xgboost sklearn.py source code they retrieve the best iteration range using this code if the model was trained with early stopping rounds.
iteration_range = (0, self.best_iteration + 1)
However in the docs they say to use this to achieve the best iteration range.
ypred = bst.predict(dtest, iteration_range=(0, bst.best_iteration))
https://xgboost.readthedocs.io/en/latest/python/python_intro.html#prediction
Why the discrepancy? Which is the correct way?
Thanks!