|
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 | TreeliteExportProtobufModel (const char *filename, ModelHandle model) |
| export a model in Protocol Buffers format. Protocol Buffers (google/protobuf) is a language- and platform-neutral mechanism for serializing structured data. See src/tree.proto for format spec. More...
|
|
int | TreeliteQueryNumTree (ModelHandle handle, size_t *out) |
| Query the number of trees in the model. More...
|
|
int | TreeliteQueryNumFeature (ModelHandle handle, size_t *out) |
| Query the number of features used in the model. More...
|
|
int | TreeliteQueryNumOutputGroups (ModelHandle handle, size_t *out) |
| Query the number of output groups of the model. More...
|
|
int | TreeliteSetTreeLimit (ModelHandle handle, size_t limit) |
| keep first N trees of model, limit must smaller than number of trees. More...
|
|
int | TreeliteFreeModel (ModelHandle handle) |
| delete model from memory More...
|
|
Model loader interface: read trees from the disk
◆ TreeliteExportProtobufModel()
int TreeliteExportProtobufModel |
( |
const char * |
filename, |
|
|
ModelHandle |
model |
|
) |
| |
export a model in Protocol Buffers format. Protocol Buffers (google/protobuf) is a language- and platform-neutral mechanism for serializing structured data. See src/tree.proto for format spec.
- Parameters
-
filename | name of model file |
model | model to export |
- Returns
- 0 for success, -1 for failure
Definition at line 342 of file c_api.cc.
◆ TreeliteFreeModel()
delete model from memory
- Parameters
-
- Returns
- 0 for success, -1 for failure
Definition at line 350 of file c_api.cc.
◆ TreeliteLoadLightGBMModel()
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
-
filename | name of model file |
out | loaded model |
- Returns
- 0 for success, -1 for failure
Definition at line 310 of file c_api.cc.
◆ TreeliteLoadProtobufModel()
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
-
filename | name of model file |
out | loaded model |
- Returns
- 0 for success, -1 for failure
Definition at line 334 of file c_api.cc.
◆ TreeliteLoadXGBoostModel()
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
-
filename | name of model file |
out | loaded model |
- Returns
- 0 for success, -1 for failure
Definition at line 318 of file c_api.cc.
◆ TreeliteLoadXGBoostModelFromMemoryBuffer()
int TreeliteLoadXGBoostModelFromMemoryBuffer |
( |
const void * |
buf, |
|
|
size_t |
len, |
|
|
ModelHandle * |
out |
|
) |
| |
load an XGBoost model from a memory buffer.
- Parameters
-
buf | memory buffer |
len | size of memory buffer |
out | loaded model |
- Returns
- 0 for success, -1 for failure
Definition at line 326 of file c_api.cc.
◆ TreeliteQueryNumFeature()
int TreeliteQueryNumFeature |
( |
ModelHandle |
handle, |
|
|
size_t * |
out |
|
) |
| |
Query the number of features used in the model.
- Parameters
-
handle | model to query |
out | number of features |
- Returns
- 0 for success, -1 for failure
Definition at line 363 of file c_api.cc.
◆ TreeliteQueryNumOutputGroups()
int TreeliteQueryNumOutputGroups |
( |
ModelHandle |
handle, |
|
|
size_t * |
out |
|
) |
| |
Query the number of output groups of the model.
- Parameters
-
handle | model to query |
out | number of output groups |
- Returns
- 0 for success, -1 for failure
Definition at line 370 of file c_api.cc.
◆ TreeliteQueryNumTree()
int TreeliteQueryNumTree |
( |
ModelHandle |
handle, |
|
|
size_t * |
out |
|
) |
| |
Query the number of trees in the model.
- Parameters
-
handle | model to query |
out | number of trees |
- Returns
- 0 for success, -1 for failure
Definition at line 356 of file c_api.cc.
◆ TreeliteSetTreeLimit()
int TreeliteSetTreeLimit |
( |
ModelHandle |
handle, |
|
|
size_t |
limit |
|
) |
| |
keep first N trees of model, limit must smaller than number of trees.
- Parameters
-
handle | model |
limit | number of trees to keep |
- Returns
- 0 for success, -1 for failure
Definition at line 377 of file c_api.cc.