treelite
Namespaces | Functions
treelite::model_loader Namespace Reference

Namespaces

 sklearn
 

Functions

std::unique_ptr< treelite::ModelLoadXGBoostModelLegacyBinary (std::string const &filename)
 Load a model file generated by XGBoost (dmlc/xgboost), stored in the legacy binary format. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostModelLegacyBinary (void const *buf, std::size_t len)
 Load an XGBoost model from a memory buffer. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostModel (std::string const &filename, char const *config_json)
 Load a model file generated by XGBoost (dmlc/xgboost), stored in the JSON format. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostModelFromString (char const *json_str, std::size_t length, char const *config_json)
 Load an XGBoost model from a JSON string. More...
 
std::unique_ptr< treelite::ModelLoadLightGBMModel (std::string const &filename)
 load a model file generated by LightGBM (Microsoft/LightGBM). The model file must contain a decision tree ensemble. More...
 
std::unique_ptr< treelite::ModelLoadLightGBMModelFromString (char const *model_str)
 Load a LightGBM model from a string. The string should be created with the model_to_string() method in LightGBM. More...
 

Function Documentation

◆ LoadLightGBMModel()

std::unique_ptr<treelite::Model> treelite::model_loader::LoadLightGBMModel ( std::string const &  filename)

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

Parameters
filenamename of model file
Returns
loaded model

◆ LoadLightGBMModelFromString()

std::unique_ptr<treelite::Model> treelite::model_loader::LoadLightGBMModelFromString ( char const *  model_str)

Load a LightGBM model from a string. The string should be created with the model_to_string() method in LightGBM.

Parameters
model_strthe model string
Returns
loaded model

◆ LoadXGBoostModel()

std::unique_ptr<treelite::Model> treelite::model_loader::LoadXGBoostModel ( std::string const &  filename,
char const *  config_json 
)

Load a model file generated by XGBoost (dmlc/xgboost), stored in the JSON format.

Parameters
filenameName of model file
config_jsonJSON string consisting of key-value pairs; used for configuring the model parser
Returns
Loaded model

◆ LoadXGBoostModelFromString()

std::unique_ptr<treelite::Model> treelite::model_loader::LoadXGBoostModelFromString ( char const *  json_str,
std::size_t  length,
char const *  config_json 
)

Load an XGBoost model from a JSON string.

Parameters
json_strJSON char array
lengthLength of JSON char array
config_jsonJSON string consisting of key-value pairs; used for configuring the model parser
Returns
Loaded model

◆ LoadXGBoostModelLegacyBinary() [1/2]

std::unique_ptr<treelite::Model> treelite::model_loader::LoadXGBoostModelLegacyBinary ( std::string const &  filename)

Load a model file generated by XGBoost (dmlc/xgboost), stored in the legacy binary format.

Parameters
filenameName of model file
Returns
Loaded model

◆ LoadXGBoostModelLegacyBinary() [2/2]

std::unique_ptr<treelite::Model> treelite::model_loader::LoadXGBoostModelLegacyBinary ( void const *  buf,
std::size_t  len 
)

Load an XGBoost model from a memory buffer.

Parameters
bufmemory buffer
lensize of memory buffer
Returns
Loaded model