I have a question about using LSTM model to predict sales. To build the model, I want to input the previous sales values(choose sample size of 30), and also the current(t) features such as whether on promotion, whether is a holiday etc. My current code:
def create_dataset(dataset, look_back=1):
dataX, dataY = [], []
for i in range(len(dataset)-look_back-1):
a = dataset[i:(i+look_back), 0]
dataX.append(a)
dataY.append(dataset[i + look_back, 0])
return np.array(dataX), np.array(dataY)
look_back = 30
trainX, trainY = create_dataset(train, look_back)
valX, valY = create_dataset(val, look_back)
# note: train and val dataset here only include sale values
trainX = np.reshape(trainX, (trainX.shape[0], 1, trainX.shape[1]))
valX = np.reshape(valX, (valX.shape[0], 1, valX.shape[1]))
Which I create n*30 datasets(30 columns). And then I apply into the keras LSTM model. But how can I also include the current features (not time sequence) as input into the model?