https://365datascience.com/dwqa-answer/answer-for-is-it-mandatory-to-use-statsmodel-add_constant-method-while-implementing-linear-regression-model-cant-be-directly-put-the-coef_-nd-intercept_-value-directly-in-the-equation-ymxb-als/ -
Hi Nishant,
This is a very good question.
First, we always need to add the constant. The reason for this is that it takes care of the bias in the data (a constant difference which is there for all observations).
Your idea involves adding a column of ones to the X, so that you can avoid ‘add_constant()’ right? Well, this is precisely the same as using the method. The two are equivalent and almost equally hard to implement.
It is your choice in the end.
Best,
The 365 Team
#365datascience #DataScience #data #science #365datascience #BigData #tutorial #infographic #career #salary #education #howto #scientist #engineer #course #engineer #MachineLearning #machine #learning #certificate #udemy
No comments:
Post a Comment