Performs prediction on individual training instances or batches of instances for GBTree. Prediction functions all take a GBTreeModel and a DMatrix as input and output a vector of predictions. The predictor does not modify any state of the model itself.
More...
|
| Predictor (GenericParameter const *generic_param) |
|
virtual | ~Predictor ()=default |
|
virtual void | Configure (const std::vector< std::pair< std::string, std::string >> &) |
| Configure and register input matrices in prediction cache. More...
|
|
virtual void | InitOutPredictions (const MetaInfo &info, HostDeviceVector< bst_float > *out_predt, const gbm::GBTreeModel &model) const =0 |
| Initialize output prediction. More...
|
|
virtual void | PredictBatch (DMatrix *dmat, PredictionCacheEntry *out_preds, const gbm::GBTreeModel &model, uint32_t tree_begin, uint32_t tree_end=0) const =0 |
| Generate batch predictions for a given feature matrix. May use cached predictions if available instead of calculating from scratch. More...
|
|
virtual bool | InplacePredict (dmlc::any const &x, std::shared_ptr< DMatrix > p_m, const gbm::GBTreeModel &model, float missing, PredictionCacheEntry *out_preds, uint32_t tree_begin=0, uint32_t tree_end=0) const =0 |
| Inplace prediction. More...
|
|
virtual void | PredictInstance (const SparsePage::Inst &inst, std::vector< bst_float > *out_preds, const gbm::GBTreeModel &model, unsigned tree_end=0) const =0 |
| online prediction function, predict score for one instance at a time NOTE: use the batch prediction interface if possible, batch prediction is usually more efficient than online prediction This function is NOT threadsafe, make sure you only call from one thread. More...
|
|
virtual void | PredictLeaf (DMatrix *dmat, HostDeviceVector< bst_float > *out_preds, const gbm::GBTreeModel &model, unsigned tree_end=0) const =0 |
| predict the leaf index of each tree, the output will be nsample * ntree vector this is only valid in gbtree predictor. More...
|
|
virtual void | PredictContribution (DMatrix *dmat, HostDeviceVector< bst_float > *out_contribs, const gbm::GBTreeModel &model, unsigned tree_end=0, std::vector< bst_float > *tree_weights=nullptr, bool approximate=false, int condition=0, unsigned condition_feature=0) const =0 |
| feature contributions to individual predictions; the output will be a vector of length (nfeats + 1) * num_output_group * nsample, arranged in that order. More...
|
|
virtual void | PredictInteractionContributions (DMatrix *dmat, HostDeviceVector< bst_float > *out_contribs, const gbm::GBTreeModel &model, unsigned tree_end=0, std::vector< bst_float > *tree_weights=nullptr, bool approximate=false) const =0 |
|
Performs prediction on individual training instances or batches of instances for GBTree. Prediction functions all take a GBTreeModel and a DMatrix as input and output a vector of predictions. The predictor does not modify any state of the model itself.