When should you add interaction features to a linear model?
mediumAnswer
- Add 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
- What is VIF and when do you worry about multicollinearity?
- How do you handle strong multicollinearity in a linear model?
- What's the main risk of polynomial regression?
- When does log-transforming the target help a regression model?
- What do Box-Cox and Yeo-Johnson transforms do?
- Ordinal vs nominal encoding — how do you choose?