|
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 | TreeliteLoadXGBoostJSON (const char *filename, ModelHandle *out) |
| load a json model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree ensemble. More...
|
|
int | TreeliteLoadXGBoostJSONString (const char *json_str, size_t length, ModelHandle *out) |
| load a model stored as JSON stringby XGBoost (dmlc/xgboost). The model json 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 | 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 | TreeliteQueryNumClass (ModelHandle handle, size_t *out) |
| Query the number of classes of the model. (1 if the model is binary classifier or regressor) 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
◆ TreeliteFreeModel()
delete model from memory
- Parameters
-
- Returns
- 0 for success, -1 for failure
Definition at line 179 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 144 of file c_api.cc.
◆ TreeliteLoadXGBoostJSON()
int TreeliteLoadXGBoostJSON |
( |
const char * |
filename, |
|
|
ModelHandle * |
out |
|
) |
| |
load a json 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 158 of file c_api.cc.
◆ TreeliteLoadXGBoostJSONString()
int TreeliteLoadXGBoostJSONString |
( |
const char * |
json_str, |
|
|
size_t |
length, |
|
|
ModelHandle * |
out |
|
) |
| |
load a model stored as JSON stringby XGBoost (dmlc/xgboost). The model json must contain a decision tree ensemble.
- Parameters
-
json_str | the string containing the JSON model specification |
length | the length of the JSON string |
out | loaded model |
- Returns
- 0 for success, -1 for failure
Definition at line 165 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 151 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 172 of file c_api.cc.
◆ TreeliteQueryNumClass()
int TreeliteQueryNumClass |
( |
ModelHandle |
handle, |
|
|
size_t * |
out |
|
) |
| |
Query the number of classes of the model. (1 if the model is binary classifier or regressor)
- Parameters
-
handle | model to query |
out | number of output groups |
- Returns
- 0 for success, -1 for failure
Definition at line 199 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 192 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 185 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 206 of file c_api.cc.