We have introduced the mathematcal setting of linear regression in
last section. Becasue a linear model is decided by its weight vector, we
can think of it as a function of
Given a training set
In machine learning, the goal is to build models that can generalize well to new data. However, sometimes models can either be too simple or too complex, leading to underfitting or overfitting, respectively. Underfitting occurs when a model is too simple to capture the underlying patterns in the data, resulting in poor performance on the training data as well as on new data. On the other hand, overfitting occurs when a model is too complex and fits the training data too closely, resulting in excellent performance on the training data but poor performance on new data. Overfitting is a common problem in machine learning, especially when working with high-dimensional data or limited amounts of training data.
Regularization is a technique that can be used to prevent overfitting in linear regression models and improve the generalization performance. Regularization works by adding a penalty term to the cost function that the linear regression model is trying to minimize. The penalty term is based on the magnitude of the weight (or coefficients) in the model. By adding this penalty term, the model is encouraged to use smaller coefficients, which results in a simpler model that is less likely to overfit the data.
The most widely used type of regularization in linear reguression is
where
Another common type of regularization is
Overall, regularization is an important technique for improving the performance of linear regression models, especially when dealing with high-dimensional data or limited amounts of training data.