1
0
Fork 0

Validation curve function

master
neingeist 10 years ago
parent 3751214442
commit 78830aaea7

@ -39,14 +39,14 @@ error_val = zeros(length(lambda_vec), 1);
%
%
for i = 1:length(lambda_vec)
lambda = lambda_vec(i);
theta = trainLinearReg(X, y, lambda);
lambda = 0;
error_train(i) = linearRegCostFunction(X, y, theta, lambda);
error_val(i) = linearRegCostFunction(Xval, yval, theta, lambda);
end
% =========================================================================