codes on line 15 do not work
reg.predict(new_data) works fine, but the subsequent code on line 15 to add the predicted values back to the data frame does not. thanks.
Hey Christine,
Thank you for your question!
As the sklearn
library is changing with time, there have been some modifications to the predict() method and the input values it takes. This problem has been resolved in the following thread.
Hope this helps!
Kind regards,
365 Hristina
Thanks. I looked at the solution being linked, but still can't figure out the codes. My code: reg.predict(new_data) works, but the subsequent one to add the predicted values back to the dataframe does not.
new_data['Predicted_GPA'] = reg.predict(new_data)
Can you please help modify the above code? Thanks much!
Hey Christine,
Try out the implementation below:
Let me know if this worked for you!
Kind regards,
365 Hristina