Polynomial features machine learning

There is one parameter in PolynomialFeatures that is Interaction_only please explai it.

Hi, Anubhav.

Polynomial features means whose degree is 2, for ex:- X^2, Y^2,XY etc,
Kindly read the below article for more informations on Polynomial features in sklearn.
https://scikit-learn.org/stable/modules/generated/sklearn.preprocessing.PolynomialFeatures.html

All the best!

Whatever Satyajit explained above about Polynomial features is correct. I am not able to understand what do you mean by “interaction_only”. Where did you read it?

THIS IS WHAT I AM TALKING ABOUT.
INTERACTION_ONLY
I DIDN’T UNDERSTAND THE EXPLANATION IN THE DOCUMENTATION.

Hi, Anubhav.

The explanation is self explanatory.

interaction_only is the parameter that guide the model to take which features to take.

  1. If true, only interaction features are taken like XY, YZ,ZX etc features that are products of at most
  2. if false, only the independent features will be taken like X^2,Y^2,Z^2 etc.
    You can find out which features to take using correlation matrix, that how much dependency is there of one features on others.

Usually we keep interaction_only=False as we assume that the features are mutually independent to make any model, otherwise lot of complicated cases may arise and many combinations of the polynomial features are there if features are more in number, this increase the complexity of model.

All the best!

REGARDING MACHINE LEARNING INTERVIEW

Do interviewers also ask the maths oriented or the implemented maths behind the particular algorithm or model.
In other words do they prefer asking the manual implementation the model using the coding only or with the help of machine learning libraries?