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
542c34dd
Unverified
Commit
542c34dd
authored
Aug 23, 2018
by
Guolin Ke
Committed by
GitHub
Aug 23, 2018
Browse files
fix the negative dimension error in python predict
parent
941068ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/c_api.cpp
src/c_api.cpp
+3
-3
No files found.
src/c_api.cpp
View file @
542c34dd
...
...
@@ -224,7 +224,7 @@ public:
OMP_LOOP_EX_END
();
}
OMP_THROW_EX
();
*
out_len
=
nrow
*
num_pred_in_one_row
;
*
out_len
=
num_pred_in_one_row
*
nrow
;
}
void
Predict
(
int
num_iteration
,
int
predict_type
,
const
char
*
data_filename
,
...
...
@@ -1088,8 +1088,8 @@ int LGBM_BoosterCalcNumPredict(BoosterHandle handle,
int64_t
*
out_len
)
{
API_BEGIN
();
Booster
*
ref_booster
=
reinterpret_cast
<
Booster
*>
(
handle
);
*
out_len
=
static_cast
<
int64_t
>
(
num_row
*
ref_booster
->
GetBoosting
()
->
NumPredictOneRow
(
num_iteration
,
predict_type
==
C_API_PREDICT_LEAF_INDEX
,
predict_type
==
C_API_PREDICT_CONTRIB
)
)
;
*
out_len
=
static_cast
<
int64_t
>
(
num_row
)
*
ref_booster
->
GetBoosting
()
->
NumPredictOneRow
(
num_iteration
,
predict_type
==
C_API_PREDICT_LEAF_INDEX
,
predict_type
==
C_API_PREDICT_CONTRIB
);
API_END
();
}
...
...
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