As per the description given below: 'if an input sample is two dimensional and of the form [a, b], the degree-2 polynomial features are [1, a, b, a^2, ab, b^2].'
sklearn.preprocessing.PolynomialFeatures
I need my output ndarray generated to be of the type: [a, b, a^2, b^2]
I know that poly = PolynomialFeatures(2, include_bias=False)
poly.fit_transform(X)
gives the output like : [a, b, a^2, ab, b^2]. But I do not want these intermediate 'ab' type columns that are being generated. How to do that any idea? Or any better API that can be used here?