Last answered:

31 Mar 2020

Posted on:

30 Mar 2020

0

at lessonMaking Predictions with the Linear Regression

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 answers ( 0 marked as helpful)
Instructor
Posted on:

31 Mar 2020

0
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

Submit an answer