0
$\begingroup$

enter image description here

This is to find thetha which will give minimum cost function. Why is the x0 column required? why cant we assign size as x0? why do we need the feature count to be n+1?

$\endgroup$

3 Answers 3

2
$\begingroup$

Consider the 1-D equivalent of the table you have provided. In this case, you have one input x and one output y (see figure). If you try to fit the data points with y=mx equation, you can not fit the data successfully. You need an equation like y=mx+c to have a good fit. y=mx will be a good fit only if the line goes through the origin.

Now you can look at

y=mx+c

as

y = m * x + c * 1

y = m * X1 + c * X0

y = W1 * X1 + W0 * X0

I hope the figures below will clarify why we need the intercept term X0 and its weight W0=c. enter image description here

enter image description here

$\endgroup$
1
$\begingroup$

Adding extra column x0 is a design choice.
mathematically: if you multiply w by x you get a single value (simply dot product), thus you need to encode another learnable parameter independent of x like a prior (belief), you end up doing w.x + 1*(bias)

$\endgroup$
1
$\begingroup$

The column x0 is a constant that is used to fit the intercept. Excluding that will give you the coefficients but without an intercept.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.