Skip to content
Quantoros

With two inputs x and z and degree 2, what does interactiononly remove from polynomial expansion?

Classic MLLevel: IntermediatePolynomial interactions

With two inputs x and z and degree 2, what does interaction_only remove from polynomial expansion?

Hints
  • Distinguish interaction from self-multiplication.
  • Check the bias setting independently.

Answer

It retains interactions between distinct features, such as x*z, but excludes repeated powers x² and z². Bias inclusion is a separate parameter.

Source and licence: scikit-learn 1.7.2 — preprocessing · BSD-3-Clause · answer: Quantoros editorial

Related questions