EasyDeepLearn

How do you choose the regularization strength (lambda / alpha)?

medium

Answer

  • Cross-validation over a log-spaced grid is the standard approach — pick alpha minimizing average validation loss.
  • Coefficient path plots (coefficient vs log alpha) help understand which features enter/exit at what strength.
  • For efficiency, use algorithms that compute the whole path (LARS, coordinate descent with warm starts): scikit-learn's LassoCV / RidgeCV / ElasticNetCV do this out of the box.
  • Standardize features first; alpha's meaningful scale depends on it.
Check yourself — multiple choice
  • Pick the alpha that maximizes training accuracy
  • Use cross-validation over a log-spaced grid; standardize features first
  • Set α  =  1\alpha\; = \;1 always
  • Choose alpha by looking at R2R^{2} on training

CV on a log grid + feature standardization is the standard recipe.

#regularization#hyperparameter-tuning#linear-models

Practise Supervised Learning

215 interview questions in this topic.

Related questions