Comments on: Cost Function in MATLAB https://matlabhelper.com/blog/matlab/cost-function-in-matlab/ Education is our future. MATLAB is our feature. Wed, 09 Mar 2022 10:25:43 +0000 hourly 1 By: Sneha G.K https://matlabhelper.com/blog/matlab/cost-function-in-matlab/#comments/1369 http://matlabhelper.com/?p=14966#comment-1369 In reply to David Barnwell.

You can do that. But numiter doesn’t depend on dataset.It depends on the theta value you provide at initial code. Intercept can be used as alpha for Gradient descent.

]]>
By: Sneha G.K https://matlabhelper.com/blog/matlab/cost-function-in-matlab/#comments/1368 http://matlabhelper.com/?p=14966#comment-1368 In reply to David Barnwell.

1.It is a great question but unfortunately number of iteration value is like trial and error, you can try for some set of values till you reach your destination.This is the main reason why we opted neural network.
2.No, it depends on the theta value you give at initial stage.
3. Yes alpha is intercept for previously calculated regression.
Thanks for your compliment on blog and also for asking question.

]]>
By: David Barnwell https://matlabhelper.com/blog/matlab/cost-function-in-matlab/#comments/1367 http://matlabhelper.com/?p=14966#comment-1367 Very nice blog..but this is my question. I’m unclear about the source of numiter, theta and alpha. I;m thinking that you could use least squares algorithm to generate a model. Then, you could use the gradient of the model as an estimate for theta. The size of the data set could be used an estimate for numiter and finally, the intercept of the model could be used as an estimate for alpha in descent gradient. Am I right?

]]>
By: David Barnwell https://matlabhelper.com/blog/matlab/cost-function-in-matlab/#comments/1366 http://matlabhelper.com/?p=14966#comment-1366 How do you determine the number of iterations? Is it the same as the size of the data set? I’m assuming theta is the straight line gradient? Is alpha the intercept value of the regression that’s been previously calculated?

]]>