LFD Book Forum  

Go Back   LFD Book Forum > Book Feedback - Learning From Data > Chapter 3 - The Linear Model

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2012, 01:44 PM
tcristo tcristo is offline
Member
 
Join Date: Apr 2012
Posts: 23
Default Linear Regression and x0

For our linear regression implementation, do we include x0 in as part of our original X matrix? If we do, that means our original vector X=(x0, x1, x2) would then be transposed to XT=(x2, x1, x0).
Reply With Quote
  #2  
Old 04-14-2012, 01:48 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Linear Regression and x0

Quote:
Originally Posted by tcristo View Post
For our linear regression implementation, do we include x0 in as part of our original X matrix? If we do, that means our original vector X=(x0, x1, x2) would then be transposed to XT=(x2, x1, x0).
Transposition changes column to row and vice versa, but not the order of the elements within the column/row.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 04-14-2012, 02:01 PM
tcristo tcristo is offline
Member
 
Join Date: Apr 2012
Posts: 23
Default Re: Linear Regression and x0

Quote:
Originally Posted by yaser View Post
Transposition changes column to row and vice versa, but not the order of the elements within the column/row.
That makes more sense to me! So I assume we are including our constant (x0) in our matrix since we want the final results to provide three weight values?
Reply With Quote
  #4  
Old 04-14-2012, 10:17 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Linear Regression and x0

Quote:
Originally Posted by tcristo View Post
That makes more sense to me! So I assume we are including our constant (x0) in our matrix since we want the final results to provide three weight values?
Exactly.

In the mathematical formulation, x_0=1 is an integral part of {\bf x} and w_0 is an integral part of {\bf w}.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #5  
Old 04-15-2012, 09:20 AM
mathprof mathprof is offline
Invited Guest
 
Join Date: Apr 2012
Location: Bakersfield, California
Posts: 36
Default Re: Linear Regression and x0

Without x0=1, our line (or hyperplane) would be constrained to go through the origin, which would very rarely be useful.
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:36 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.