Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. # Plot to visualise
  2. import matplotlib.pyplot as plt
  3.  
  4. def PlotResult(y_train, y_test, y_train_predict, y_test_predict, test_len, name):
  5.  
  6. #Visualise
  7. plt.figure(figsize=(12, 5))
  8. plt.plot(y_train_predict,color='red')
  9.  
  10. plt.plot(range(train_len, train_len+len(y_test)),
  11. y_test_predict,
  12. label='Predicted average price',
  13. color='red',linestyle = '--')
  14.  
  15. plt.plot(np.array((y_train).append(y_test)),
  16. label='Actual average price',
  17. color='green')
  18.  
  19. plt.axvspan(len(y_train), len(y_train)+len(y_test),
  20. alpha=0.3, color='lightgrey')
  21.  
  22. plt.grid(True)
  23. plt.axis('tight')
  24. plt.legend(loc="best")
  25. plt.title('Predicting the mean BTC price with {}'.format(name))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement