hummingbird.ml.containers._sklearn_api_containers

class hummingbird.ml.containers._sklearn_api_containers.SklearnContainer(model, n_threads=None, batch_size=None, extra_config={})[source]

Bases: ABC

_abc_impl = <_abc_data object>
_run(function, *inputs)[source]

This function scores the full dataset at once. See BatchContainer below for batched scoring.

property model
abstract save(location)[source]

Method used to save the container for future use.

Args:

location: The location on the file system where to save the model.

Returns:

A string digest of the saved model to be used for integrity checks during load.

class hummingbird.ml.containers._sklearn_api_containers.SklearnContainerAnomalyDetection(model, n_threads, batch_size, extra_config={})[source]

Bases: SklearnContainerRegression

Container mirroring Sklearn anomaly detection API.

_abc_impl = <_abc_data object>
abstract _decision_function(*inputs)[source]

This method contains container-specific implementation of decision_function.

decision_function(*inputs)[source]

Utility functions used to emulate the behavior of the Sklearn API. On anomaly detection (e.g. isolation forest) returns the decision function scores.

score_samples(*inputs)[source]

Utility functions used to emulate the behavior of the Sklearn API. On anomaly detection (e.g. isolation forest) returns the decision_function score plus offset_

class hummingbird.ml.containers._sklearn_api_containers.SklearnContainerClassification(model, n_threads, batch_size, extra_config={})[source]

Bases: SklearnContainerRegression

Container mirroring Sklearn classifiers API.

_abc_impl = <_abc_data object>
abstract _predict_proba(*input)[source]

This method contains container-specific implementation of predict_proba.

predict_proba(*inputs)[source]

Utility functions used to emulate the behavior of the Sklearn API. On classification tasks returns the probability estimates.

class hummingbird.ml.containers._sklearn_api_containers.SklearnContainerRegression(model, n_threads, batch_size, is_regression=True, is_anomaly_detection=False, extra_config={}, **kwargs)[source]

Bases: SklearnContainer

Abstract container mirroring Sklearn regressors API.

_abc_impl = <_abc_data object>
abstract _predict(*input)[source]

This method contains container-specific implementation of predict.

predict(*inputs)[source]

Utility functions used to emulate the behavior of the Sklearn API. On regression returns the predicted values. On classification tasks returns the predicted class labels for the input data. On anomaly detection (e.g. isolation forest) returns the predicted classes (-1 or 1).

class hummingbird.ml.containers._sklearn_api_containers.SklearnContainerTransformer(model, n_threads=None, batch_size=None, extra_config={})[source]

Bases: SklearnContainer

Abstract container mirroring Sklearn transformers API.

_abc_impl = <_abc_data object>
abstract _transform(*input)[source]

This method contains container-specific implementation of transform.

transform(*inputs)[source]

Utility functions used to emulate the behavior of the Sklearn API. On data transformers it returns transformed output data