I want to plot a linear regression by its coefficients and intercept. I’ve seen its code on Jupiter notebook .but I couldn’t understand a special part of that .
this is the code :
plt.scatter(train.ENGINESIZE, train.CO2EMISSION, color=’blue’)
plt.plot ( train_x, regr.coef_[0][0]*train_x +regr.intercept_[0], ‘-r’)
why it wouldn’t be like regr.coef_*train_x +regr.intercept_
New contributor
Aida is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.