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.
◆ TreeliteGTILGetPredictOutputSize()
int TreeliteGTILGetPredictOutputSize |
( |
ModelHandle |
model, |
|
|
size_t |
num_row, |
|
|
size_t * |
out |
|
) |
| |
Given a batch of data rows, query the necessary size of array to hold predictions for all data points.
- Parameters
-
model | Treelite Model object |
num_row | Number of rows in the input |
out | Size of output buffer that should be allocated |
- Returns
- 0 for success; -1 for failure
Definition at line 258 of file c_api.cc.
◆ TreeliteGTILPredict()
int TreeliteGTILPredict |
( |
ModelHandle |
model, |
|
|
const float * |
input, |
|
|
size_t |
num_row, |
|
|
float * |
output, |
|
|
int |
nthread, |
|
|
int |
pred_transform, |
|
|
size_t * |
out_result_size |
|
) |
| |
Predict with a 2D dense array.
- Parameters
-
model | Treelite 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 TreeliteGTILGetPredictOutputSize() 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. |
out_result_size | Size of output. This could be smaller than TreeliteGTILGetPredictOutputSize() but could never be larger than TreeliteGTILGetPredictOutputSize(). |
- Returns
- 0 for success; -1 for failure
Definition at line 265 of file c_api.cc.