More support for column split in cpu predictor (#9244)

- Added column split support to `PredictInstance` and `PredictLeaf`.
- Refactoring of tests.
This commit is contained in:
Rong Ou
2023-06-04 17:05:38 -07:00
committed by GitHub
parent 3bf0f145bb
commit 962a20693f
4 changed files with 108 additions and 119 deletions

View File

@@ -134,16 +134,18 @@ class Predictor {
* usually more efficient than online prediction This function is NOT
* threadsafe, make sure you only call from one thread.
*
* \param inst The instance to predict.
* \param [in,out] out_preds The output preds.
* \param model The model to predict from
* \param tree_end (Optional) The tree end index.
* \param inst The instance to predict.
* \param [in,out] out_preds The output preds.
* \param model The model to predict from
* \param tree_end (Optional) The tree end index.
* \param is_column_split (Optional) If the data is split column-wise.
*/
virtual void PredictInstance(const SparsePage::Inst& inst,
std::vector<bst_float>* out_preds,
const gbm::GBTreeModel& model,
unsigned tree_end = 0) const = 0;
unsigned tree_end = 0,
bool is_column_split = false) const = 0;
/**
* \brief predict the leaf index of each tree, the output will be nsample *