zalandoresearch / pytorch-ts

PyTorch based Probabilistic Time Series forecasting framework based on GluonTS backend
MIT License
1.21k stars 190 forks source link

Issue with fourier time-series features at weekly frequency #41

Closed nsomabalint closed 3 years ago

nsomabalint commented 3 years ago

Hey!

My pandas version is 1.1.0. In pts/feature/fourier_date_feature.py on line 52, pandas.tseries.frequencies.to_offset is used to normalize frequency, but when the freq_str parameter is W this function produces the following:

offset = to_offset('W')
multiple, granularity = offset.n, offset.name

print(granularity)
# this prints 'W-SUN' which is equivalent to 'W'

Because of the assertion on line 66, W-SUN and thus the initial W is not accepted. Changing W to W-SUN in the features dictionary (or adding both) had fixed this issue for me.

Thanks for looking into this.

kashif commented 3 years ago

thanks @nsoma97 fixed!

nsomabalint commented 3 years ago

Awesome, thank you!