Loading...
Implement polynomial feature expansion for a single-feature input.
Given a list of values x and a degree d, create the expanded feature matrix where each row contains [xi,xi2,xi3,...,xid].
For example, if x=[2,3] and degree =3, the output matrix is: [2349827]
Return the feature matrix as a 2D list, with each value rounded to 4 decimal places.
x = [2, 3] degree = 3
[[2, 4, 8], [3, 9, 27]]