EasyDeepLearn

When should you add interaction features to a linear model?

medium

Answer

  • Add xi    xjx_{i}\; \cdot \;x_{j} when the effect of one feature on y depends on the value of another and your model class can't discover this on its own (linear models can't).
  • Common in marketing (channel × segment), medicine (treatment × age), and pricing (product × geography).
  • Signs: residual patterns when you slice by a second feature, domain knowledge of moderation, or when a tree model beats a linear model but you want linear interpretability.
Check yourself — multiple choice
  • Only when features are correlated
  • When the effect of one feature depends on another (moderation) and the model can't learn it directly
  • Never — trees always learn interactions
  • Only for regression problems

Interactions encode moderation effects that linear models cannot capture on their own.

#linear-regression#feature-engineering#features

Practise Supervised Learning

215 interview questions in this topic.

Related questions