0
$\begingroup$

I have a dataset consisting of the weekly sales of 3,000 stores over the past 5 years, and have constructed a LSTM to forecast the next year of sales, given the previous year of sales. At each timestep $t$, the features are the previous 52 observations.

$$X_{t-52:t} \rightarrow LSTM \rightarrow \hat{X}_{t:t+52}$$

The LSTM is trained using a rolling window over the timeseries, starting with the input of $X_{0:52}$ and output of $X_{52:104}$ and ending with the input of $X_{T-52:T}$ and output of $\hat{X}_{T:T+52}$, so that the cell state is built up over the whole series to eventually forecast $\hat{X}_{T:T+52}$.

However, I also have a dataset $E$ of events for which I know the dates both past and future. These are events which may affect sales such as Christmas or Easter. It is encoded as a binary vector of length n_events=30 for each week $t$. I'm wondering what the best way would be to include this data as my forecast. Ideally, I want the NN to be able to learn the uplift or decrease associated with each event and use this information in its forecast. It is more complex than seasonality because some events such as Easter move around in a way that cannot be learned by the NN.

However, the events for the next year at any timestep $t$ is a tensor of shape [n_events, forecasting_horizon] = [36, 52] with 1972 individual "features" and hence is too large to realistically include in the input to the LSTM. What other methods could I use to feed these features into the model in a way that would inform its forecast over the next 52 weeks?

$\endgroup$
1
  • $\begingroup$ Did you find a solution? $\endgroup$ Commented Sep 6, 2022 at 7:28

1 Answer 1

0
$\begingroup$

You might find this link helpful

https://machinelearningmastery.com/time-series-prediction-lstm-recurrent-neural-networks-python-keras/

$\endgroup$
1
  • $\begingroup$ This link does not address my question. It does not address the use of additional features in a LSTM. $\endgroup$ Commented Jul 1, 2020 at 12:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.