How do I use number of hours as index in timeseries forecasting?
I have a dataset that has number of hours (consecutive value) and total sales in that 1 hour in my dataset. See below for head of the dataset:
t sales
--------------
23 172.3676
24 176.3456
25 166.9039
26 153.9990
27 167.9585
I want to forecast the sales for the next 10 hours. I also set column t as the index. However, when I try to get the seasonal decomposition, it shows an error:
result = seasonal_decompose(train['sales'].dropna(), model='additive', freq =12)
result.plot()
plt.show()
TypeError:seasonal_decompose() got an unexpected keyword argument 'freq'
How do I handle the number of hours in a time series model? Do I need to convert it to a different format before using it as the index? Also, the sales column is continuous numeric value, do I need to round it off?
Thanks in advance!
Topic forecasting statsmodels time-series python
Category Data Science