LFD Book Forum  

Go Back   LFD Book Forum > Course Discussions > Online LFD course > Homework 4

Reply
 
Thread Tools Display Modes
  #1  
Old 08-07-2012, 04:57 AM
itooam itooam is offline
Senior Member
 
Join Date: Jul 2012
Posts: 100
Default Q4) h(x) = ax

This question is similar to that in the lectures i.e.,

in the lecture H1 equals

h(x) = ax + b

Is this question different to the lecture in the respect we shouldn't add "b" (i.e., X0 the bias/intercept) when applying? Or should I treat the same?

My confusion is because in many papers etc a bias/intercept is assumed even if not specified i.e., h(x) = ax could be considered the same as h(x) = ax + b
Reply With Quote
  #2  
Old 08-07-2012, 05:24 AM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Q4) h(x) = ax

Quote:
Originally Posted by itooam View Post
This question is similar to that in the lectures i.e.,

in the lecture H1 equals

h(x) = ax + b

Is this question different to the lecture in the respect we shouldn't add "b" (i.e., X0 the bias/intercept) when applying? Or should I treat the same?

My confusion is because in many papers etc a bias/intercept is assumed even if not specified i.e., h(x) = ax could be considered the same as h(x) = ax + b
There is no bias/intercept in this problem, only the slope (one parameter which is a).
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 08-07-2012, 05:36 AM
itooam itooam is offline
Senior Member
 
Join Date: Jul 2012
Posts: 100
Default Re: Q4) h(x) = ax

Thanks for comfirmation, much appreciated
Reply With Quote
  #4  
Old 01-31-2013, 11:16 AM
geekoftheweek geekoftheweek is offline
Member
 
Join Date: Jun 2012
Posts: 26
Default Re: Q4) h(x) = ax

Is there a best way to minimize the mean-squared error? I am doing gradient descent with a very low learning rate (0.00001) and my solution is diverging! not converging. Is it not feasible to do gradient descent with two points when approximating a sine?
Thanks
Reply With Quote
  #5  
Old 01-31-2013, 12:09 PM
geekoftheweek geekoftheweek is offline
Member
 
Join Date: Jun 2012
Posts: 26
Default Re: Q4) h(x) = ax

Never mind, I got my solution to converge, though I do not trust my answer. Oh well.
Reply With Quote
  #6  
Old 01-31-2013, 04:34 PM
sanbt sanbt is offline
Member
 
Join Date: Jan 2013
Posts: 35
Default Re: Q4) h(x) = ax

Quote:
Originally Posted by geekoftheweek View Post
Never mind, I got my solution to converge, though I do not trust my answer. Oh well.
You can use linear regression to calculate each hypothesis.
(since linear regression is basically analytical formula for minimizing mean square error).

Also, you can confirm if your g_bar from simulation makes sense by calculate it directly. (calculate expectation of the hypothesis from each (x1,x2) over [-1,1] x [-1,1] ). This involves two integrals but you can plug in the expression to wolfram or mathematica.
Reply With Quote
  #7  
Old 04-30-2013, 03:55 AM
jlevy jlevy is offline
Junior Member
 
Join Date: Apr 2013
Posts: 5
Default Re: Q4) h(x) = ax

Quote:
Originally Posted by geekoftheweek View Post
Is there a best way to minimize the mean-squared error?
Thanks
Just use w=inv(X`*X)*X`*Y
and note that X has just a single column (no column of 1's).
__________________
Joe Levy
[URL="https://trustmeimastatistician.wordpress.com/"]Trust me, I'm a statistician[/URL]
Reply With Quote
  #8  
Old 03-04-2016, 07:13 AM
khohi khohi is offline
Member
 
Join Date: Dec 2015
Posts: 10
Default Re: Q4) h(x) = ax

Great

حب الشباب
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:28 AM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.