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
Unknown objective function during predict, only in 1.3.0 RC (1.2.0 ok) #6460
Comments
@pseudotensor Can you post your code so that I can try running it on my end? |
Yes, slimming down to MRE |
But question: Why should predict ever need the custom loss function in first place? |
Hard to isolate to MRE. If I just put the predict call in a try-except and try again, there is no problem. So seems like problem is setting up the xgboost state for predict. |
For MRE, I've tried this basic thing:
which works and trying to make it fail by following behavior of what we do in full code. I couldn't make it fail with just subprocess stuff. I couldn't make it fail with separate files for fit/predict vs. where the custom loss function is defined. |
This is close to what we do, but it doesn't fail:
|
Not sure why the custom function ended up in xgboost string parameter. Could you please check that? |
I have a guess for what's happening. You did something like this:
It was a bug in old version that parameter set after fit in skl interface are ignored until next fit. 1.3 fixed that so the custom objective got punched into xgboost internal as python string. |
This can happen as the |
We have a custom loss test, and when upgrading to 1.3.0 it started failing. It works perfectly fine in 1.2.0. The problem happens when doing:
The predict hits:
The text was updated successfully, but these errors were encountered: