Quadratic variable conversion

I try to learn a little machine learning and wondered what quadratic and cubic data transformations are and how is this done? One forum guy is talking about this, and I was wondering what variable conversion is and how it is done. thank you

+5
source share
1 answer

Polynomial functions (quadratic, cubic, etc.) are used to reduce the displacement in the model and allow interactions between members. In scikit-learn, it is implemented as a conversion to sklearn.preprocessing.PolynomialFeatures .

The idea is that you have three functions a , b and c . Quadratic functions will be generated by extending (a + b + c) ^ 2 . Thus, a^2 , b^2 c^2 , a*b , a*c , b*c would be a set of quadratic functions.

Inside scikit-learn PolynomialFeatures , when the degree argument is passed, all members to this degree are created.

This is usually used before building a linear model. This reduces bias, but very quickly increases the size of the feature set.

+7
source

Source: https://habr.com/ru/post/1239732/


All Articles