Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding ex-5(week 6) - validationCurve #4

Open
SehgalDivij opened this issue Jan 6, 2018 · 0 comments
Open

Regarding ex-5(week 6) - validationCurve #4

SehgalDivij opened this issue Jan 6, 2018 · 0 comments

Comments

@SehgalDivij
Copy link

SehgalDivij commented Jan 6, 2018

In week 6 - exercise 5 - validationCurve.m could you explain why your code works and this doesn't:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant