cost function for linear regression with regularization