STATISTICAL METHODS · BEGINNER GUIDE

Ridge vs Lasso Regression: What Changes?

Compare ridge and lasso penalties, see a small coefficient example and learn when each regularized model may help.

Worked example · ridge regression vs lasso regressionUpdated October 31, 2026

Quick answer: Ridge regression adds a squared-coefficient penalty and usually shrinks coefficients toward zero without setting them exactly to zero. Lasso adds an absolute-value penalty and can set some coefficients to zero, so it can act as a form of variable selection.

Infographic for ridge regression vs lasso regression: Scale predictors, then Choose the penalty family, then Tune within validation, then Compare prediction and stability.
Infographic: a practical sequenceKeep the question, design and assumptions in view from start to finish.
Illustrative coefficient shrinkage. OLS x1: 8 coefficient; Ridge x1: 4.8 coefficient; Lasso x1: 5 coefficient.
Illustrative coefficient shrinkageToy coefficients show shrinkage, not results from measured data.

What this method answers

Both methods trade some coefficient bias for reduced variance and can help with many or correlated predictors. The penalty strength must be selected using validation, and predictors commonly need scaling because the penalty depends on coefficient size.

Use ridge when many predictors may contribute and stable shrinkage is useful. Consider lasso when a sparse model is valuable, but remember correlated predictors can cause it to select one somewhat arbitrarily.

Before running a calculation, write down the population and the exact quantity you want to estimate. A method name alone does not define the question, the comparison or the assumptions.

Steps to follow

  1. Scale predictors using parameters learned only from training data.
  2. Fit ridge, lasso or elastic net with a documented objective and penalty.
  3. Choose penalty strength with cross-validation nested inside the training data.
  4. Compare held-out performance and the consistency of selected coefficients.

Keep a record of exclusions, recoding decisions and software settings. That makes the analysis easier to check and repeat.

Worked example

A toy model has three standardized predictors and ordinary least-squares coefficients [8, 7, 1]. A stronger lasso fit might produce [5, 0, 0.4], while ridge might produce [4.8, 4.2, 0.6].

MethodToy coefficients
Ordinary least squares[8, 7, 1]
Ridge[4.8, 4.2, 0.6]
Lasso[5, 0, 0.4]

The numbers are invented to show the penalty behaviour, not a fitted dataset. Ridge shrinks all three values; lasso shrinks and sets the second coefficient to zero. Different folds or correlated predictors could produce a different sparse choice.

Interpret the result carefully

Compare validation performance and coefficient stability, not just how many coefficients reach zero. If the goal is inference about an effect, penalized coefficients do not have the same straightforward interpretation as ordinary least-squares estimates.

Limit to keep in mind: Standardization and penalty selection are part of the modeling pipeline. Fit both inside each validation fold; fitting a scaler or selecting the penalty using all observations leaks information.

When reporting an analysis, include the sample size, estimate, units and uncertainty. Explain why the method fits the sampling and measurement design. Separate planned tests from exploratory checks, and avoid saying that association proves a cause.

Frequently asked questions

Which is better for correlated predictors?

Ridge often shares shrinkage across correlated inputs; lasso may select one and drop others. Elastic net is another candidate.

Does lasso always select the best variables?

No. Selection can be unstable and depends on sample, scaling, penalty and predictor correlations.

Do I scale before ridge or lasso?

Usually yes, because penalties operate on coefficient sizes. Learn scaling from training folds only.

Can I interpret a penalized coefficient causally?

Not from the penalty alone. Design, confounding and model assumptions still govern causal interpretation.

Sources and next steps