-
Notifications
You must be signed in to change notification settings - Fork 188
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
Support gamma objective in LGBMRegressor #484
Support gamma objective in LGBMRegressor #484
Conversation
0e45568
to
d0d9f8b
Compare
I'll look into the failure. Could you add a unit test to check the conversion works with this objective? |
24ad09c
to
4ca02fd
Compare
@xadupre, I have added test cases for all objectives that we're currently supporting. It's also easy to add more test cases for more objectives (e.g. |
c45270d
to
9fccb8b
Compare
regressor_onnx: ModelProto = convert_lightgbm(regressor, initial_types=self._calc_initial_types(_X)) | ||
y_pred = regressor.predict(_X) | ||
y_pred_onnx = self._predict_with_onnx(regressor_onnx, _X) | ||
np.testing.assert_almost_equal( |
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.
This test is failing for some of the configuration. It should pass with lower decimal. Otherwise, it looks good.
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.
Changing the number of decimals won't make this test less flaky unfortunately (because of the precision difference in the split rules, the prediction error could be arbitrarily large). I added a new test function that allows 1 in 10,000 rows to have a difference larger than the specified decimals.
8dc9635
to
73c1f60
Compare
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
…ws to be almost equal Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
2a7e924
to
041beee
Compare
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
5d51dc0
to
51988cb
Compare
@xadupre i think all tests that i can influence are succeeding now. Two tests are failing that I don't think are related to my changes:
Feel free to merge or let me know if you need anything else. 🙂 |
Thanks, I'll have a look. The broken tests are not related. I noticed some weird failure too (coremltools 3.1 fails with scikit-learn 0.24.2 on Windows and python 3.9). |
@xadupre, considering that the failures are not related to the changes, do you think we could merge this? 🙂 |
It is possible to fix CI? The failing test fails because it is run with an old version of onnxruntime (1.0). Can you disable the test when onnxruntime is older than 1.3? |
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
e8ef764
to
53712e6
Compare
Signed-off-by: Jan-Benedikt Jagusch <jan.jagusch@gmail.com>
cdc12ab
to
aa6c525
Compare
Fixed the CI, ready to merge. 🙂 |
With this PR, I'm adding support for the
gamma
objective for theLGBMRegressor
.I don't think the failing Windows tests are related to my changes.