Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify meaning of training parameter in XGBoosterPredict() #5604

Merged
merged 5 commits into from
Apr 25, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions include/xgboost/c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,12 @@ XGB_DLL int XGBoosterEvalOneIter(BoosterHandle handle,
* 4:output feature contributions to individual predictions
* \param ntree_limit limit number of trees used for prediction, this is only valid for boosted trees
* when the parameter is set to 0, we will use all the trees
* \param training Whether the prediction value is used for training.
* \param training_dart_use_dropout Whether the prediction value is used for training under DART.
* For most use cases, set it to 0. Set this parameter to 1 only if ALL of the following
* conditions hold:
* 1) you are writing a training loop (inference doesn't apply);
* 2) you are using DART;
* 3) you are using a customized objective function.
* \param out_len used to store length of returning result
* \param out_result used to set a pointer to array
* \return 0 when success, -1 when failure happens
Expand All @@ -427,7 +432,7 @@ XGB_DLL int XGBoosterPredict(BoosterHandle handle,
DMatrixHandle dmat,
int option_mask,
unsigned ntree_limit,
int training,
int training_dart_use_dropout,
bst_ulong *out_len,
const float **out_result);
/*
Expand Down
2 changes: 1 addition & 1 deletion src/c_api/c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ XGB_DLL int XGBoosterPredict(BoosterHandle handle,
DMatrixHandle dmat,
int option_mask,
unsigned ntree_limit,
int32_t training,
int training,
xgboost::bst_ulong *len,
const bst_float **out_result) {
API_BEGIN();
Expand Down