def print_graph(X_all, X_test, y_all, y_pred1, y_pred2):
training_size = X_all.shape[0] - X_test.shape[0]
x_full_limit = np.linspace(1, X_all.shape[0], X_all.shape[0])
y_pred_limit = np.linspace(training_size+1, training_size + 1 + X_test.shape[0], X_test.shape[0])
plt.plot(x_full_limit, y_all, label='actual', color='b', linewidth=1)
plt.plot(y_pred_limit, y_pred1, '--', color='r', linewidth=2, label='prediction1')
plt.plot(y_pred_limit, y_pred2, '--', color='g', linewidth=2, label='prediction2')
plt.legend(loc=0)
plt.show()
评论列表
文章目录