Join GitHub today
Early stopping is implemented incorrectly in XGBoost.java:203 (jvm-packages) #3140
The commit hash (
The description of the problem
seems like the "&=" is not the correct operator to use, and instead it should be "|=" with decreasing initialized to false, in order to make sure consecutive "increases" in the loss function during evaluation rounds have been observed. With the current implementation the code stops after first increase, which is wrong. Probably it is a hard bug to catch in practice, I was just inspecting the implementation of early stopping and found this issue.
@superbobry Thanks for connecting to the other issue. Somewhat related question: currently there is no way to know which is the optimal treeLimit to use in predictions, correct? Presumably it would be the tree which performed the best on evaluation during training.