Treelite
|
General Tree Inference Library (GTIL), providing a reference implementation for predicting with decision trees. GTIL is useful in cases it is infeasible to build the tree models as native shared libs. More...
#include <cstddef>
Go to the source code of this file.
Functions | |
std::size_t | Predict (const Model *model, const DMatrix *input, float *output, int nthread, bool pred_transform) |
Predict with a DMatrix. More... | |
std::size_t | Predict (const Model *model, const float *input, std::size_t num_row, float *output, int nthread, bool pred_transform) |
Predict with a 2D dense array. More... | |
std::size_t | GetPredictOutputSize (const Model *model, std::size_t num_row) |
Given a batch of data rows, query the necessary size of array to hold predictions for all data points. More... | |
std::size_t | GetPredictOutputSize (const Model *model, const DMatrix *input) |
Given a batch of data rows, query the necessary size of array to hold predictions for all data points. More... | |
General Tree Inference Library (GTIL), providing a reference implementation for predicting with decision trees. GTIL is useful in cases it is infeasible to build the tree models as native shared libs.
Copyright (c) 2021 by Contributors
Definition in file gtil.h.
std::size_t GetPredictOutputSize | ( | const Model * | model, |
std::size_t | num_row | ||
) |
Given a batch of data rows, query the necessary size of array to hold predictions for all data points.
model | Treelite Model object |
num_row | Number of rows in the input |
Definition at line 479 of file predict.cc.
Given a batch of data rows, query the necessary size of array to hold predictions for all data points.
model | Treelite Model object |
input | The input matrix |
Definition at line 483 of file predict.cc.
std::size_t Predict | ( | const Model * | model, |
const DMatrix * | input, | ||
float * | output, | ||
int | nthread, | ||
bool | pred_transform | ||
) |
Predict with a DMatrix.
model | The model object |
input | The data matrix (sparse or dense) |
output | Pointer to buffer to store the output. Call GetPredictOutputSize() to get the amount of buffer you should allocate for this parameter. |
nthread | number of CPU threads to use. Set <= 0 to use all CPU cores. |
pred_transform | After computing the prediction score, whether to transform it. |
Definition at line 447 of file predict.cc.
std::size_t Predict | ( | const Model * | model, |
const float * | input, | ||
std::size_t | num_row, | ||
float * | output, | ||
int | nthread, | ||
bool | pred_transform | ||
) |
Predict with a 2D dense array.
model | The model object |
input | The 2D data array, laid out in row-major layout |
num_row | Number of rows in the data matrix. |
output | Pointer to buffer to store the output. Call GetPredictOutputSize() to get the amount of buffer you should allocate for this parameter. |
nthread | number of CPU threads to use. Set <= 0 to use all CPU cores. |
pred_transform | After computing the prediction score, whether to transform it. |
Definition at line 468 of file predict.cc.