\newcommand{\matrix}[1]{\mathbf{#1}}
\newcommand{\vector}[1]{\mathbf{#1}}
% define vars upfront
\newcommand{\X}{\matrix{X}}
\newcommand{\y}{\vector{y}}
\newcommand{\w}{\vector{w}}
% actual loss
\mathcal{L}_{LS}(\X,\y,\w) = \frac{1}{n} \sum_{i=1}^n \mathcal{L}_{LS} (\X_i, y_i, \w) = \frac{1}{n} \sum_{i=1}^n \left( y_i - \X_i^T \w \right)^2 = \frac{1}{n} \|\y - \X\w\|_2^2
