7 #ifndef TREELITE_FRONTEND_H_ 8 #define TREELITE_FRONTEND_H_ 57 struct TreeBuilderImpl;
58 struct ModelBuilderImpl;
105 int left_child_key,
int right_child_key);
122 const std::vector<uint32_t>& left_categories,
123 bool default_left,
int left_child_key,
124 int right_child_key);
143 const std::vector<tl_float>& leaf_vector);
146 std::unique_ptr<TreeBuilderImpl> pimpl;
165 ModelBuilder(
int num_feature,
int num_output_group,
bool random_forest_flag);
172 void SetModelParam(
const char* name,
const char* value);
185 int InsertTree(
TreeBuilder* tree_builder,
int index = -1);
198 bool DeleteTree(
int index);
205 bool CommitModel(
Model* out_model);
208 std::unique_ptr<ModelBuilderImpl> pimpl;
213 #endif // TREELITE_FRONTEND_H_ thin wrapper for tree ensemble model
float tl_float
float type to be used internally
bool SetRootNode(int node_key)
Set a node as the root of a tree.
bool CreateNode(int node_key)
Create an empty node within a tree.
Model LoadLightGBMModel(const char *filename)
load a model file generated by LightGBM (Microsoft/LightGBM). The model file must contain a decision ...
Model LoadProtobufModel(const char *filename)
load a model in Protocol Buffers format. Protocol Buffers (google/protobuf) is a language- and platfo...
Model LoadXGBoostModel(const char *filename)
load a model file generated by XGBoost (dmlc/xgboost). The model file must contain a decision tree en...
bool SetLeafNode(int node_key, tl_float leaf_value)
Turn an empty node into a leaf node.
defines configuration macros of treelite
bool SetLeafVectorNode(int node_key, const std::vector< tl_float > &leaf_vector)
Turn an empty node into a leaf vector node The leaf vector (collection of multiple leaf weights per l...
bool SetCategoricalTestNode(int node_key, unsigned feature_id, const std::vector< uint32_t > &left_categories, bool default_left, int left_child_key, int right_child_key)
Turn an empty node into a categorical test node. A list defines all categories that would be classifi...
bool DeleteNode(int node_key)
Remove a node from a tree.
bool SetNumericalTestNode(int node_key, unsigned feature_id, Operator op, tl_float threshold, bool default_left, int left_child_key, int right_child_key)
Turn an empty node into a numerical test node; the test is in the form [feature value] OP [threshold]...
Operator
comparison operators