How can you make logistic regression capture non-linear relationships using interaction or polynomial terms?

Quick Overview

Asks how to make logistic regression model non-linear effects with interaction, polynomial and spline terms. Tests whether you know why the model stays linear in its parameters, how to read conditional coefficients, and how to control overfitting and collinearity in an expanded feature set.

How can you make logistic regression capture non-linear relationships using interaction or polynomial terms?

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Other

How can you make logistic regression capture non-linear relationships using interaction or polynomial terms? ```hint What has to stay linear Logistic regression only has to be linear in its coefficients. Think about what you are free to put in the feature columns. ``` ```hint Watch the side effects Expanded features are correlated with the originals and multiply quickly. Consider what that does to fitting and to reading the coefficients. ``` ### What a Strong Answer Covers - Why logistic regression is linear in the log-odds, and why transformed features keep the fitting procedure unchanged - How an interaction term lets one predictor's effect depend on another, and how to read its coefficient - How polynomial or spline terms bend the log-odds curve of a single predictor, and when to prefer splines - How to control overfitting, scaling and collinearity in the expanded feature space - How to explain the fitted model once coefficients are no longer marginal effects ### Follow-up Questions - Without any product term, is there already an interaction between predictors on the probability scale? - How would you choose the polynomial degree or the number and placement of spline knots? - How many features does a degree-2 expansion of 100 inputs create, and how would you keep that manageable? - When would you switch to a tree-based model or a generalized additive model?

Overview: Asks how to make logistic regression model non-linear effects with interaction, polynomial and spline terms. Tests whether you know why the model stays linear in its parameters, how to read conditional coefficients, and how to control overfitting and collinearity in an expanded feature set.

General logo
General
Nov 25, 2026
mediumData ScientistOtherMachine Learning
0
0

How can you make logistic regression capture non-linear relationships using interaction or polynomial terms?

What a Strong Answer Covers Guidance

  • Why logistic regression is linear in the log-odds, and why transformed features keep the fitting procedure unchanged
  • How an interaction term lets one predictor's effect depend on another, and how to read its coefficient
  • How polynomial or spline terms bend the log-odds curve of a single predictor, and when to prefer splines
  • How to control overfitting, scaling and collinearity in the expanded feature space
  • How to explain the fitted model once coefficients are no longer marginal effects

Follow-up Questions Guidance

  • Without any product term, is there already an interaction between predictors on the probability scale?
  • How would you choose the polynomial degree or the number and placement of spline knots?
  • How many features does a degree-2 expansion of 100 inputs create, and how would you keep that manageable?
  • When would you switch to a tree-based model or a generalized additive model?