1

Typically, $X$ is $n\times p$, where $n$ is the number of samples and $p$ is the number of features. So, the shape of $\lambda I$ should be $p\times p$ in order for the expression to be mathematically correct. The identity term comes from the loss function of the Ridge Regression: $$L=||X\beta-y||^2+{\lambda}||\beta||^2 = (X\beta-y)^T(X\beta-y)+{\lambda}\...


Only top voted, non community-wiki answers of a minimum length are eligible