L2 regularization adds a penalty proportional to the squared magnitude of model weights. It discourages overly large weights, helping reduce overfitting and improve generalization while usually keeping all features in the model.
A type of regularization that penalizes weights in proportion to the sum of the squares of the weights. L~2~ regularization helps drive outlier weights (those with high positive or low negative values) closer to 0 but not quite to 0. Features with values very close to 0 remain in the model but don't influence the model's prediction very much. L~2~ regularization always improves generalization in linear models. Contrast with L~1~ regularization. See Overfitting: L2 regularization in Machine Learning Crash Course for more information.