Skip to content

Commit

Permalink
add support for quantile objective for LGBM models (#503)
Browse files Browse the repository at this point in the history
* add support for quantile objective for LGBM models
* add test case
Signed-off-by: Mohammed Ajil <mohammed@ajil.ch>
  • Loading branch information
muyajil authored Oct 4, 2021
1 parent 2351850 commit f089575
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ def convert_lightgbm(scope, operator, container):
elif gbm_text['objective'].startswith('multiclass'):
n_classes = gbm_text['num_class']
attrs['post_transform'] = 'SOFTMAX'
elif gbm_text['objective'].startswith('regression'):
elif gbm_text['objective'].startswith(('regression', 'quantile')):
n_classes = 1 # Regressor has only one output variable
attrs['post_transform'] = 'NONE'
attrs['n_targets'] = n_classes
Expand Down
1 change: 1 addition & 0 deletions tests/lightgbm/test_objective_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class ObjectiveTest(unittest.TestCase):
"regression",
"poisson",
"gamma",
"quantile"
)

@staticmethod
Expand Down

0 comments on commit f089575

Please sign in to comment.