treelite
Functions
C API: Functions to query and modify model objects

Functions

int TreeliteDumpAsJSON (TreeliteModelHandle handle, int pretty_print, char const **out_json_str)
 Dump a model object as a JSON string. More...
 
int TreeliteGetInputType (TreeliteModelHandle model, char const **out_str)
 Query the input type of a Treelite model object. More...
 
int TreeliteGetOutputType (TreeliteModelHandle model, char const **out_str)
 Query the output type of a Treelite model object. More...
 
int TreeliteQueryNumTree (TreeliteModelHandle model, size_t *out)
 Query the number of trees in the model. More...
 
int TreeliteQueryNumFeature (TreeliteModelHandle model, int *out)
 Query the number of features used in the model. More...
 
int TreeliteConcatenateModelObjects (TreeliteModelHandle const *objs, size_t len, TreeliteModelHandle *out)
 Concatenate multiple model objects into a single model object by copying all member trees into the destination model object. More...
 
int TreeliteFreeModel (TreeliteModelHandle handle)
 Delete model from memory. More...
 

Detailed Description

Function Documentation

◆ TreeliteConcatenateModelObjects()

int TreeliteConcatenateModelObjects ( TreeliteModelHandle const *  objs,
size_t  len,
TreeliteModelHandle out 
)

Concatenate multiple model objects into a single model object by copying all member trees into the destination model object.

Parameters
objsPointer to the beginning of the list of model objects
lenNumber of model objects
outUsed to save the concatenated model

◆ TreeliteDumpAsJSON()

int TreeliteDumpAsJSON ( TreeliteModelHandle  handle,
int  pretty_print,
char const **  out_json_str 
)

Dump a model object as a JSON string.

Parameters
handleThe handle to the model object
pretty_printWhether to pretty-print JSON string (0 for false, != 0 for true)
out_json_strThe JSON string
Returns
0 for success, -1 for failure

◆ TreeliteFreeModel()

int TreeliteFreeModel ( TreeliteModelHandle  handle)

Delete model from memory.

Parameters
handleModel to remove
Returns
0 for success, -1 for failure

◆ TreeliteGetInputType()

int TreeliteGetInputType ( TreeliteModelHandle  model,
char const **  out_str 
)

Query the input type of a Treelite model object.

Parameters
modelTreelite Model object
out_strString representation of input type
Returns
0 for success; -1 for failure

◆ TreeliteGetOutputType()

int TreeliteGetOutputType ( TreeliteModelHandle  model,
char const **  out_str 
)

Query the output type of a Treelite model object.

Parameters
modelTreelite Model object
out_strString representation of output type
Returns
0 for success; -1 for failure

◆ TreeliteQueryNumFeature()

int TreeliteQueryNumFeature ( TreeliteModelHandle  model,
int *  out 
)

Query the number of features used in the model.

Parameters
modelModel to query
outNumber of features
Returns
0 for success, -1 for failure

◆ TreeliteQueryNumTree()

int TreeliteQueryNumTree ( TreeliteModelHandle  model,
size_t *  out 
)

Query the number of trees in the model.

Parameters
modelModel to query
outNumber of trees
Returns
0 for success, -1 for failure