treelite
Namespaces | Functions
model_loader.h File Reference

Functions for loading tree models from disk or file stream. More...

#include <cstddef>
#include <memory>
#include <string>
Include dependency graph for model_loader.h:

Go to the source code of this file.

Namespaces

 treelite
 
 treelite::model_loader
 
 treelite::model_loader::sklearn
 

Functions

std::unique_ptr< treelite::Modeltreelite::model_loader::LoadXGBoostModelLegacyBinary (std::string const &filename)
 Load a model file generated by XGBoost (dmlc/xgboost), stored in the legacy binary format. More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::LoadXGBoostModelLegacyBinary (void const *buf, std::size_t len)
 Load an XGBoost model from a memory buffer. More...
 
std::unique_ptr< treelite::Modeltreelite::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. More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::LoadXGBoostModelFromString (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::Modeltreelite::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. More...
 
std::unique_ptr< treelite::Modeltreelite::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. More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::sklearn::LoadRandomForestRegressor (int n_estimators, int n_features, int n_targets, std::int64_t const *node_count, std::int64_t const **children_left, std::int64_t const **children_right, std::int64_t const **feature, double const **threshold, double const **value, std::int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity)
 Load a scikit-learn RandomForestRegressor model from a collection of arrays. Refer to https://scikit-learn.org/stable/auto_examples/tree/plot_unveil_tree_structure.html to learn the meaning of the arrays in detail. Note that this function can also be used to load an ensemble of extremely randomized trees (sklearn.ensemble.ExtraTreesRegressor). More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::sklearn::LoadIsolationForest (int n_estimators, int n_features, std::int64_t const *node_count, std::int64_t const **children_left, std::int64_t const **children_right, std::int64_t const **feature, double const **threshold, double const **value, std::int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, double ratio_c)
 Load a scikit-learn IsolationForest model from a collection of arrays. Refer to https://scikit-learn.org/stable/auto_examples/tree/plot_unveil_tree_structure.html to learn the meaning of the arrays in detail. More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::sklearn::LoadRandomForestClassifier (int n_estimators, int n_features, int n_targets, int32_t const *n_classes, std::int64_t const *node_count, std::int64_t const **children_left, std::int64_t const **children_right, std::int64_t const **feature, double const **threshold, double const **value, std::int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity)
 Load a scikit-learn RandomForestClassifier model from a collection of arrays. Refer to https://scikit-learn.org/stable/auto_examples/tree/plot_unveil_tree_structure.html to learn the meaning of the arrays in detail. Note that this function can also be used to load an ensemble of extremely randomized trees (sklearn.ensemble.ExtraTreesClassifier). More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::sklearn::LoadGradientBoostingRegressor (int n_iter, int n_features, std::int64_t const *node_count, std::int64_t const **children_left, std::int64_t const **children_right, std::int64_t const **feature, double const **threshold, double const **value, std::int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, double const *baseline_prediction)
 Load a scikit-learn GradientBoostingRegressor model from a collection of arrays. Refer to https://scikit-learn.org/stable/auto_examples/tree/plot_unveil_tree_structure.html to learn the meaning of the arrays in detail. Note: GradientBoostingRegressor does not support multiple targets (outputs). More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::sklearn::LoadGradientBoostingClassifier (int n_iter, int n_features, int n_classes, std::int64_t const *node_count, std::int64_t const **children_left, std::int64_t const **children_right, std::int64_t const **feature, double const **threshold, double const **value, std::int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, double const *baseline_prediction)
 Load a scikit-learn GradientBoostingClassifier model from a collection of arrays. Refer to https://scikit-learn.org/stable/auto_examples/tree/plot_unveil_tree_structure.html to learn the meaning of the arrays in detail. Note: GradientBoostingClassifier does not support multiple targets (outputs). More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::sklearn::LoadHistGradientBoostingRegressor (int n_iter, int n_features, std::int64_t const *node_count, void const **nodes, int expected_sizeof_node_struct, std::uint32_t n_categorical_splits, std::uint32_t const **raw_left_cat_bitsets, std::uint32_t const *known_cat_bitsets, std::uint32_t const *known_cat_bitsets_offset_map, std::int32_t const *features_map, std::int64_t const **categories_map, double const *base_scores)
 Load a scikit-learn HistGradientBoostingRegressor model from a collection of arrays. Note: HistGradientBoostingRegressor does not support multiple targets (outputs). More...
 
std::unique_ptr< treelite::Modeltreelite::model_loader::sklearn::LoadHistGradientBoostingClassifier (int n_iter, int n_features, int n_classes, int64_t const *node_count, void const **nodes, int expected_sizeof_node_struct, std::uint32_t n_categorical_splits, std::uint32_t const **raw_left_cat_bitsets, std::uint32_t const *known_cat_bitsets, std::uint32_t const *known_cat_bitsets_offset_map, std::int32_t const *features_map, std::int64_t const **categories_map, double const *base_scores)
 Load a scikit-learn HistGradientBoostingClassifier model from a collection of arrays. Note: HistGradientBoostingClassifier does not support multiple targets (outputs). More...
 

Detailed Description

Functions for loading tree models from disk or file stream.

Copyright (c) 2017-2023 by Contributors

Author
Hyunsu Cho