Cost function evaluations are now inside the regression function.