Skip to content

Commit

Permalink
[python-package] avoid data_has_header check in predict() (#5970)
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Jul 12, 2023
1 parent 28e0e6f commit 84c657e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python-package/lightgbm/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -961,14 +961,13 @@ def predict(
predict_type = _C_API_PREDICT_LEAF_INDEX
if pred_contrib:
predict_type = _C_API_PREDICT_CONTRIB
int_data_has_header = 1 if data_has_header else 0

if isinstance(data, (str, Path)):
with _TempFile() as f:
_safe_call(_LIB.LGBM_BoosterPredictForFile(
self._handle,
_c_str(str(data)),
ctypes.c_int(int_data_has_header),
ctypes.c_int(data_has_header),
ctypes.c_int(predict_type),
ctypes.c_int(start_iteration),
ctypes.c_int(num_iteration),
Expand Down

0 comments on commit 84c657e

Please sign in to comment.