LFD Book Forum  

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

Reply
 
Thread Tools Display Modes
  #1  
Old 04-30-2013, 12:25 PM
barbacot barbacot is offline
Junior Member
 
Join Date: Apr 2013
Posts: 3
Default Linear regression with constraint on the hypothesis set

When applying the one-step equation for linear regression, the vector of weights is obtained directly with all its components.

What if we impose from the beginning a restriction on the form of the hypothesis, say h(x)=3+w1*x1, instead of the full linear form h(x)=w0+w1*x1? In other words, we want w0 to be 3, no matter what.

Is the one-step equation still applicable somehow?

To compare, if we were to apply the gradient descent with the same constraint, we could do it very easy, just by keeping w0 fixed at its initial value (3).
Reply With Quote
  #2  
Old 04-30-2013, 12:35 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,475
Default Re: Linear regression with constraint on the hypothesis set

Quote:
Originally Posted by barbacot View Post
When applying the one-step equation for linear regression, the vector of weights is obtained directly with all its components.

What if we impose from the beginning a restriction on the form of the hypothesis, say h(x)=3+w1*x1, instead of the full linear form h(x)=w0+w1*x1? In other words, we want w0 to be 3, no matter what.

Is the one-step equation still applicable somehow?

To compare, if we were to apply the gradient descent with the same constraint, we could do it very easy, just by keeping w0 fixed at its initial value (3).
You can transfer the fixed part to the other side of the equation, then solve for the remaining parameters only. In your example, it would be w_1x_1=y-3 solving for w_1 only (the matrix {\rm X} would be a column vector of x_1's).
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 05-04-2013, 03:22 AM
barbacot barbacot is offline
Junior Member
 
Join Date: Apr 2013
Posts: 3
Default Re: Linear regression with constraint on the hypothesis set

Thank you, sir, I think I finally got it. So if I want to pin down a number of M weights, I just move the constant M terms to the y vector (subtracting from it), and I am left with a matrix X with d+1-M columns (the column of ones may also be gone). The result will be a vector of d+1-M weights.
Reply With Quote
Reply

Tags
regression constraint

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 10:04 PM.


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.