treelite
|
Functions | |
int | TreeliteLoadSKLearnRandomForestRegressor (int n_estimators, int n_features, int n_targets, int64_t const *node_count, int64_t const **children_left, int64_t const **children_right, int64_t const **feature, double const **threshold, double const **value, int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, TreeliteModelHandle *out) |
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... | |
int | TreeliteLoadSKLearnIsolationForest (int n_estimators, int n_features, int64_t const *node_count, int64_t const **children_left, int64_t const **children_right, int64_t const **feature, double const **threshold, double const **value, int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, double ratio_c, TreeliteModelHandle *out) |
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... | |
int | TreeliteLoadSKLearnRandomForestClassifier (int n_estimators, int n_features, int n_targets, int32_t const *n_classes, int64_t const *node_count, int64_t const **children_left, int64_t const **children_right, int64_t const **feature, double const **threshold, double const **value, int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, TreeliteModelHandle *out) |
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... | |
int | TreeliteLoadSKLearnGradientBoostingRegressor (int n_iter, int n_features, int64_t const *node_count, int64_t const **children_left, int64_t const **children_right, int64_t const **feature, double const **threshold, double const **value, int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, double const *base_scores, TreeliteModelHandle *out) |
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... | |
int | TreeliteLoadSKLearnGradientBoostingClassifier (int n_iter, int n_features, int n_classes, int64_t const *node_count, int64_t const **children_left, int64_t const **children_right, int64_t const **feature, double const **threshold, double const **value, int64_t const **n_node_samples, double const **weighted_n_node_samples, double const **impurity, double const *base_scores, TreeliteModelHandle *out) |
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... | |
int | TreeliteLoadSKLearnHistGradientBoostingRegressor (int n_iter, int n_features, int64_t const *node_count, void const **nodes, int expected_sizeof_node_struct, uint32_t n_categorical_splits, uint32_t const **raw_left_cat_bitsets, uint32_t const *known_cat_bitsets, uint32_t const *known_cat_bitsets_offset_map, int32_t const *features_map, int64_t const **categories_map, double const *base_scores, TreeliteModelHandle *out) |
Load a scikit-learn HistGradientBoostingRegressor model from a collection of arrays. Note: HistGradientBoostingRegressor does not support multiple targets (outputs). More... | |
int | TreeliteLoadSKLearnHistGradientBoostingClassifier (int n_iter, int n_features, int n_classes, int64_t const *node_count, void const **nodes, int expected_sizeof_node_struct, uint32_t n_categorical_splits, uint32_t const **raw_left_cat_bitsets, uint32_t const *known_cat_bitsets, uint32_t const *known_cat_bitsets_offset_map, int32_t const *features_map, int64_t const **categories_map, double const *base_scores, TreeliteModelHandle *out) |
Load a scikit-learn HistGradientBoostingClassifier model from a collection of arrays. Note: HistGradientBoostingClassifier does not support multiple targets (outputs). More... | |
int TreeliteLoadSKLearnGradientBoostingClassifier | ( | int | n_iter, |
int | n_features, | ||
int | n_classes, | ||
int64_t const * | node_count, | ||
int64_t const ** | children_left, | ||
int64_t const ** | children_right, | ||
int64_t const ** | feature, | ||
double const ** | threshold, | ||
double const ** | value, | ||
int64_t const ** | n_node_samples, | ||
double const ** | weighted_n_node_samples, | ||
double const ** | impurity, | ||
double const * | base_scores, | ||
TreeliteModelHandle * | out | ||
) |
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).
n_iter | Number of boosting iterations |
n_features | Number of features in the training data |
n_classes | Number of classes in the target variable |
node_count | node_count[i] stores the number of nodes in the i-th tree |
children_left | children_left[i][k] stores the ID of the left child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
children_right | children_right[i][k] stores the ID of the right child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
feature | feature[i][k] stores the ID of the feature used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
threshold | threshold[i][k] stores the threshold used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
value | value[i][k] stores the leaf output of node k of the i-th tree. This is only defined if node k is a leaf node. |
n_node_samples | n_node_samples[i][k] stores the number of data samples associated with node k of the i-th tree. |
weighted_n_node_samples | weighted_n_node_samples[i][k] stores the sum of weighted data samples associated with node k of the i-th tree. |
impurity | impurity[i][k] stores the impurity measure (gini, entropy etc) associated with node k of the i-th tree. |
base_scores | Baseline predictions for outputs. At prediction, margin scores will be adjusted by this amount before applying the post-processing (link) function. Required shape: (n_classes,) |
out | Loaded model |
int TreeliteLoadSKLearnGradientBoostingRegressor | ( | int | n_iter, |
int | n_features, | ||
int64_t const * | node_count, | ||
int64_t const ** | children_left, | ||
int64_t const ** | children_right, | ||
int64_t const ** | feature, | ||
double const ** | threshold, | ||
double const ** | value, | ||
int64_t const ** | n_node_samples, | ||
double const ** | weighted_n_node_samples, | ||
double const ** | impurity, | ||
double const * | base_scores, | ||
TreeliteModelHandle * | out | ||
) |
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).
n_iter | Number of boosting iterations |
n_features | Number of features in the training data |
node_count | node_count[i] stores the number of nodes in the i-th tree |
children_left | children_left[i][k] stores the ID of the left child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
children_right | children_right[i][k] stores the ID of the right child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
feature | feature[i][k] stores the ID of the feature used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
threshold | threshold[i][k] stores the threshold used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
value | value[i][k] stores the leaf output of node k of the i-th tree. This is only defined if node k is a leaf node. |
n_node_samples | n_node_samples[i][k] stores the number of data samples associated with node k of the i-th tree. |
weighted_n_node_samples | weighted_n_node_samples[i][k] stores the sum of weighted data samples associated with node k of the i-th tree. |
impurity | impurity[i][k] stores the impurity measure (gini, entropy etc) associated with node k of the i-th tree. |
base_scores | Baseline predictions for outputs. At prediction, margin scores will be adjusted by this amount before applying the post-processing (link) function. Required shape: (1,) |
out | Loaded model |
int TreeliteLoadSKLearnHistGradientBoostingClassifier | ( | int | n_iter, |
int | n_features, | ||
int | n_classes, | ||
int64_t const * | node_count, | ||
void const ** | nodes, | ||
int | expected_sizeof_node_struct, | ||
uint32_t | n_categorical_splits, | ||
uint32_t const ** | raw_left_cat_bitsets, | ||
uint32_t const * | known_cat_bitsets, | ||
uint32_t const * | known_cat_bitsets_offset_map, | ||
int32_t const * | features_map, | ||
int64_t const ** | categories_map, | ||
double const * | base_scores, | ||
TreeliteModelHandle * | out | ||
) |
Load a scikit-learn HistGradientBoostingClassifier model from a collection of arrays. Note: HistGradientBoostingClassifier does not support multiple targets (outputs).
n_iter | Number of boosting iterations |
n_features | Number of features in the training data |
n_classes | Number of classes in the target variable |
node_count | node_count[i] stores the number of nodes in the i-th tree |
nodes | nodes[i][k] stores the k-th node of the i-th tree. |
expected_sizeof_node_struct | Expected size of Node struct, in bytes |
n_categorical_splits | n_categorical_splits[i] stores the number of categorical splits in the i-th tree. |
raw_left_cat_bitsets | raw_left_cat_bitsets[i][k] stores the bitmaps for node k of tree i. The bitmaps are used to represent categorical tests. Shape of raw_left_cat_bitsets[i]: (n_categorical_splits, 8) |
known_cat_bitsets | Bitsets representing the list of known categories per categorical feature. Shape: (n_categorical_features, 8) |
known_cat_bitsets_offset_map | Map from an original feature index to the corresponding index in the known_cat_bitsets array. Shape: (n_features,) |
features_map | Mapping to re-order features. This is needed because HistGradientBoosting estimator internally re-orders features using ColumnTransformer so that the categorical features come before the numerical features. |
categories_map | Mapping to transform categorical features. This is needed because HistGradientBoosting estimator embeds an OrdinalEncoder. categories_map[i] represents the mapping for i-th categorical feature. |
base_scores | Baseline predictions for outputs. At prediction, margin scores will be adjusted by this amount before applying the post-processing (link) function. Required shape: (1,) for binary classification; (n_classes,) for multi-class classification |
out | Loaded model |
int TreeliteLoadSKLearnHistGradientBoostingRegressor | ( | int | n_iter, |
int | n_features, | ||
int64_t const * | node_count, | ||
void const ** | nodes, | ||
int | expected_sizeof_node_struct, | ||
uint32_t | n_categorical_splits, | ||
uint32_t const ** | raw_left_cat_bitsets, | ||
uint32_t const * | known_cat_bitsets, | ||
uint32_t const * | known_cat_bitsets_offset_map, | ||
int32_t const * | features_map, | ||
int64_t const ** | categories_map, | ||
double const * | base_scores, | ||
TreeliteModelHandle * | out | ||
) |
Load a scikit-learn HistGradientBoostingRegressor model from a collection of arrays. Note: HistGradientBoostingRegressor does not support multiple targets (outputs).
n_iter | Number of boosting iterations |
n_features | Number of features in the training data |
node_count | node_count[i] stores the number of nodes in the i-th tree |
nodes | nodes[i][k] stores the k-th node of the i-th tree. |
expected_sizeof_node_struct | Expected size of Node struct, in bytes |
n_categorical_splits | n_categorical_splits[i] stores the number of categorical splits in the i-th tree. |
raw_left_cat_bitsets | raw_left_cat_bitsets[i][k] stores the bitmaps for node k of tree i. The bitmaps are used to represent categorical tests. Shape of raw_left_cat_bitsets[i]: (n_categorical_splits, 8) |
known_cat_bitsets | Bitsets representing the list of known categories per categorical feature. Shape: (n_categorical_features, 8) |
known_cat_bitsets_offset_map | Map from an original feature index to the corresponding index in the known_cat_bitsets array. Shape: (n_features,) |
features_map | Mapping to re-order features. This is needed because HistGradientBoosting estimator internally re-orders features using ColumnTransformer so that the categorical features come before the numerical features. |
categories_map | Mapping to transform categorical features. This is needed because HistGradientBoosting estimator embeds an OrdinalEncoder. categories_map[i] represents the mapping for i-th categorical feature. |
base_scores | Baseline predictions for outputs. At prediction, margin scores will be adjusted by this amount before applying the post-processing (link) function. Required shape: (1,) |
out | Loaded model |
int TreeliteLoadSKLearnIsolationForest | ( | int | n_estimators, |
int | n_features, | ||
int64_t const * | node_count, | ||
int64_t const ** | children_left, | ||
int64_t const ** | children_right, | ||
int64_t const ** | feature, | ||
double const ** | threshold, | ||
double const ** | value, | ||
int64_t const ** | n_node_samples, | ||
double const ** | weighted_n_node_samples, | ||
double const ** | impurity, | ||
double | ratio_c, | ||
TreeliteModelHandle * | out | ||
) |
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.
n_estimators | Number of trees in the isolation forest |
n_features | Number of features in the training data |
node_count | node_count[i] stores the number of nodes in the i-th tree |
children_left | children_left[i][k] stores the ID of the left child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
children_right | children_right[i][k] stores the ID of the right child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
feature | feature[i][k] stores the ID of the feature used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
threshold | threshold[i][k] stores the threshold used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
value | value[i][k] stores the expected isolation depth of node k of the i-th tree. This is only defined if node k is a leaf node. |
n_node_samples | n_node_samples[i][k] stores the number of data samples associated with node k of the i-th tree. |
weighted_n_node_samples | weighted_n_node_samples[i][k] stores the sum of weighted data samples associated with node k of the i-th tree. |
impurity | Not used, but must be passed as array of arrays for each tree and node. |
ratio_c | Standardizing constant to use for calculation of the anomaly score. |
out | Loaded model |
int TreeliteLoadSKLearnRandomForestClassifier | ( | int | n_estimators, |
int | n_features, | ||
int | n_targets, | ||
int32_t const * | n_classes, | ||
int64_t const * | node_count, | ||
int64_t const ** | children_left, | ||
int64_t const ** | children_right, | ||
int64_t const ** | feature, | ||
double const ** | threshold, | ||
double const ** | value, | ||
int64_t const ** | n_node_samples, | ||
double const ** | weighted_n_node_samples, | ||
double const ** | impurity, | ||
TreeliteModelHandle * | out | ||
) |
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).
n_estimators | Number of trees in the random forest |
n_features | Number of features in the training data |
n_targets | Number of targets (outputs) |
n_classes | n_classes[i] stores the number of classes in the i-th target |
node_count | node_count[i] stores the number of nodes in the i-th tree |
children_left | children_left[i][k] stores the ID of the left child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
children_right | children_right[i][k] stores the ID of the right child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
feature | feature[i][k] stores the ID of the feature used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
threshold | threshold[i][k] stores the threshold used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
value | value[i][k] stores the leaf output of node k of the i-th tree. This is only defined if node k is a leaf node. |
n_node_samples | n_node_samples[i][k] stores the number of data samples associated with node k of the i-th tree. |
weighted_n_node_samples | weighted_n_node_samples[i][k] stores the sum of weighted data samples associated with node k of the i-th tree. |
impurity | impurity[i][k] stores the impurity measure (gini, entropy etc) associated with node k of the i-th tree. |
out | Loaded model |
int TreeliteLoadSKLearnRandomForestRegressor | ( | int | n_estimators, |
int | n_features, | ||
int | n_targets, | ||
int64_t const * | node_count, | ||
int64_t const ** | children_left, | ||
int64_t const ** | children_right, | ||
int64_t const ** | feature, | ||
double const ** | threshold, | ||
double const ** | value, | ||
int64_t const ** | n_node_samples, | ||
double const ** | weighted_n_node_samples, | ||
double const ** | impurity, | ||
TreeliteModelHandle * | out | ||
) |
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).
n_estimators | Number of trees in the random forest |
n_features | Number of features in the training data |
n_targets | Number of targets (outputs) |
node_count | node_count[i] stores the number of nodes in the i-th tree |
children_left | children_left[i][k] stores the ID of the left child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
children_right | children_right[i][k] stores the ID of the right child node of node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
feature | feature[i][k] stores the ID of the feature used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
threshold | threshold[i][k] stores the threshold used in the binary tree split at node k of the i-th tree. This is only defined if node k is an internal (non-leaf) node. |
value | value[i][k] stores the leaf output of node k of the i-th tree. This is only defined if node k is a leaf node. |
n_node_samples | n_node_samples[i][k] stores the number of data samples associated with node k of the i-th tree. |
weighted_n_node_samples | weighted_n_node_samples[i][k] stores the sum of weighted data samples associated with node k of the i-th tree. |
impurity | impurity[i][k] stores the impurity measure (gini, entropy etc) associated with node k of the i-th tree. |
out | Loaded model |