Compute MSE, MAE, and R-squared from scratch, including constant-target handling and rounded metric output.