I know it is possible to obtain the polynomial features as numbers by using: polynomial_features.transform(X). According to the manual, for a degree of two the
import numpy as np
from sklearn.preprocessing import PolynomialFeatures
X = np.array([2,3])
poly = PolynomialFeatures(3)
Y = poly.fit_transform(X)
print Y
# prints [[ 1 2 3 4 6 9 8 12 18 27]]
print poly.powers_
This code will print:
[[0 0]
[1 0]
[0 1]
[2 0]
[1 1]
[0 2]
[3 0]
[2 1]
[1 2]
[0 3]]
So if the i'th cell is (x,y), that means that Y[i]=(a**x)*(b**y).
For instance, in the code example [2 1] equals to (2**2)*(3**1)=12.