MachineLearning Exercise 5 :Regularized Linear Regression and Bias vs Variance
之前本打算把ML每一堂课做个笔记来着,现在coursera内容太详细了,再接着截图做笔记感觉太逗逼了,就把课后编程练习做下笔记吧。。。
linearRegCostFunction
pre = X*theta-y;
J = (1/(2*m))*(pre'*pre+lambda*(theta(2:end)'*theta(2:end)));
grad = (1/m)*(pre'*X)';