Overfitting in linear regression: how it shows up with too many predictors or too high a polynomial degree

Quick Overview

Asks what overfitting means for a linear regression model and how it shows up when the model has too many predictors or too high a polynomial degree. Tests the train-test gap, coefficient behavior, the bias-variance trade-off, and how to choose model complexity with validation and regularization.

Overfitting in linear regression: how it shows up with too many predictors or too high a polynomial degree

Role: Data Scientist

Category: Machine Learning

Difficulty: medium

Interview Round: Other

What is overfitting in the context of linear regression, and how does it manifest when you use too many predictors or too high a polynomial degree? ```hint Compare two errors Think about how training error and error on new data each move as you add predictors or raise the polynomial degree. ``` ```hint Count the parameters Consider what happens to the fit when the number of estimated coefficients gets close to the number of observations. ``` ### What a Strong Answer Covers - A definition of overfitting in terms of training performance versus performance on new data - The observable symptoms in a linear model: the train-test gap, the behavior of the coefficients, and the shape of a high-degree polynomial fit - Why adding predictors or polynomial terms never hurts training fit, and the bias-variance explanation of what goes wrong - How to detect overfitting, choose model complexity, and reduce it ### Follow-up Questions - You fit OLS with 500 predictors and 600 observations. What would you expect the training and test error to look like, and what would you try first? - Why does adjusted R-squared penalize extra predictors, and how does it compare with cross-validation for choosing a model? - How do ridge and lasso differ in what they do to the coefficients of a high-degree polynomial fit? - Why do the coefficients of a high-degree polynomial often become huge with alternating signs, and what does centering the input or using orthogonal polynomials change?

Overview: Asks what overfitting means for a linear regression model and how it shows up when the model has too many predictors or too high a polynomial degree. Tests the train-test gap, coefficient behavior, the bias-variance trade-off, and how to choose model complexity with validation and regularization.

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

What is overfitting in the context of linear regression, and how does it manifest when you use too many predictors or too high a polynomial degree?

What a Strong Answer Covers Guidance

  • A definition of overfitting in terms of training performance versus performance on new data
  • The observable symptoms in a linear model: the train-test gap, the behavior of the coefficients, and the shape of a high-degree polynomial fit
  • Why adding predictors or polynomial terms never hurts training fit, and the bias-variance explanation of what goes wrong
  • How to detect overfitting, choose model complexity, and reduce it

Follow-up Questions Guidance

  • You fit OLS with 500 predictors and 600 observations. What would you expect the training and test error to look like, and what would you try first?
  • Why does adjusted R-squared penalize extra predictors, and how does it compare with cross-validation for choosing a model?
  • How do ridge and lasso differ in what they do to the coefficients of a high-degree polynomial fit?
  • Why do the coefficients of a high-degree polynomial often become huge with alternating signs, and what does centering the input or using orthogonal polynomials change?