Skip to content

Instantly share code, notes, and snippets.

@grohith327
Created May 27, 2018 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grohith327/0c65438acb7f43968e2b88d6f4cc636b to your computer and use it in GitHub Desktop.
Save grohith327/0c65438acb7f43968e2b88d6f4cc636b to your computer and use it in GitHub Desktop.
import matplotlib.pyplot as plt
y_prediction = a_0 + a_1 * x_test
print('R2 Score:',r2_score(y_test,y_prediction))
y_plot = []
for i in range(100):
y_plot.append(a_0 + a_1 * i)
plt.figure(figsize=(10,10))
plt.scatter(x_test,y_test,color='red',label='GT')
plt.plot(range(len(y_plot)),y_plot,color='black',label = 'pred')
plt.legend()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment