from sklearn.preprocessing import PolynomialFeatures import numpy as np X = np.array([[3,4],[7,8]]) poly = PolynomialFeatures(degree=2) poly.fit_transform(X)
array([[ 1., 3., 4., 9., 12., 16.], [ 1., 7., 8., 49., 56., 64.]])The first column represents the constant term, the second and third columns are the original features, and the remaining columns represent the interaction between the input features. Thus, `PolynomialFeatures` belongs to the `preprocessing` module of the `scikit-learn` library in Python.