training and testing residuals