I am new to machine learning and I am confused with what is the function of linear regression intercept parameter is doing.
When setting the parameter, fit_intercept=False
, I get the .coef
_ value as 287.986236, however, when setting fit_intercept=True
, I get the .coef
_ value as 225.81285046.
Why is there a difference? And I am not sure how to interpret the results and compare these values!
lm = LinearRegression(fit_intercept=False).fit(REStaten_[['GROSS_SQUARE_FEET']], REStaten_['SALE_PRICE'])
lm.coef_
# 287.986236
lm = LinearRegression(fit_intercept=True).fit(REStaten_[['GROSS_SQUARE_FEET']], REStaten_['SALE_PRICE'])
lm.coef_
# 225.81285046