Open zhichenggeng opened 2 years ago
Thanks for the reproducible example!
This seems to be an issue when mixing Period
and Timestamp
columns. If I change the plotting of the true values, it works:
ts_entry[-prediction_length * 4:].to_timestamp().plot(ax=ax)
I don't know (yet) why this happens -- but at least there is a workaround.
I was thinking about having some more plot utilities to a) make generating these kind of plots easier and b) avoid issues like this one.
It works! Thanks for your help.
Looking forward to more generalized plotting tools.
@jaheba as a fix, would it make sense to bake .to_timestamp
in any utils (hopefully it’s a single place) we use to turn DataEntry
into pandas?
What's interesting is that inverting the order of plotting also solves the issue:
forecast_entry.plot(prediction_intervals=(50, 90), color="g")
ts_entry[-prediction_length * 4:].plot(ax=ax)
Description
The plot of median prediction is shifted to the left by one index, while 90% and 50% prediction interval plots are correct. Potential reason is that the data is resampled by week, which might cause some problem on the index.
To Reproduce
Error message or code output
Environment