hummingbird.ml.operator_converters.lightgbm

Converters for LightGBM models.

hummingbird.ml.operator_converters.lightgbm._get_tree_parameters(tree_info, extra_config)[source]

Parse the tree and returns an in-memory friendly representation of its structure.

hummingbird.ml.operator_converters.lightgbm._tree_traversal(node, lefts, rights, features, thresholds, values, count)[source]

Recursive function for parsing a tree and filling the input data structures.

hummingbird.ml.operator_converters.lightgbm.convert_lgbm_booster(operator, device, extra_config)[source]

Converter for lightgbm.Booster

Args:

operator: An operator wrapping a lightgbm.Booster model device: String defining the type of device the converted operator should be run on extra_config: Extra configuration used to select the best conversion strategy

Returns:

A PyTorch model

hummingbird.ml.operator_converters.lightgbm.convert_sklearn_lgbm_classifier(operator, device, extra_config)[source]

Converter for lightgbm.LGBMClassifier (trained using the Sklearn API).

Args:

operator: An operator wrapping a lightgbm.LGBMClassifier model device: String defining the type of device the converted operator should be run on extra_config: Extra configuration used to select the best conversion strategy

Returns:

A PyTorch model

hummingbird.ml.operator_converters.lightgbm.convert_sklearn_lgbm_regressor(operator, device, extra_config)[source]

Converter for lightgbm.LGBMRegressor and lightgbm.LGBMRanker (trained using the Sklearn API).

Args:

operator: An operator wrapping a lightgbm.LGBMRegressor or lightgbm.LGBMRanker model device: String defining the type of device the converted operator should be run on extra_config: Extra configuration used to select the best conversion strategy

Returns:

A PyTorch model