Skip to content
Middle+0 views

How would this show up in gradient descent with these two correlated features—what would the model try to do?

Practice

Asked at

AI answer

When features are strongly correlated, it is difficult for a model to determine which one individually explains the outcome: many coefficient combinations produce nearly identical predictions. For example, if (x_1) and (x_2) are almost identical, the sum of their contributions may matter more than either coefficient on its own.

  • Without regularization, coefficients can become large and have opposite signs, canceling each other out; the estimates will be unstable.
  • With L2, the penalty usually makes the distribution of weights smoother: correlated features often receive similar, nonzero coefficients. However, the problem may be ill-conditioned, and gradient descent may converge slowly.
  • With L1, the optimum often keeps one feature’s weight nonzero and sets the other to zero. Which feature is selected may depend on noise and the data, so feature selection can be unstable.

If the features are identical, the loss function depends on the sum of their coefficients, not on how that sum is divided between them. Therefore, we should not expect gradient descent to always select one particular feature; the result depends on symmetry, initialization, and the optimizer. Predictions may be stable even when the coefficients themselves are not.