tag:blogger.com,1999:blog-4925159124120434624.post7287284852272874669..comments2019-08-22T21:50:36.161+05:30Comments on APDaga DumpBox : The Thirst for Learning...: Coursera: Machine Learning (Week 3) [Assignment Solution] - Andrew NGAkshay Daga (APDaga)http://www.blogger.com/profile/04899846959607912677noreply@blogger.comBlogger20125tag:blogger.com,1999:blog-4925159124120434624.post-50356263018002230332019-07-27T17:18:03.788+05:302019-07-27T17:18:03.788+05:30Hi, I think you are doing this assignment in Octav...Hi, I think you are doing this assignment in Octave and that's why you are facing this issue.<br /><br />Chethan Bhandarkar has provided solution for it. Please check it out: https://www.apdaga.com/2018/06/coursera-machine-learning-week-2.html?showComment=1563986935868#c4682866656714070064<br /><br />ThanksAkshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-59561390055593509672019-07-27T15:36:12.890+05:302019-07-27T15:36:12.890+05:30hey bro it says z not defined why???hey bro it says z not defined why???GowdAhttps://www.blogger.com/profile/15820733760819753538noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-3609414670144728422019-07-26T15:47:39.097+05:302019-07-26T15:47:39.097+05:30P is a matrix with dimensions m x 1.
Solution:
You...P is a matrix with dimensions m x 1.<br />Solution:<br />You can put your code in a "for" loop and check the value of each element in h_x and accordingly set the value of each element in p.<br /><br />It will work.Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-19632902032447052412019-07-26T13:34:19.650+05:302019-07-26T13:34:19.650+05:30Hii, thanks for your help mr. Akshay. I had this o...Hii, thanks for your help mr. Akshay. I had this one doubt about predict.m function:<br />I tried coding for predict function in the following way:<br /><br />h_x = sigmoid(X*theta);<br />if (0<=h_x<0.5)<br /> p=0;<br />elseif (0.5<=h_x<=1)<br /> p=1;<br />endif<br /><br />I know I did it in a long way but the accuracy that I am getting 60.00. Your code gave me the accuracy 89.00. Can you please help me understand what's wrong with this and what's the exact difference between your code and mines'?Unknownhttps://www.blogger.com/profile/12180643090635147550noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-11299712100981396302019-07-22T12:42:33.308+05:302019-07-22T12:42:33.308+05:30When we are calculating z(small z) for a single sa...When we are calculating z(small z) for a single sample, then it is z=theta' * x. (here small x)<br />But When you do the same computation for all the samples at the same time then we call it as Z (Capital Z).<br />Z = X * theta. (Here Capital X)<br /><br />Try to do it using pen-paper, you will get clear understanding.Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-54613887286845833382019-07-21T13:30:16.210+05:302019-07-21T13:30:16.210+05:30we have learned that Z= theta transpose X then why...we have learned that Z= theta transpose X then why are using Z=X multiplied by theta in the above codes ?Unknownhttps://www.blogger.com/profile/02081641664582844102noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-79150931483328434522019-07-18T00:03:27.053+05:302019-07-18T00:03:27.053+05:30Did you figure out the reason yet?Did you figure out the reason yet?Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-85704938330233711412019-07-18T00:02:48.043+05:302019-07-18T00:02:48.043+05:30sum() is used for the summation in the formula.
B...sum() is used for the summation in the formula. <br />But here while coding for grad computation: grad = (1/m)* (X'*(h_x-y)); <br />Here We are doing matrix multiplication which itself consist of "sum of product". So, no need of external sum function.<br />Please try to do it on paper by yourself, you will get clear idea.<br />ThanksAkshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-6210771318608277332019-07-17T22:20:08.308+05:302019-07-17T22:20:08.308+05:30Hi !! why didn't you use sum() function for gr...Hi !! why didn't you use sum() function for grad even why formula contains that ?Shashankhttps://www.blogger.com/profile/10837248327990107977noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-14372271147757722382019-07-06T14:20:59.144+05:302019-07-06T14:20:59.144+05:30I used the exact code at the end but I'm still...I used the exact code at the end but I'm still getting 65/100 not able to figure out the reason<br />Unknownhttps://www.blogger.com/profile/03054230492277281950noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-46378064281611569452019-06-18T13:18:22.422+05:302019-06-18T13:18:22.422+05:30In this gradient decent the number of iteration ar...In this gradient decent the number of iteration are not specified so how is the gradient decent working? can someone please explain?ashttps://www.blogger.com/profile/06245033681034518834noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-78696436542819902952019-06-18T12:57:27.916+05:302019-06-18T12:57:27.916+05:30Hi, can you please explain the predict function? Hi, can you please explain the predict function? ashttps://www.blogger.com/profile/06245033681034518834noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-87556744717353300222019-06-07T12:22:02.526+05:302019-06-07T12:22:02.526+05:30this means:- take the transpose of feature matrix ...this means:- take the transpose of feature matrix X(i.e X') and multiply it with the difference of matrices h_x and y i.e the matrix with sigmoid outputs and the result matrix(y). Finally multiply the end product with 1/m , where m is the number of training examples.<br /><br />This is the vectorized implementation of the code that's actually way more lengthier to implement using loops. Unknownhttps://www.blogger.com/profile/17754467491726481224noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-14277551796764639352019-05-30T00:25:24.776+05:302019-05-30T00:25:24.776+05:30can you please tell me what you did by this
grad...can you please tell me what you did by this <br /><br />grad = (1/m)* (X'*(h_x-y));Unknownhttps://www.blogger.com/profile/04032294702053578890noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-1864384293685849852019-05-29T10:49:04.462+05:302019-05-29T10:49:04.462+05:30You can get those files from Coursera assignments....You can get those files from Coursera assignments. I don't have those with me now.Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-46072432765467515622019-05-27T16:16:42.141+05:302019-05-27T16:16:42.141+05:30Hi Akshay, Please may I have theses files as well:...Hi Akshay, Please may I have theses files as well:<br /><br />ex2.m <br />ex2 reg.m<br />ex2data1.txt<br />ex2data2.txt<br />submit.m<br />mapFeature.m<br />plotDecisionBoundary.m<br /><br /><br /><br /><br />Unknownhttps://www.blogger.com/profile/05562265658145574971noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-74653438001562507812019-05-21T20:03:01.869+05:302019-05-21T20:03:01.869+05:30You can copy the the code from above code sections...You can copy the the code from above code sections.Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-5997863756108889682019-05-20T14:49:33.991+05:302019-05-20T14:49:33.991+05:30How can i download these files?How can i download these files?Unknownhttps://www.blogger.com/profile/15167991021162972666noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-59108732028901115332019-05-17T14:07:18.785+05:302019-05-17T14:07:18.785+05:30What explanation you want?
Please be more specifi...What explanation you want? <br />Please be more specific.Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-66657831605266700702019-05-17T10:01:05.345+05:302019-05-17T10:01:05.345+05:30how could you do this please explain me...how could you do this please explain me...Ranjithhttps://www.blogger.com/profile/07474497628060689679noreply@blogger.com