Chans

Untitled

Jan 11th, 2018
13,928
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. plt.figure(1)
  2. # Visualizing the Training set results
  3. ax = plt.subplot(211)
  4. plt.scatter(X_train, y_train, color='red')
  5. plt.plot(X_train, regressor.predict(X_train), color='blue')
  6. ax.set_title('Salary vs Experience (Training set)')
  7. plt.xlabel('Years of Experience')
  8. plt.ylabel('Salary')
  9.  
  10. # Visualizing the Test set results
  11. ax = plt.subplot(212)
  12. plt.scatter(X_test, y_test, color='red')
  13. plt.plot(X_train, regressor.predict(X_train), color='blue')
  14. ax.set_title('Salary vs Experience (Test set)')
  15. plt.xlabel('Years of Experience')
  16. plt.ylabel('Salary')
  17. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment