多元多元输入数据LSTM

时间:2019-07-17 02:40:52

标签: time-series lstm recurrent-neural-network

我正在处理需求预测问题,在此问题中,我试图预测未来1个月多个商店的需求量。我正在尝试建立LSTM模型以预测每个商店所需的数量。

对于LSTM,我能够以3-D格式重塑数据,时间步长= 30(使用最近30天来预测第二天的输出),功能= 4

在下面的代码中,我共享了validation_data输入,我在其中使用3月月份的数据来预测将在model.fit中使用的所有50个商店ID的4月

  • validation_data
X_test.shape 
(1500,4)

#After Transforming 

X_test.shape 
(1470,30,4)
  • 最终验证数据
X_test.shape 
(1470, 30, 53)  ##( Mar Data for 50 Store IDs)

y_test.shape 
(1470,)        ##( Apr Data for 50 Store IDs)

X_test,y_test

ID-1 Input =[[1st Mar Data ID-1 (4 features),     Output = [1st Apr ID-1]
              2nd Mar Data ID-1 (4 features)
              ....
              30 Mar Data ID-1] (4features)]

ID-1 Input =[[2nd Mar Data ID-1 (4 features),     Output = [2nd Apr ID-1]
              3rd Mar Data ID-1 (4 features)
              ....
              1 Mar Data ID-2 (4 features)]]
....
....
....

ID-1 Input =[[30th Mar Data ID-1 (4 features),     Output = [30th Apr ID-1]
              1st Mar Data ID-2 (4 features)
              ....
              29th Mar Data ID-2 (4 features)]]
....
....
....

ID-50 Input =[[1st Mar Data ID-50 (4 features),     Output = [1st Apr ID-50]
              2nd Mar Data ID-50 (4 features)
              ....
              30 Mar Data ID-50] (4 features)]
  1. 上述输入验证数据是否正确使用?它不会根据已排序的ID更改结果吗?
  2. 我正在放松对ID-50的实际预测(y_test形状: 1470),如何避免这个问题?
  3. 进行实际预测时,我将递归使用 预测作为我的下一个预测的输入,是否有     更好/另一种方式?

0 个答案:

没有答案
相关问题