Mean square error - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English

This is the most basic model and its use is widespread across many applications. The cost function for a linear regression model where the fit (loss) is measured by the mean square error (MSE) is,

\[\begin{split}C_{\{0<\lambda,0\le\alpha\le1\}}\left( \beta_0, \beta \right) & = L(y, \beta_0, \beta X) \\ & = \mathrm{MSE}(y, \beta_0, \beta X)= \frac{1}{2n} \sum_{i=1}^n (y_i - \beta_0 - \beta X_i)^2 + \lambda \bigg( \alpha \lVert \beta \rVert_1 + \frac{(1 - \alpha)}{2} \lVert \beta \rVert_2^2 \bigg),\end{split}\]

where \(X_i\) represents a single (multi-dimensional) observation, i.e., a row in a table of observations. Note that the intercept term \(\beta_0\) is not regularized.