Fpppy section 12.1 MSTL code example suggestion #41
presmerats
started this conversation in
Error report
Replies: 1 comment
-
|
Thanks @presmerats for noticing that issue and providing a posible solution. We will take a close look and come back with an answer soon. Sorry that we did not answer before and PLEASE keep raising issues or suggestions in case you find more. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've been looking at the Section 12.1 of the Python version and the final forecast visualization in Figure 12.4 doesn't look quite right. It seems that the forecast is in another time scale, the five days of forecast data seem to be squashed inside an interval of 3.5 days.
If we compare to the same section on the R version of the book, the same visualization (now figure 12.3) shows the forecasted values placed in the correct dates with the same time scale as the original data (although the date range of the visualisation only shows the forecast of 3 days)
Here is a python code to solve the problem and create a visualization of the forecast that is in the same time scale as the data.
First I will post the way I loaded the data (so that you can check if this looks coherent to you).
Then I proceed to run the code for the MSTL model and its decomposition visualization that is indicated in the book. Copying it here for reference:
Then finally comes the code that forecasts 5 days of data and generates date times for them, that's the part that I suggest to be changed:
And this is the output obtained (sorry I couldn't get the ggplot color flavors):

I hope this helps to correct it. Thanks anyway
Beta Was this translation helpful? Give feedback.
All reactions