diff --git a/python-package/lightgbm/basic.py b/python-package/lightgbm/basic.py index edd29e9a4aa0..f136142b61e5 100644 --- a/python-package/lightgbm/basic.py +++ b/python-package/lightgbm/basic.py @@ -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