hummingbird.ml._utils

Collection of utility functions used throughout Hummingbird.

class hummingbird.ml._utils._Constants(constants, other_constants=None)[source]

Bases: object

Class enabling the proper definition of constants.

hummingbird.ml._utils.assert_lightgbm_installed()[source]
hummingbird.ml._utils.assert_onnx_ml_tools_installed()[source]
hummingbird.ml._utils.assert_onnx_runtime_installed()[source]
hummingbird.ml._utils.assert_pandas_installed()[source]
hummingbird.ml._utils.assert_sklearn_installed()[source]
hummingbird.ml._utils.assert_sparkml_installed()[source]
hummingbird.ml._utils.assert_torch_installed()[source]
hummingbird.ml._utils.assert_tvm_installed()[source]
hummingbird.ml._utils.assert_xgboost_installed()[source]
hummingbird.ml._utils.check_dumped_versions(configurations, *args)[source]

When a model is loaded this function is used to check that the versions of the modules used at saving time match with the version at loading time.

hummingbird.ml._utils.dump_versions(*args)[source]

Utility function used to generate a string containing the versions of the main modules used to convert a model.

hummingbird.ml._utils.from_strings_to_ints(input, max_string_length)[source]

Utility function used to transform string inputs into a numerical representation.

hummingbird.ml._utils.get_device(model)[source]

Convenient function used to get the runtime device for the model.

hummingbird.ml._utils.is_pandas_dataframe(df)[source]
hummingbird.ml._utils.is_spark_dataframe(df)[source]
hummingbird.ml._utils.lightgbm_installed()[source]

Checks that LightGBM is available.

hummingbird.ml._utils.load(location)[source]

Utility function used to load arbitrary Hummingbird models.

hummingbird.ml._utils.onnx_ml_tools_installed()[source]

Checks that ONNXMLTools is available.

hummingbird.ml._utils.onnx_runtime_installed()[source]

Checks that ONNX Runtime is available.

hummingbird.ml._utils.pandas_installed()[source]

Checks that Pandas is available.

hummingbird.ml._utils.prophet_installed()[source]

Checks that Prophet is available.

hummingbird.ml._utils.sklearn_installed()[source]

Checks that Sklearn is available.

hummingbird.ml._utils.sparkml_installed()[source]

Checks that Spark ML/PySpark is available.

hummingbird.ml._utils.torch_installed()[source]

Checks that PyTorch is available.

hummingbird.ml._utils.tvm_installed()[source]

Checks that TVM is available.

hummingbird.ml._utils.xgboost_installed()[source]

Checks that XGBoost is available.