lale.lib.sklearn.polynomial_features module

class lale.lib.sklearn.polynomial_features.PolynomialFeatures(*, degree=2, interaction_only=False, include_bias=True, order='C')

Bases: PlannedIndividualOp

Polynomial features transformer from scikit-learn.

This documentation is auto-generated from JSON schemas.

Parameters
  • degree (integer, >=2 for optimizer, <=3 for optimizer, optional, default 2) – The degree of the polynomial features.

  • interaction_only (boolean, optional, default False) – If true, only interaction features are produced: features that are products of at most degree distinct input features (so not x[1] ** 2, x[0] * x[2] ** 3, etc.).

  • include_bias (boolean, default True) – If True (default), then include a bias column, the feature in which all polynomial powers are zero (i.e. a column of ones - acts as an intercept term in a linear model).

  • order (‘C’ or ‘F’, optional, not for optimizer, default ‘C’) – Order of output array in the dense case. ‘F’ order is faster to compute, but may slow down subsequent estimators.

fit(X, y=None, **fit_params)

Train the operator.

Note: The fit method is not available until this operator is trainable.

Once this method is available, it will have the following signature:

Parameters
  • X (array of items : array of items : float) – The data.

  • y (any type, optional) –

transform(X, y=None)

Transform the data.

Note: The transform method is not available until this operator is trained.

Once this method is available, it will have the following signature:

Parameters

X (array of items : array of items : float) – The data to transform, row by row.

Returns

result – The matrix of features, where NP is the number of polynomial

Return type

array of items : array of items : float