tag:blogger.com,1999:blog-4925159124120434624.post7287284852272874669..comments2020-08-13T16:28:40.312+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.comBlogger41125tag:blogger.com,1999:blog-4925159124120434624.post-21994052930302705572020-08-06T10:19:57.115+05:302020-08-06T10:19:57.115+05:30@Hassan Ashas Thank you very much for your explana...@Hassan Ashas Thank you very much for your explanation. Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-46137772125714270382020-08-06T10:07:33.713+05:302020-08-06T10:07:33.713+05:30Predict function is fairly simple. You have implem...Predict function is fairly simple. You have implemented your gradient and now you just have to predict whether the answer will be 1 or 0... So, what will you do is check for the result > 0.5. If it is above the 0.5, then prediction will be true (1), otherwise false (0)Hassan Ashashttps://www.blogger.com/profile/10622849688849233047noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-31794537760047853192020-07-24T18:52:10.158+05:302020-07-24T18:52:10.158+05:30please explain the predict function
please explain the predict function<br />Anonymoushttps://www.blogger.com/profile/07160652273745980647noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-83439833224891989002020-07-12T17:33:32.486+05:302020-07-12T17:33:32.486+05:30Good day sir,
im new in this course...i could not ...Good day sir,<br />im new in this course...i could not fully understand the assignment in week 3...as i enter my code...i think still in error..<br />Anonymoushttps://www.blogger.com/profile/06068463495579904587noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-16110248876792383992020-07-06T14:05:21.429+05:302020-07-06T14:05:21.429+05:30It's because as per the theory in videos, We d...It's because as per the theory in videos, We don't apply regularization on theta_0. Regularization is applied from theta_1 onwards.<br />and that's why 2 gradients. 1st corresponding to theta_0 and other for theta_1 onwards.Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-46824253782841959342020-07-05T19:15:29.913+05:302020-07-05T19:15:29.913+05:30And also why use two gradents?And also why use two gradents?HarshDhttps://www.blogger.com/profile/02458567723819453991noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-84239283739093434952020-07-04T22:15:04.079+05:302020-07-04T22:15:04.079+05:30 Hi Akshay can you please explain why we use this ... Hi Akshay can you please explain why we use this X(:,2:end) and theta(2:end) instead of plain X and theta??HarshDhttps://www.blogger.com/profile/02458567723819453991noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-64807854582151060942020-06-15T16:35:59.726+05:302020-06-15T16:35:59.726+05:30How's value of 'g' is unused. 'g&#...How's value of 'g' is unused. 'g' is nothing but output of sigmoid function.<br />If you are getting some msg, it must be warning not error. So, don't worry about it, keep it as it is. (But I don't think you should get any kind of warning like this).<br />line 6, is called initialization of variable. Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-80788545993843516562020-06-15T12:09:19.645+05:302020-06-15T12:09:19.645+05:30In sigmoid
error in line 6 (the preallocated valu...In sigmoid <br />error in line 6 (the preallocated value assigned to variable 'g' might be unused)<br /><br />what should i doAnonymoushttps://www.blogger.com/profile/02283182092706870443noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-44145318950717711592020-05-31T10:28:59.400+05:302020-05-31T10:28:59.400+05:30I am facing this type of problem in matlab , what ...I am facing this type of problem in matlab , what can i do ? how to fix that n where ??<br /><br /><br /><br />'fminunc' requires Optimization Toolbox.<br /><br />Error in ex2 (line 99)<br /> fminunc(@(t)(costFunction(t, X, y)), initial_theta, options);Anonymoushttps://www.blogger.com/profile/17992936694801678312noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-63785471255905152822020-05-18T12:42:03.475+05:302020-05-18T12:42:03.475+05:30Hey it says my plot is empty can someone help?
Hey it says my plot is empty can someone help?<br />Qwert123https://www.blogger.com/profile/12356701398144965652noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-9787060533704178022020-05-18T12:05:12.490+05:302020-05-18T12:05:12.490+05:30Hi Ankit,
Sorry but I don't have the code for...Hi Ankit, <br />Sorry but I don't have the code for "fminunc".Akshay Daga (APDaga)https://www.blogger.com/profile/04899846959607912677noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-29149896235051776302020-05-16T18:33:03.837+05:302020-05-16T18:33:03.837+05:30grad(2:end) = (1/m)* (X(:,2:end)'*(h_x-y))+(la...grad(2:end) = (1/m)* (X(:,2:end)'*(h_x-y))+(lambda/m)*theta(2:end); can u please explain this.. Anonymoushttps://www.blogger.com/profile/14757099075509254840noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-62627743051192105902020-05-16T14:23:53.863+05:302020-05-16T14:23:53.863+05:30Hello Akshay,
It'd be great if you kindly sha...Hello Akshay, <br />It'd be great if you kindly share the code for "fminunc" in this week's files(wherever needed), coz i don't understand that particular function well, neither did i get its solution anywhere else on internet.ankithttps://www.blogger.com/profile/14443613991317717056noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-53839913723236983032020-04-06T12:40:38.878+05:302020-04-06T12:40:38.878+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 out the comment by Chethan Bhandarkar: 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-25960102142536228772020-04-05T20:11:00.873+05:302020-04-05T20:11:00.873+05:30Hi there,
I am trying the the same code as yours o...Hi there,<br />I am trying the the same code as yours of sigmoid() function but each time it is getting an error saying that <br /><br />'z' undefined near line 6 column 18<br />error: called from<br /> sigmoid at line 6 column 5<br /><br />what to do please help me out..<br />Anonymoushttps://www.blogger.com/profile/04973359195499369157noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-13144642836093796562020-04-01T15:38:10.005+05:302020-04-01T15:38:10.005+05:30sir,please explain me predict.m function
I used
fo...sir,please explain me predict.m function<br />I used<br />for i=1:size(X,1)<br /> if sigmoid(X*theta)>=0.5<br /> p=sigmoid(X*theta);<br /> <br />end<br />as well as,<br />h_x = sigmoid(X*theta);<br />for i=1:size(X,1)<br /><br /> if (0<=h_x<0.5)<br /> p=0;<br /> elseif (0.5<=h_x<=1)<br /> p=1;<br />end<br />but i am getting 40 accuracy it is working only with your code.why sir?<br />Anonymoushttps://www.blogger.com/profile/12278037832885953430noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-74105148181577445492019-11-05T13:39:29.699+05:302019-11-05T13:39:29.699+05:30HI, The line code reg_term = (lambda/(2*m)) * sum(...HI, The line code reg_term = (lambda/(2*m)) * sum(theta(2:end).^2); in costFunctionReg function,<br /><br />can you explain more about this part theta(2:end) , what does it mean and how did you deduce it,Azizhttps://www.blogger.com/profile/14776942143350891456noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-91630243506728048292019-11-02T10:53:54.869+05:302019-11-02T10:53:54.869+05:30hi I want to clarify few things from you,
I have r...hi I want to clarify few things from you,<br />I have read in regression, these are few important points which have not been covered in andrew ng regression topic, how to find how significant your variable is, significance of p value and R^2 (R-square) values. I would like to know more about them. kindly share some sources.puneethttps://www.blogger.com/profile/14659236045581900318noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-11194172369406352082019-10-20T18:04:24.185+05:302019-10-20T18:04:24.185+05:30Can you tell me , how can I run "ex2" sc...Can you tell me , how can I run "ex2" script in console ?Md Inamul Haroonhttps://www.blogger.com/profile/04843443418695982036noreply@blogger.comtag:blogger.com,1999:blog-4925159124120434624.post-22717296618609398792019-10-20T18:01:41.175+05:302019-10-20T18:01:41.175+05:30I have copy the exact code for plotData.m , and al...I have copy the exact code for plotData.m , and all the others program worked very well but I am still getting 70/100. Can you tel what's the problem ?Md Inamul Haroonhttps://www.blogger.com/profile/04843443418695982036noreply@blogger.comtag: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'?Sarthakhttps://www.blogger.com/profile/12180643090635147550noreply@blogger.com