Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support holidays on non-UTC time zones
Prior to this commit, when determining whether a given holiday's features should be 0 or 1 for a given timestamp, we checked whether each _day_ included in the holiday's lower-upper windows included the timestamp, and set the value to 1 if so. However, when rounding the holiday's timestamps down to 'day' we assumed that the holiday started and ended at midnight UTC, which won't be the case for certain holidays (i.e. anything outside of UTC). This commit does three things: 1. adds the 'Holiday::with_utc_offset()' method which allows a holiday to use non-UTC-aligned days when its timestamps are being floored 2. rather than adding a separate feature for each time a holiday's lower/upper window are found to contain a timestamp, reuse the same feature for each offset, which is what the Python Prophet implementation does. Really this part should be moved to a separate bugfix PR... 3. switches the lower and upper windows to be u32 instead of i32, to reflect the fact that they should never really be negative (it is quite confusing that the original Prophet expects lower windows to always be negative and upper windows always positive).
- Loading branch information