我正在处理需求预测问题,在此问题中,我试图预测未来1个月多个商店的需求量。我正在尝试建立LSTM模型以预测每个商店所需的数量。
对于LSTM,我能够以3-D格式重塑数据,时间步长= 30(使用最近30天来预测第二天的输出),功能= 4
在下面的代码中,我共享了validation_data输入,我在其中使用3月月份的数据来预测将在model.fit中使用的所有50个商店ID的4月
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)]