Last active
April 17, 2024 04:13
-
-
Save jimwhite/cdd47f46821d1b7fd4548804c4cbc997 to your computer and use it in GitHub Desktop.
Plot all the models on one chart that just covers the predicted dates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plt.figure(figsize=(16, 8)) | |
stock_data_subset = stock_data[stock_data['ds'].isin(rescaled_predictions_df['ds'])] | |
plt.plot(stock_data_subset['ds'], stock_data_subset['y'], label='Actual Price', linewidth=3, color='blue') | |
# ['iTransformer', 'TSMixer', 'NHITS', 'PatchTST'] | |
plt.plot(rescaled_predictions_df['ds'], rescaled_predictions_df['iTransformer'], | |
label='iTransformer', linewidth=1, color='purple') | |
plt.plot(rescaled_predictions_df['ds'], rescaled_predictions_df['TSMixer'], | |
label='TSMixer', linewidth=1, color='green') | |
plt.plot(rescaled_predictions_df['ds'], rescaled_predictions_df['NHITS'], | |
label='NHITS', linewidth=1, color='red') | |
plt.plot(rescaled_predictions_df['ds'], rescaled_predictions_df['PatchTST'], | |
label='PatchTST', linewidth=1, color='brown') | |
plt.xlabel('Date', fontsize=14) | |
plt.ylabel('Price', fontsize=14) | |
plt.title(f'{ticker} Stock Price Predictions', fontsize=16) | |
plt.grid(axis='y') | |
plt.legend(fontsize=12) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment