[breaking] Add prediction fucntion for DMatrix and use inplace predict for dask. (#6668)
* Add a new API function for predicting on `DMatrix`. This function aligns with rest of the `XGBoosterPredictFrom*` functions on semantic of function arguments. * Purge `ntree_limit` from libxgboost, use iteration instead. * [dask] Use `inplace_predict` by default for dask sklearn models. * [dask] Run prediction shape inference on worker instead of client. The breaking change is in the Python sklearn `apply` function, I made it to be consistent with other prediction functions where `best_iteration` is used by default.
This commit is contained in:
@@ -221,9 +221,10 @@ TEST(Learner, MultiThreadedPredict) {
|
||||
auto &entry = learner->GetThreadLocal().prediction_entry;
|
||||
HostDeviceVector<float> predictions;
|
||||
for (size_t iter = 0; iter < kIters; ++iter) {
|
||||
learner->Predict(p_data, false, &entry.predictions);
|
||||
learner->Predict(p_data, false, &predictions, 0, true); // leaf
|
||||
learner->Predict(p_data, false, &predictions, 0, false, true); // contribs
|
||||
learner->Predict(p_data, false, &entry.predictions, 0, 0);
|
||||
|
||||
learner->Predict(p_data, false, &predictions, 0, 0, false, true); // leaf
|
||||
learner->Predict(p_data, false, &predictions, 0, 0, false, false, true); // contribs
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user