I often use fminunc
for a logistic regression problem. I have read on web that Andrew Ng uses fmincg
instead of fminunc
, with same arguments. The results are different, and often fmincg
is more exact, but not too much. (I am comparing the results of fmincg function fminunc against the same data)
So, my question is : what is the difference between these two functions? What algorithm does each function have implemented? (Now, I just use these functions without knowing exactly how they work).
Thanks :)
You will have to look inside the code of fmincg
because it is not part of Octave. After some search I found that it's a function file provided by the Machine Learning class of Coursera as part of the homework. Read the comments and answers on this question for a discussion about the algorithms.