Skip to main content
7 events
when toggle format what by license comment
May 23, 2014 at 16:04 comment added user2567857 I wanted to upvote your answer but it needs 15 reputation, which I don't have yet. Thanks for your explanation.
May 23, 2014 at 14:30 comment added pedrofigueira You should not worry to much about that column of ones. That is just one way of representing the intercept. In python's scikit linear regression (scikit-learn.org/stable/modules/generated/…) you never specify that column, i.e., you never provide it as an input. I would advise you to see how to input the data on a given regression algorithm once you understood the principles of the method. You might find it easier that you thought.
May 23, 2014 at 14:26 comment added CloseToC Yes. If you have n observations, all n rows of the first column of X are 1. To predict the first observation, y_1, you calculate a+b1*x_1+b2*x_2 etc.. a, b1, b2 etc is what the vector (X'X)^-1 X'Y gives you. The first row in that vector is a, the second b1, and so on
May 23, 2014 at 14:20 comment added user2567857 Please see my edited answer, where I have edited of what I understood from the answers, as none of the answers tells me explicitly the values of X and Y. Did I understood right that all the first column of X matrix will be 1?
May 23, 2014 at 14:17 comment added CloseToC Doing so implicitly sets a, the intercept, to be 0. For y=a+bx, that forces the line to go through the origin and will also change b. It's the same in higher dimensions. It's almost always a bad idea to omit the intercept.
May 23, 2014 at 14:12 comment added user2567857 So, why do I need to take that column having all the values as 1? What if I leave that column and simply put the x values in my X matrix?
May 23, 2014 at 14:08 history answered CloseToC CC BY-SA 3.0