treelite
Functions
Model_loader

Functions

int TreeliteLoadLightGBMModel (const char *filename, ModelHandle *out)
 load a model file generated by LightGBM (Microsoft/LightGBM). The model file must contain a decision tree ensemble. More...
 
int TreeliteLoadXGBoostModel (const char *filename, ModelHandle *out)
 load a model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree ensemble. More...
 
int TreeliteLoadXGBoostModelFromMemoryBuffer (const void *buf, size_t len, ModelHandle *out)
 load an XGBoost model from a memory buffer. More...
 
int TreeliteLoadProtobufModel (const char *filename, ModelHandle *out)
 load a model in Protocol Buffers format. Protocol Buffers (google/protobuf) is a language- and platform-neutral mechanism for serializing structured data. See tree.proto for format spec. More...
 
int TreeliteExportXGBoostModel (const char *filename, ModelHandle model, const char *name_obj)
 (EXPERIMENTAL FEATURE) export a model in XGBoost format. The exported model can be read by XGBoost (dmlc/xgboost). More...
 
int TreeliteFreeModel (ModelHandle handle)
 delete model from memory More...
 

Detailed Description

Model loader interface: read trees from the disk

Function Documentation

int TreeliteExportXGBoostModel ( const char *  filename,
ModelHandle  model,
const char *  name_obj 
)

(EXPERIMENTAL FEATURE) export a model in XGBoost format. The exported model can be read by XGBoost (dmlc/xgboost).

Parameters
filenamename of model file
modelmodel to export
name_objname of objective function
Returns
0 for success, -1 for failure

Definition at line 360 of file c_api.cc.

int TreeliteFreeModel ( ModelHandle  handle)

delete model from memory

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

Definition at line 369 of file c_api.cc.

int TreeliteLoadLightGBMModel ( const char *  filename,
ModelHandle out 
)

load a model file generated by LightGBM (Microsoft/LightGBM). The model file must contain a decision tree ensemble.

Parameters
filenamename of model file
outloaded model
Returns
0 for success, -1 for failure

Definition at line 328 of file c_api.cc.

int TreeliteLoadProtobufModel ( const char *  filename,
ModelHandle out 
)

load a model in Protocol Buffers format. Protocol Buffers (google/protobuf) is a language- and platform-neutral mechanism for serializing structured data. See tree.proto for format spec.

Parameters
filenamename of model file
outloaded model
Returns
0 for success, -1 for failure

Definition at line 352 of file c_api.cc.

int TreeliteLoadXGBoostModel ( const char *  filename,
ModelHandle out 
)

load a model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree ensemble.

Parameters
filenamename of model file
outloaded model
Returns
0 for success, -1 for failure

Definition at line 336 of file c_api.cc.

int TreeliteLoadXGBoostModelFromMemoryBuffer ( const void *  buf,
size_t  len,
ModelHandle out 
)

load an XGBoost model from a memory buffer.

Parameters
bufmemory buffer
lensize of memory buffer
outloaded model
Returns
0 for success, -1 for failure

Definition at line 344 of file c_api.cc.