Regression
Regression with Regularization
2023-12-13
The following depicts the results of approximating the given (x, y) data with polynomial regression from degree 3 to degree 8. As we transition from the 7th-degree polynomial to the 8th-degree polynomial, we can visually observe a significant overfitting problem between the data points. This overfitting can also be confirmed numerically by calculating the inner product of the coefficients (when modeling y' = WT x, i.e., yi' = Σxijwj, the inner product is WTW = Σwj2), as shown in the diagram on the right, where a sharp increase in values occurs in the 8th-degree polynomial.

From such discoveries, to prevent overfitting of any regression equation, one can consider minimizing the error between the actual and predicted values by including the value of W (||W|| or WTW) in the cost function to minimize. This process is called regularized regression.
According to the applied regularization, it can be classified into Ridge, LASSO, and ElasticNet.
1. Ridge Regression - Use L2 penalty
\(J(w)=\dfrac{1}{2}\sum _i^{\ }(y_i-y'_i)^2+\alpha \dfrac{1}{2}\sum _j^{\ }w_j^2\)
2. LASSO (least absolute shrinkage and selection operator) - Use L1 Penalty. An important feature of LASSO is that it can be used to eliminate less important features by setting their weights to zero, leaving only the important features.
\(J(w)=\dfrac{1}{2}\sum _i^{\ }(y_i-y'_i)^2+\alpha \sum _j^{\ }|w_j|\)
3. ElasticNet = Ridge + LASSO
\(J(w)=\dfrac{1}{2}\sum _i^{\ }(y_i-y_i")^2+(1-\alpha )\sum _j^{\ }w_j^2+\alpha \sum _j^{\ }|w_j|\)
When α = 1, ElasticNet becomes Lasso, and when α = 0, it becomes same as Ridge regression.
The solution to this problem at Excel4ML is to minimize the entire cost function using Excel's Solver.
The following is the result of obtaining coefficients for Ridge and LASSO with α=0.1.
(a) Ridge

(b) LASSO - You can see that the coefficients for the high order have been removed.
