Skip to content

[MRG] Fix bug when warm starting with early stopping in Hist GBDT #15624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

NicolasHug
Copy link
Member

If scoring='loss', raw_prediction_val wasn't defined in case of warm-start with early stopping, which would cause an error. This is now fixed and tested.

Originally noted by @johannfaouzi in #14516

@NicolasHug
Copy link
Member Author

@adrinjalali @ogrisel @glemaitre :)

thomasjpfan
thomasjpfan previously approved these changes Nov 14, 2019
Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thomasjpfan thomasjpfan dismissed their stale review November 14, 2019 15:00

Okay so tests are failing hmm..

@johannfaouzi
Copy link
Contributor

johannfaouzi commented Nov 14, 2019

You also need to change raw_predictions.

@NicolasHug
Copy link
Member Author

You also need to change raw_predictions.

Where? we do have raw_predictions = self._raw_predict(X_binned_train) for in the warm-start case (regardless of early stopping) so I think this is correctly handled?

@glemaitre
Copy link
Member

Where? we do have raw_predictions = self._raw_predict(X_binned_train) for in the warm-start case (regardless of early stopping) so I think this is correctly handled?

If I understand properly, it is done in the following line:

https://github.com/scikit-learn/scikit-learn/pull/15624/files#diff-3adddfacb3ffd10c1e81210ef2bea2abR272

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NicolasHug NicolasHug added the Bug label Nov 14, 2019
@johannfaouzi
Copy link
Contributor

My bad, I thought that raw_predictions was not computed with warm starting.

@NicolasHug
Copy link
Member Author

Does this have your blessing @glemaitre @johannfaouzi ;)?

Copy link
Contributor

@johannfaouzi johannfaouzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (great branch name btw)

@glemaitre glemaitre merged commit 97958c1 into scikit-learn:master Nov 15, 2019
@glemaitre
Copy link
Member

Thanks @NicolasHug

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants