The 365 Data Science team is proud to invite you to our own community forum. A very well built system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

at lessonMaking Predictions with the Linear Regression

at lessonMaking Predictions with the Linear Regression

0
Votes
1
Answer

why when i change the order of columns new_data=new_data[[‘const’,’SAT’,’Attendance’]]
to new_data=new_data[[‘Attendance”const’,’SAT’]]
the predicted value of GPA changes

1 Answer

365 Team
0
Votes

Hi Mustafa,
It is extremely important to know that when feeding the new data, it should be arranged in the exact same way as the train data.
Your algorithm expects the constant to be at the first place, then the first variable, then the second one, etc. When feeding new data, all coefficients (weights) are multiplied by the respective values. If they are arranged differently (wrongly), the result is different (wrong).
Best,
Iliya

×
LAST CHANCE
Ready to Learn Data Science?
50% OFF