---
title: "What is regularization? How can it be used to improve the performance of a machine-learning model?"  
description: "What is regularization? How can it be used to improve the performance of a machine-learning model?"  
author: "Revati S Misra"  
published: 2023-04-19  
updated: 2023-04-19  
canonical: https://www.mindstick.com/forum/157912/what-is-regularization-how-can-it-be-used-to-improve-the-performance-of-a-machine-learning-model  
category: "technology"  
tags: ["technology", "machine learning"]  
reading_time: 2 minutes  

---

# What is regularization? How can it be used to improve the performance of a machine-learning model?

What is [regularization](https://www.mindstick.com/articles/336961/explain-the-concept-of-overfitting-and-underfitting-in-machine-learning)? How can it be used to [improve the performance](https://www.mindstick.com/forum/157913/what-is-ensemble-learning-how-can-it-use-to-improve-the-performance-of-a-machine-learning-model) of a machine-[learning model](https://www.mindstick.com/forum/157937/what-are-the-key-components-of-a-deep-learning-model-and-how-are-they-interconnected)?

## Replies

### Reply by Krishnapriya Rajeev

Regularization is a technique used in machine [learning](https://www.mindstick.com/articles/126221/instructional-design-for-elearning-why-it-is-so-important) to *prevent overfitting of models.* Overfitting occurs when a [model](https://yourviews.mindstick.com/view/81334/america-is-reopening-after-corona-lockdown-but-on-swedish-model) becomes too complex and starts to fit the noise in the data rather than the underlying patterns. Regularization helps to prevent this by adding a penalty term to the loss function during training, which encourages the model to have smaller weights.

Types of regularization used in machine learning:

- **L1 regularization (also known as Lasso regularization):** This involves adding a penalty term to the loss function that is proportional to the absolute value of the weights. This encourages the model to have sparse weights, meaning that some of the weights are set to zero. This can be useful when there are many features in the data, as it can help to select the most relevant features.
- **L2 regularization (also known as Ridge regularization):** This involves adding a penalty term to the loss function that is proportional to the square of the weights. This encourages the model to have smaller weights overall, without necessarily setting any weights to zero. This can be useful when there are fewer features in the data and you want to avoid overfitting.

Regularization can be used to improve the performance of a machine-learning model in several ways:

1. **Preventing overfitting:** As mentioned earlier, regularization can help to prevent overfitting by reducing the complexity of the model and preventing it from fitting the noise in the data.
2. **Reducing the variance of the model:** Regularization can help to reduce the variance of the model, which is the amount by which the model's predictions vary when trained on different subsets of the data. This can help to make the model more stable and predictable.
3. **Improving the generalization performance:** Regularization can help to improve the generalization performance of the model, meaning that it performs better on new, unseen data. This is the ultimate goal of a machine-learning model, and regularization can help to achieve this by reducing overfitting and improving the stability of the model.


---

Original Source: https://www.mindstick.com/forum/157912/what-is-regularization-how-can-it-be-used-to-improve-the-performance-of-a-machine-learning-model

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
