treelite
|
predictor class: wrapper for optimized prediction code More...
#include <predictor.h>
Classes | |
union | Entry |
data layout. The value -1 signifies the missing value. When the "missing" field is set to -1, the "fvalue" field is set to NaN (Not a Number), so there is no danger for mistaking between missing values and non-missing values. More... | |
Public Types | |
typedef void * | QueryFuncHandle |
opaque handle types | |
typedef void * | PredFuncHandle |
typedef void * | PredTransformFuncHandle |
typedef void * | LibraryHandle |
Public Member Functions | |
void | Load (const char *name) |
load the prediction function from dynamic shared library. More... | |
void | Free () |
unload the prediction function | |
size_t | PredictBatch (const CSRBatch *batch, int nthread, int verbose, bool pred_margin, float *out_result) const |
make predictions on a batch of data rows More... | |
size_t | PredictBatch (const DenseBatch *batch, int nthread, int verbose, bool pred_margin, float *out_result) const |
size_t | QueryResultSize (const CSRBatch *batch) const |
Given a batch of data rows, query the necessary size of array to hold predictions for all data points. More... | |
size_t | QueryResultSize (const DenseBatch *batch) const |
size_t | QueryNumOutputGroup () const |
Get the number of output groups in the loaded model The number is 1 for most tasks; it is greater than 1 for multiclass classifcation. More... | |
predictor class: wrapper for optimized prediction code
Definition at line 42 of file predictor.h.
void Load | ( | const char * | name | ) |
load the prediction function from dynamic shared library.
name | name of dynamic shared library (.so/.dll/.dylib). |
Definition at line 186 of file predictor.cc.
size_t PredictBatch | ( | const CSRBatch * | batch, |
int | nthread, | ||
int | verbose, | ||
bool | pred_margin, | ||
float * | out_result | ||
) | const |
make predictions on a batch of data rows
batch | a batch of rows |
nthread | number of threads to use for predicting |
verbose | whether to produce extra messages |
pred_margin | whether to produce raw margin scores instead of transformed probabilities |
out_result | resulting output vector; use QueryResultSize() to allocate sufficient space |
Definition at line 239 of file predictor.cc.
|
inline |
Get the number of output groups in the loaded model The number is 1 for most tasks; it is greater than 1 for multiclass classifcation.
Definition at line 111 of file predictor.h.
|
inline |
Given a batch of data rows, query the necessary size of array to hold predictions for all data points.
batch | a batch of rows |
Definition at line 95 of file predictor.h.