for i=1:length(lambda_vec)
lambda = lambda_vec(i);
theta = trainLinearReg(X, y, lambda);
error_train(i) = linearRegCostFunction(X, y, theta, lambda);
error_val(i) = linearRegCostFunction(Xval, yval, theta, lambda);
end
The above snippet makes perfect sense to me, but it isn't correct.
In week 6 - exercise 5 - validationCurve.m could you explain why your code works and this doesn't:
The above snippet makes perfect sense to me, but it isn't correct.