Setting interception for trendline?

Thank you for the great material.

In the scatter plot demo lesson, the trendline for median_sale_price vs median_pending_sqft is recognized as y = mx + b.

However, since zero square feet should equal zero dollars, would it be more appropriate to set the intercept to zero, making the model y = mx?

cheers

Unless you have training data for that condition, you should ignore it.

Are you certain this assumption is correct? What about the value of the property itself?

Do not manually set the bias or weights. These are the free variables that the model adapts to minimize the cost.

Hello, @jacko99,

Let’s look at the graph together

I would not set the intercept to zero, not because it does not make sense that zero area worths zero dollar, but because I don’t think the linear relation holds all the way to zero area. Take apples as an example, we may get a better deal if we buy more, which means the relation between price and number of apples is not always just one straight line.

The apple case may be simple because the supply is assumed not a problem, but home can be different as extreme sizes may be too scarce for a low price. Even if supply is not a problem, just like apple, the linear relationship may simply just not hold for home in the whole area range.

Therefore, for the data in the screenshot above, my interpretation would be that I am assuming the relation between roughly 1300 to 2000 sq. ft. to be linear (it is also a good idea to restrict our model assumption to the data we have), and then I fit the line, therefore, I would not set the intercept to 0 because 0 sq. ft. is not what I am considering for here.

Cheers,
Raymond

Right, the model needs to optimize those variables itself. Thanks for the reminder.

Thank you so much for breaking this down. I had been focused on the theoretical “zero for zero” idea, but your explanation completely shifted my perspective.
I appreciate you taking the time to explain the practical side of data modeling so clearly.
Cheers!

1 Like

You are welcome, @jacko99 :smiley:

Cheers,
Raymond