hummingbird.ml.operator_converters.sklearn.poly_features

Converter for scikit-learn PolynomialFeatures.

class hummingbird.ml.operator_converters.sklearn.poly_features.PolynomialFeatures(*args: Any, **kwargs: Any)[source]

Bases: PhysicalOperator, Module

Class implementing PolynomialFeatures operators in PyTorch.

# TODO extend this class to support higher orders

_abc_impl = <_abc_data object>
forward(x)[source]
hummingbird.ml.operator_converters.sklearn.poly_features.convert_sklearn_poly_features(operator, device, extra_config)[source]

Converter for sklearn.preprocessing.PolynomialFeatures

Currently this supports only degree 2, and does not support interaction_only

Args:

operator: An operator wrapping a sklearn.preprocessing.PolynomialFeatures 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