Chrisjan Wust
1 min readJun 28, 2019

--

Firstly, I found your article very helpful.

Small note, however: your explanation of PolynomialFeatures didn’t seem quite right.

PolynomialFeatures returns different results than those you showed.
[[ 1. , -3.29215704, 10.83829798],
[ 1. , 0.79952837, 0.63924561],
[ 1. , -0.93621395, 0.87649656]]

This paragraph from sklearn’s documentation explains it best for me:

Generate a new feature matrix consisting of all polynomial combinations of the features with degree less than or equal to the specified degree. For example, if an input sample is two dimensional and of the form [a, b], the degree-2 polynomial features are [1, a, b, a², ab, b²].

The matrix at the end is especially explanatory. It allows easy deduction of the inner workings of the function.

--

--

Chrisjan Wust
Chrisjan Wust

Written by Chrisjan Wust

Tech-optimist looking for a place where recent advancements change an industry. One day I’d like to create such a place myself. For now, I’m an ML Engineer.

No responses yet