Treelite
Classes | Functions
frontend.h File Reference

Collection of front-end methods to load or construct ensemble model. More...

#include <treelite/base.h>
#include <string>
#include <memory>
#include <vector>
#include <cstdint>
#include "frontend_impl.h"
Include dependency graph for frontend.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Value
 
class  TreeBuilder
 tree builder class More...
 
class  ModelBuilder
 model builder class More...
 

Functions

std::unique_ptr< treelite::ModelLoadLightGBMModel (const char *filename)
 load a model file generated by LightGBM (Microsoft/LightGBM). The model file must contain a decision tree ensemble. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostModel (const char *filename)
 load a model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree ensemble. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostModel (const void *buf, size_t len)
 load an XGBoost model from a memory buffer. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostJSONModel (const char *filename)
 load a model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree ensemble in the JSON format. More...
 
std::unique_ptr< treelite::ModelLoadXGBoostJSONModelString (const char *json_str, size_t length)
 load an XGBoost model from a JSON string More...
 

Detailed Description

Collection of front-end methods to load or construct ensemble model.

Copyright (c) 2017-2020 by Contributors

Author
Hyunsu Cho

Definition in file frontend.h.

Function Documentation

◆ LoadLightGBMModel()

std::unique_ptr< treelite::Model > LoadLightGBMModel ( const char *  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

Definition at line 26 of file lightgbm.cc.

◆ LoadXGBoostJSONModel()

std::unique_ptr< treelite::Model > LoadXGBoostJSONModel ( const char *  filename)

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

Parameters
filenamename of model file
outreference to loaded model

Definition at line 45 of file xgboost_json.cc.

◆ LoadXGBoostJSONModelString()

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

load an XGBoost model from a JSON string

Parameters
json_strJSON char array
lengthlength of JSON char array
outreference to loaded model

Definition at line 85 of file xgboost_json.cc.

◆ LoadXGBoostModel() [1/2]

std::unique_ptr< treelite::Model > LoadXGBoostModel ( const char *  filename)

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

Parameters
filenamename of model file
Returns
loaded model

Definition at line 29 of file xgboost.cc.

◆ LoadXGBoostModel() [2/2]

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

load an XGBoost model from a memory buffer.

Parameters
bufmemory buffer
lensize of memory buffer
Returns
loaded model

Definition at line 34 of file xgboost.cc.