Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ENH add post fit calibration to HGBT #26311

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

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

lorentzenchr
Copy link
Member

@lorentzenchr lorentzenchr commented Apr 30, 2023

Reference Issues/PRs

Closes #22435

What does this implement/fix? Explain your changes.

This PR adds the parameter post_fit_calibration to HistGradientBoostingRegressor. In the case of a non-canonical link, i.e. only for loss="gamma", after the fit is more or less finished, a constant is added to the raw_predictions in link space such that on the training data (minus the validation_fraction), the balance property is fulfilled: the weighted average of predictions (predict) equals weighted average of observations, i.e. np.average(y, weights=sample_weight).

Any other comments?

TODO list:

  • add functionality
  • add tests

@github-actions
Copy link

github-actions bot commented Aug 20, 2023

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: ee20964. Link to the linter CI: here

@lorentzenchr
Copy link
Member Author

API wise, I have a questions: Should it be a separate method like HGBT.post_fit_calibrate(X, y)?

Then, concerning the actual implementation, 2 important points:

  1. I went with only calibrating on the effective training set, i.e. without the validation set.
  2. The recalibration happens after the fit, i.e. early stopping is not effected, even though this procedure changes the losses/scores.

@lorentzenchr
Copy link
Member Author

@ogrisel @thomasjpfan You may be interested.

@lorentzenchr lorentzenchr added this to the 1.4 milestone Aug 23, 2023
@lorentzenchr lorentzenchr changed the title FEA HGBT add post fit calibration for non-canonical link functions FEA HGBT add post fit calibration Aug 23, 2023
@lorentzenchr lorentzenchr changed the title FEA HGBT add post fit calibration ENH add add post fit calibration to HGBT Aug 23, 2023
@lorentzenchr lorentzenchr changed the title ENH add add post fit calibration to HGBT ENH add post fit calibration to HGBT Oct 4, 2023
@glemaitre glemaitre modified the milestones: 1.4, 1.5 Dec 7, 2023
@glemaitre
Copy link
Member

Moving the milestone to 1.5 but this seems to be an important topic.

@glemaitre glemaitre modified the milestones: 1.6, 1.7 Nov 6, 2024
@glemaitre
Copy link
Member

Moving in 1.7 but it would be in my priority to look at this for the next release.

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

Successfully merging this pull request may close these issues.

FEA post-fit calibration option in HGBT
2 participants