facebook / facebook/prophet

Daily seasonality with regular gaps in the time series

未關閉
#749 2 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
Python
星號
20.4k
分支
4.6k
平均合併
19 小時 52 分鐘
30 天內合併 PR
1

描述

I have been testing prophet with hourly sales data. The store is only open between 7 am and 5 pm each day. When reviewing the documentation it says if the the sub-daily data has constant missing values, then you should only predict future values that coincide with the sub-daily data that you have. So in my case that would be future values between 7 am and 5 pm. I totally get that. But I wanted to see the difference in performance if I added the missing hours each day and just assigned them $0 dollars in sales. Both of the models fit the trend/seasonality well, but what I am struggling to understand is the hourly impact on the model when I do not have the closed hours in the data.

Here is the model using 24 hours of the day with $0 assigned to closed hours.

![all hours model](https://user-images.githubusercontent.com/40872066/48924496-db788980-ef1d-11e8-8f0c-11d13ae6b028.JPG)

Here is the model using only the open hours (7 am to 5 pm):

![open hours model](https://user-images.githubusercontent.com/40872066/48924488-c4d23280-ef1d-11e8-8952-e947bd30d9c9.JPG)

In the following daily component images below, you can see the model using 24 hours of the day captures the daily trend as I would have expected, where the hours around lunch time add more, and the closed actually detract a little. This is what we expect the daily seasonality to be.

![all hours daily component](https://user-images.githubusercontent.com/40872066/48924586-a4ef3e80-ef1e-11e8-9b8a-742975c0aae6.JPG)

But when I only use the opening hours, the daily components comes out below, where the closed hours have a massive impact, but of course they are not being used to predict the future values. So my question is, why is the model applying so much to the trend during closed hours when it's got no data related to those hours?
![open hours daily component](https://user-images.githubusercontent.com/40872066/48924601-e1229f00-ef1e-11e8-8d93-31480fb7c1ad.JPG)

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。