Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
tianlh
LightGBM-DCU
Commits
84c657e8
Unverified
Commit
84c657e8
authored
Jul 12, 2023
by
James Lamb
Committed by
GitHub
Jul 12, 2023
Browse files
[python-package] avoid data_has_header check in predict() (#5970)
parent
28e0e6f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
python-package/lightgbm/basic.py
python-package/lightgbm/basic.py
+1
-2
No files found.
python-package/lightgbm/basic.py
View file @
84c657e8
...
@@ -961,14 +961,13 @@ class _InnerPredictor:
...
@@ -961,14 +961,13 @@ class _InnerPredictor:
predict_type
=
_C_API_PREDICT_LEAF_INDEX
predict_type
=
_C_API_PREDICT_LEAF_INDEX
if
pred_contrib
:
if
pred_contrib
:
predict_type
=
_C_API_PREDICT_CONTRIB
predict_type
=
_C_API_PREDICT_CONTRIB
int_data_has_header
=
1
if
data_has_header
else
0
if
isinstance
(
data
,
(
str
,
Path
)):
if
isinstance
(
data
,
(
str
,
Path
)):
with
_TempFile
()
as
f
:
with
_TempFile
()
as
f
:
_safe_call
(
_LIB
.
LGBM_BoosterPredictForFile
(
_safe_call
(
_LIB
.
LGBM_BoosterPredictForFile
(
self
.
_handle
,
self
.
_handle
,
_c_str
(
str
(
data
)),
_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
(
predict_type
),
ctypes
.
c_int
(
start_iteration
),
ctypes
.
c_int
(
start_iteration
),
ctypes
.
c_int
(
num_iteration
),
ctypes
.
c_int
(
num_iteration
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment