I’m trying to fit multiple linear regression model with a quantitive predictor (has multiple values). Now in this exercise it was a matter of plugging the values in the linear regression model and plotting it.
Whenever I try to do the same in my project, I get the following error:
sns.lmplot(x= 'children', y= 'charges', data=insurance, fit_reg= False) plt.plot(insurance.charges, model.params + model.params*0) plt.plot(insurance.charges, model.params + model.params*1) plt.show() ValueError: x and y must have same first dimension, but have shapes (1338,) and (1,)
I tried converting datatypes and it didn’t work. Any suggestions?