LightGBM icon indicating copy to clipboard operation
LightGBM copied to clipboard

Suggestion for EvalAndCheckEarlyStopping function

Open tt83 opened this issue 9 years ago • 3 comments

When early stopping is met last early_stopping_round_ models are removed, but scores are not:

    // pop last early_stopping_round_ models
    for (int i = 0; i < early_stopping_round_ * num_tree_per_iteration_; ++i) {
      models_.pop_back();
    }

May be better to update scores as well, something like this:

    for (int i = 0; i < early_stopping_round_; ++i) {
    	RollbackOneIter();
    }

tt83 avatar Sep 28 '17 21:09 tt83

@tt83 will you use that score ?

guolinke avatar Sep 29 '17 02:09 guolinke

Yes, I use. But if it is a feature, never mind.

tt83 avatar Sep 29 '17 10:09 tt83

@tt83 adding this will slow down, since roll back one iteration is not efficient. It is better to not use the score. If you really want to use it, you can predict from begin.

guolinke avatar Oct 27 '17 08:10 guolinke