I have a problem and I am not sure what is the prolem.
Here is my Pandas DataFrame :
I am trying to plot it with the follwoing python code:
ig, ax = plt.subplots(figsize=(12, 3))
plstm['y_inverse'].plot(ax=ax, label='Test', color = 'blue')
plstm['yhat_inverse'].plot(ax=ax, label='Predictions', color = 'crimson')
plt.title('LSTM Forecast', fontsize = 18)
plt.legend(fontsize = 12);
The issue is when I plot individual column, the y-axis is different, namely, y_test_inverse is from 0-50,but yhat_inverse is from approximately 20-30. This is so weird!!! I wanted to plot both columns to see if the prediction is close to the ground truth. As far as I am concerned, both columns have the same shape when plotting it out individually. Can anyone help me with it, please!
I have tried to reset y-axis like so:
plt.ylim([0,50])
but, it didn't change anything. I think I might need to rescale the yhat_inverse column. The problem is I don't know how.
Here is a reproducible example:
a = [22.49228808, 23.67596776, 25.23977312, 26.84448022, 28.81581532,
30.33304259, 30.33647936, 31.0066119 , 31.32509943, 29.50372721,
27.10255157, 25.2329266 , 19.34649399, 17.18931596, 14.64576531,
13.45902426, 14.84226619, 17.34210585, 21.55897865, 22.84701125]
b= [23.13694191, 23.27906036, 23.4411087 , 23.66352272, 23.92148399,
24.2199173 , 24.50629044, 24.60942459, 24.62063408, 24.66880989,
24.52558517, 24.11040497, 23.7087822 , 23.08251572, 22.49897194,
22.16906548, 22.03343964, 22.09576797, 22.44637871, 23.01521301]
d['Date'] = pd.date_range(start='2022-01-01 01:00:00', periods=len(a), freq='H')
d = pd.DataFrame({'a': a, 'b': b})
d.set_index('Date')