hummingbird.ml.supported

All operators, backends, and configurations settings supported in Hummingbird are registered here.

Supported Backends PyTorch, TorchScript, ONNX, TVM

Supported Operators (scikit-learn) BernoulliNB, Binarizer, DecisionTreeClassifier, DecisionTreeRegressor, ExtraTreesClassifier, ExtraTreesRegressor, FastICA, GammaRegressor, GaussianNB, GradientBoostingClassifier, GradientBoostingRegressor, GridSearchCV, HistGradientBoostingClassifier, HistGradientBoostingRegressor, IsolationForest, KernelPCA, KBinsDiscretizer, KMeans, KNeighborsClassifier, KNeighborsRegressor, LabelEncoder, LinearRegression, LinearSVC, LinearSVR, LogisticRegression, LogisticRegressionCV, RidgeCV, MaxAbsScaler, MeanShift, MinMaxScaler, MissingIndicator, Mixture, MLPClassifier, MLPRegressor, MultinomialNB, Normalizer, OneHotEncoder, PCA, PLSRegression, PoissonRegressor, PolynomialFeatures, RandomForestClassifier, RandomForestRegressor, RandomizedGridSearchCV, RobustScaler, SelectKBest, SelectPercentile, SimpleImputer, SGDClassifier, StandardScaler, TreeEnsembleClassifier, TreeEnsembleRegressor, TruncatedSVD, TweedieRegressor, VarianceThreshold,

Supported Operators (LGBM) LGBMClassifier, LGBMRanker, LGBMRegressor,

Supported Operators (XGB) XGBClassifier, XGBRanker, XGBRegressor,

Supported Operators (ONNX-ML) Abs, Add, ArrayFeatureExtractor, Binarizer, Cast, Concat, Div, Imputer, LabelEncoder, Less, LinearClassifier, LinearRegressor, Mul, Neg, Normalizer, OneHotEncoder, Reshape, Sum, Scaler, SVMClassifier, TreeEnsembleClassifier, TreeEnsembleRegressor,

hummingbird.ml.supported.BATCH_SIZE = 'batch_size'

Select whether to partition the input dataset at inference time in N batch_size partitions.

hummingbird.ml.supported.CONTAINER = 'container'

Boolean used to chose whether to return the container for Sklearn API or just the model.

hummingbird.ml.supported.INPUT_NAMES = 'input_names'

Set the names of the inputs. Assume that the numbers of inputs_names is equal to the number of inputs.

hummingbird.ml.supported.MAX_STRING_LENGTH = 'max_string_length'

Maximum expected length for string features. By default this value is set using the training information.

hummingbird.ml.supported.N_THREADS = 'n_threads'

Select how many threads to use for scoring. This parameter will set the number of intra-op threads. Inter-op threads are by default set to 1 in Hummingbird. Check tests.test_extra_conf.py for usage examples.

hummingbird.ml.supported.ONNX_OUTPUT_MODEL_NAME = 'onnx_model_name'

For ONNX models we can set the name of the output model.

hummingbird.ml.supported.ONNX_TARGET_OPSET = 'onnx_target_opset'

For ONNX models we can set the target opset to use. 11 by default.

hummingbird.ml.supported.OUTPUT_NAMES = 'output_names'

Set the names of the outputs.

hummingbird.ml.supported.REMAINDER_SIZE = 'remainder_size'

Determines the number of rows that an auxiliary remainder model can accept.

hummingbird.ml.supported.TREE_IMPLEMENTATION = 'tree_implementation'

Which tree implementation to use. Values can be: gemm, tree_trav, perf_tree_trav.

hummingbird.ml.supported.TREE_OP_PRECISION_DTYPE = 'tree_op_precision_dtype'

Which data type to be used for the threshold and leaf values of decision nodes. Values can be: float32 or float64.

hummingbird.ml.supported.TVM_MAX_FUSE_DEPTH = 'tvm_max_fuse_depth'

For TVM we can fix the number of operations that will be fused. If not set, compilation may take forever (https://github.com/microsoft/hummingbird/issues/232). By default Hummingbird uses a max_fuse_depth of 50, but this can be override using this parameter.

hummingbird.ml.supported.TVM_PAD_INPUT = 'tvm_pad_prediction_inputs'

TVM statically compiles models, therefore each input shape is fixed. However, at prediction time, we can have inputs with different batch size. This option allows to pad the inputs on the batch dimension with zeros. Note that enabling this option may considerably hurt performance

hummingbird.ml.supported._build_backend_map()[source]

The set of supported backends is defined here.

hummingbird.ml.supported._build_lightgbm_operator_list()[source]

List all supported LightGBM (Sklearn API) operators.

hummingbird.ml.supported._build_onnxml_api_operator_name_map()[source]

Associate ONNXML with the operator class names. If two ONNXML models share a single name, it means they are equivalent in terms of conversion.

hummingbird.ml.supported._build_onnxml_operator_list()[source]

List all supported ONNXML operators.

hummingbird.ml.supported._build_prophet_api_operator_name_map()[source]

Associate Prophet with the operator class names.

hummingbird.ml.supported._build_prophet_operator_list()[source]

List all supported Prophet (Sklearn API) operators.

hummingbird.ml.supported._build_sklearn_api_operator_name_map()[source]

Associate Sklearn with the operator class names. If two scikit-learn (API) models share a single name, it means they are equivalent in terms of conversion.

hummingbird.ml.supported._build_sklearn_operator_list()[source]

Put all supported Sklearn operators on a list.

hummingbird.ml.supported._build_sparkml_api_operator_name_map()[source]

Associate Spark-ML with the operator class names. If two Spark-ML models share a single name, it means they are equivalent in terms of conversion.

hummingbird.ml.supported._build_sparkml_operator_list()[source]

List all supported SparkML operators.

hummingbird.ml.supported._build_xgboost_operator_list()[source]

List all supported XGBoost (Sklearn API) operators.

hummingbird.ml.supported.get_onnxml_api_operator_name(model_type)[source]

Get the operator name for the input model type in ONNX-ML API format.

Args:

model_type: A ONNX-ML model object (e.g., TreeEnsembleClassifier)

Returns:

A string which stands for the type of the input model in the Hummingbird conversion framework. None if the model_type is not supported

hummingbird.ml.supported.get_sklearn_api_operator_name(model_type)[source]

Get the operator name for the input model type in scikit-learn API format.

Args:
model_type: A scikit-learn model object (e.g., RandomForestClassifier)

or an object with scikit-learn API (e.g., LightGBM)

Returns:

A string which stands for the type of the input model in the Hummingbird conversion framework

hummingbird.ml.supported.get_sparkml_api_operator_name(model_type)[source]

Get the operator name for the input model type in Spark-ML API format.

Args:

model_type: A Spark-ML model object (e.g., LogisticRegression)

Returns:

A string which stands for the type of the input model in the Hummingbird conversion framework. None if the model_type is not supported