-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Booster.refit()
fails when the booster used a custom objective function fobj
#5609
Comments
Hi @jrvmalik, thanks for using LightGBM. This is deliberate because refit doesn't support using a custom objective #1699 (comment). The reason is that when training we have the option to run one boosting iteration passing the gradients and hessians, but the refit method updates all the trees in one go. LightGBM/src/boosting/gbdt.cpp Lines 353 to 389 in 6fa4673
Supporting this would involve changing the refit method, I'm not sure how extensive these changes would have to be, maybe @guolinke can comment. |
I see. Yeah it would be great if this was supported! |
Closed in favor of being in #2302, where we keep all feature requests. You're welcome to contribute this feature! Please re-open this issue (or post a comment if you are not a topic starter) if you are actively working on implementing this feature. |
This issue has been automatically locked since there has not been any recent activity since it was closed. |
Description
I first train an
lgb.Booster
with a custom objective function. I then try to update the leaf values using another dataset, but it fails on an assertion that the objective must not beNone
.Reproducible example
This yields the following error.
The expected behavior should be getting the same result as this, where the refitting succeeds.
The text was updated successfully, but these errors were encountered: