Skip to content

Commit

Permalink
[python-package] avoid data_has_header check in predict()
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb committed Jul 11, 2023
1 parent 7140396 commit 3ea7426
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(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 3ea7426

Please sign in to comment.