Unverified Commit 9a964fef authored by Nikita Titov's avatar Nikita Titov Committed by GitHub
Browse files

[python] Use predefined constant in feature importance type comparison instead...

[python] Use predefined constant in feature importance type comparison instead of raw int literal (#5148)
parent 204fa9cf
...@@ -3760,7 +3760,7 @@ class Booster: ...@@ -3760,7 +3760,7 @@ class Booster:
ctypes.c_int(iteration), ctypes.c_int(iteration),
ctypes.c_int(importance_type_int), ctypes.c_int(importance_type_int),
result.ctypes.data_as(ctypes.POINTER(ctypes.c_double)))) 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) return result.astype(np.int32)
else: else:
return result return result
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment