treelite
|
Classes | |
class | ModelBuilder |
Model builder interface. More... | |
struct | TreeAnnotation |
Annotation for individual trees. Use this object to look up which target and class each tree is associated with. More... | |
struct | PostProcessorFunc |
Specification for postprocessor of prediction outputs. More... | |
struct | Metadata |
Metadata object, consisting of metadata information about the model at large. More... | |
Typedefs | |
using | PostProcessorConfigParam = std::variant< std::int64_t, double, std::string > |
Parameter type used to configure postprocessor functions. More... | |
Functions | |
std::unique_ptr< ModelBuilder > | GetModelBuilder (TypeInfo threshold_type, TypeInfo leaf_output_type, Metadata const &metadata, TreeAnnotation const &tree_annotation, PostProcessorFunc const &postprocessor, std::vector< double > const &base_scores, std::optional< std::string > const &attributes=std::nullopt) |
Initialize a model builder object with a given set of metadata. More... | |
std::unique_ptr< ModelBuilder > | GetModelBuilder (TypeInfo threshold_type, TypeInfo leaf_output_type) |
Initialize a model builder object with empty metadata. Remember to provide metadata later, with a call to InitializeMetadata(). More... | |
std::unique_ptr< ModelBuilder > | GetModelBuilder (std::string const &json_str) |
Initialize a model builder object from a JSON string. The JSON string must contain all relevant metadata. See GetModelBuilder for the list of necessary metadata. More... | |
using treelite::model_builder::PostProcessorConfigParam = typedef std::variant<std::int64_t, double, std::string> |
Parameter type used to configure postprocessor functions.
std::unique_ptr<ModelBuilder> treelite::model_builder::GetModelBuilder | ( | std::string const & | json_str | ) |
Initialize a model builder object from a JSON string. The JSON string must contain all relevant metadata. See GetModelBuilder for the list of necessary metadata.
json_str | JSON string containing relevant metadata. |
std::unique_ptr<ModelBuilder> treelite::model_builder::GetModelBuilder | ( | TypeInfo | threshold_type, |
TypeInfo | leaf_output_type | ||
) |
Initialize a model builder object with empty metadata. Remember to provide metadata later, with a call to InitializeMetadata().
threshold_type | Type of thresholds in the tree model |
leaf_output_type | Type of leaf outputs in the tree model |
std::unique_ptr<ModelBuilder> treelite::model_builder::GetModelBuilder | ( | TypeInfo | threshold_type, |
TypeInfo | leaf_output_type, | ||
Metadata const & | metadata, | ||
TreeAnnotation const & | tree_annotation, | ||
PostProcessorFunc const & | postprocessor, | ||
std::vector< double > const & | base_scores, | ||
std::optional< std::string > const & | attributes = std::nullopt |
||
) |
Initialize a model builder object with a given set of metadata.
threshold_type | Type of thresholds in the tree model |
leaf_output_type | Type of leaf outputs in the tree model |
metadata | Model metadata |
tree_annotation | Annotation for individual trees |
postprocessor | Postprocessor for prediction outputs |
base_scores | Baseline scores for targets and classes, before adding tree outputs. Also known as the intercept. |
attributes | Arbitrary JSON object, to be stored in the "attributes" field in the model object. |