-
Notifications
You must be signed in to change notification settings - Fork 834
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
fix: correct the objective param when using fobj #1292
fix: correct the objective param when using fobj #1292
Conversation
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
I put some instructions in your raised issue and but I will also put the localbuild instructions here https://microsoft.github.io/SynapseML/docs/reference/developer-readme/ |
Codecov Report
@@ Coverage Diff @@
## master #1292 +/- ##
==========================================
+ Coverage 75.62% 83.36% +7.73%
==========================================
Files 273 273
Lines 13453 13453
Branches 689 689
==========================================
+ Hits 10174 11215 +1041
+ Misses 3279 2238 -1041
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice find and fix!
Interesting I don't see "custom" value for objective mentioned in the lightgbm docs here: but I do see it for metric: |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Currently there will be no objective param if a fobj is provided.
That caused the LightGBM mistakenly think it's regression during initial setup as that's the [default value] for it(https://github.com/microsoft/LightGBM/blob/master/include/LightGBM/config.h#L139).
It may seem harmless at first glance as we are providing grad and hess during iteration. But it actually makes the output incorrect by having the
is_constant_hessian
to true all the time (which is the case for unweighted regression), and cause the calculated sum_hessian split incorrect, which eventually leads to wrong model output.The fix I propose here is simply to pass
objective=custom
rather than no objective in param when provided fobj.I'm pretty new to Scala and Java as this is the first Scala project I've seen. I've tested things in sbt console. But not sure how to setup the environment properly as something fails when I run sbt test on master without any change. Would be really appreciate if anyone can point me to any updated doc I can reference. (the runme link in Contribute.md leads to 404).
Could also include code similar with the code below (which I used to debug the mismatch) as a test case if needed. You may also use the same code to verify the bug.