Skip to content

Commit

Permalink
[python] Use predefined constant in feature importance type compariso…
Browse files Browse the repository at this point in the history
…n instead of raw int literal (#5148)
  • Loading branch information
StrikerRUS authored Apr 13, 2022
1 parent 204fa9c commit 9a964fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3760,7 +3760,7 @@ def feature_importance(self, importance_type='split', iteration=None):
ctypes.c_int(iteration),
ctypes.c_int(importance_type_int),
result.ctypes.data_as(ctypes.POINTER(ctypes.c_double))))
if importance_type_int == 0:
if importance_type_int == C_API_FEATURE_IMPORTANCE_SPLIT:
return result.astype(np.int32)
else:
return result
Expand Down

0 comments on commit 9a964fe

Please sign in to comment.