You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
myline = numpy.linspace(0, 6, 100) # myline = numpy.linspace(start, stop, number of elements in the array)
#r2
#It measures the relationship between the x axis and the y axis, and the value ranges from 0 to 1, where 0 means no relationship, and 1 means totally related.
r2 = r2_score(train_y, mymodel(train_x))
#we can also check r2 for test data as following
#r2 = r2_score(train_y, mymodel(test_x))
plt.scatter(train_x, train_y)
plt.plot(myline, mymodel(myline))
plt.show()
print(r2)
#now as model is trained and tested properly now we can predict values