Error estimates for the regularization of least squares problems