Fixed the method for getting the prediction error