Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[python-package] remove 'fobj' in favor of passing custom objective function in params #5052
[python-package] remove 'fobj' in favor of passing custom objective function in params #5052
Changes from 39 commits
a70e779
9c41c6b
8ba0b72
3e21d9f
055ab28
7979173
c858d61
704d831
86a1861
8d2565b
56705fc
a0fb372
bc8cd18
b5d514b
2e20ff5
6411dee
2066513
6c0b2d9
d43c879
d281cd5
259eecb
97d8ab7
4fddac1
bf1d347
2874390
6a09e5e
457b455
ccab320
0730dfb
5b68182
9444018
a483078
3a22ab3
b272740
3a69df9
be96bcc
d10d36e
5722b73
ff4f465
8dc017a
b67fc88
8d4740a
29aff3f
c26c2a9
36ca839
3aeea17
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Please consider checking this my comment about
pop
ing the values instead of usingNone
here.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.
@StrikerRUS If we
pop
objective the following error intest_sklearn.test_multiclass_custom_objective
raisesI think the objective task is lost somewhere when predicting
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.
We could pass the value of
objective
to params based on the class instance, that is,but is more clean just to write
what's the special meaning of
None
?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.
OK, I see now.
Seems that LightGBM checks the consistency for objective and number of classes even during predicting.
LightGBM/src/io/config.cpp
Line 261 in 6b56a90
Full logs:
Let's then pass
'None'
for the custom object duringpredict
phase.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.
makes sense