-
Notifications
You must be signed in to change notification settings - Fork 5
/
test_TaxiBJ.py
505 lines (456 loc) · 23.1 KB
/
test_TaxiBJ.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
# -*- coding:utf-8 -*-
import datetime
import numpy as np
from models.resnet_TaxiBj import stresnet_TaxiBJ
from models.STResNet_TaxiBJ import stresnet_TaxiBJ_2D
from models.LSTM_TaxiBJ import lstm_TaxiBJ
import config
import warnings
warnings.filterwarnings("ignore")
START_HOUR = 0 # 凌晨 [0,1,...,23]外部信息
START_MINUTE = 0 # 第一个分钟片 [0,1,2,3,4,5]外部信息
N_days = config.N_days # 用了多少天的数据(目前17个工作日)
N_hours = config.N_hours
N_time_slice = config.N_time_slice # 1小时有6个时间片
N_station = config.N_station # 81个站点
map_height = 32
map_width = 32
N_flow = config.N_flow # 进站 & 出站
len_seq1 = config.len_seq1 # week时间序列长度为2
len_seq2 = config.len_seq2 # day时间序列长度为3
len_seq3 = config.len_seq3 # hour时间序列长度为5
nb_flow = config.nb_flow # 输入特征
def getTemporalInterval(timestamp):
timestamp = timestamp.replace('/', '-')
t = datetime.datetime.strptime(timestamp, '%Y-%m-%d %H:%M:%S')
weekday = t.weekday()
hour = t.hour
minute = t.minute
if 10 > minute >= 0:
segment = 0
elif 20 > minute >= 10:
segment = 1
elif 30 > minute >= 20:
segment = 2
elif 40 > minute >= 30:
segment = 3
elif 50 > minute >= 40:
segment = 4
else:
segment = 5
return weekday, hour, segment
# datetime, stations, status = [],[],[]
def getMetroFlow(datetime, stations, status):
# 地铁流量矩阵(24*6, 81, 2)
metro_flow_matrix = np.zeros((N_hours * N_time_slice, N_station, N_flow))
for i in range(len(datetime)):
w, h, s = getTemporalInterval(datetime[i])
station_id = stations[i]
state = status[i]
idx = h * 6 + s
metro_flow_matrix[idx, station_id, state] += 1
# /100 近似归一化
metro_flow_matrix /= 100
return metro_flow_matrix
def mae_compute(truth, predict):
# 后处理计算
truth = truth
truth = np.around(truth, 0)
# eval_01_25.py生成的文件,替换这里的文件名字,这方面可以再想一想后处理算法来提升精度
predict = predict * 30
predict = np.around(predict, 0)
# predict[(predict < 10) & (predict > 0)] =2
predict[predict < 3] = 0 # 玄学2
# 看第一个loss(mae)
loss_matrix = np.abs(truth - predict)
mae = loss_matrix.sum() / (truth.size)
# 看第二个loss(mape)
# truth[np.where(truth == 0)] = 0.0001
loss_matrix2 = np.clip(loss_matrix, 0.001, 3000) / np.clip(truth, 0.001, 3000)
mape = loss_matrix2.sum() / (truth.size)
# loss_matrix1 = np.abs(truth - predict1)
# loss1 = loss_matrix1.sum()/(144*81*2)
# loss_matrix2 = np.abs(truth - predict2)
# loss2 = loss_matrix2.sum()/(144*81*2)
# print(truth)
mdae = np.median(np.abs(truth - predict))
print(mae, mape, mdae)
return mae, mape
def test_stresnet_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day):
warnings.filterwarnings("ignore")
# ——————————————————————————————组织数据———————————————————————————————
# 由于>25的数量极其少,将>25的值全都默认为25
# sub_Metro_Flow2[np.where(sub_Metro_Flow2 > 25)] = 25
out_maximum = 30 # 估摸出站的最大阈值 因为在getMetroFlow函数中已经除了100近似归一化了
data_week /= out_maximum
data_day /= out_maximum
# ——————————————————————建立模型———————————————————————————
model = stresnet_TaxiBJ(c_conf=(len_seq3, N_flow, N_station), p_conf=(len_seq2, N_flow, N_station),
t_conf=(len_seq1, N_flow, N_station), nb_residual_unit=4) # 对应修改这里,和训练阶段保持一致
model.load_weights('./log/stresnet/TaxiBJ/191-0.43335346.hdf5')
# model.load_weights(config.model_weights_stresnet)
# model.summary()
xr_test = np.zeros([1, N_station, len_seq3 * N_flow])
xp_test = np.zeros([1, N_station, len_seq2 * N_flow])
xt_test = np.zeros([1, N_station, len_seq1 * N_flow])
sum_of_predictions = 24 * 2 - config.len_seq3
for i in range(sum_of_predictions):
# if i + 4 + config.len_seq1 >= len(data_week) or i + 3 + config.len_seq2 >= len(
# data_day) or i + config.len_seq3 >= len(data_recent):
# break
t = data_week[
i + config.len_seq3 - config.len_seq1 + 1:i + config.len_seq3 - config.len_seq1 + 1 + config.len_seq1, :,
:] # trend
p = data_day[
i + config.len_seq3 - config.len_seq2 + 1:i + config.len_seq3 - config.len_seq2 + 1 + config.len_seq2, :,
:] # period
r = data_recent[i:i + config.len_seq3, :, :] # recent
for j in range(len_seq3):
for k in range(2):
xr_test[0, :, j * 2 + k] = r[j, :, k]
for j in range(len_seq2):
for k in range(2):
xp_test[0, :, j * 2 + k] = p[j, :, k]
for j in range(len_seq1):
for k in range(2):
xt_test[0, :, j * 2 + k] = t[j, :, k]
# 对应修改了这里
ans = model.predict([xr_test, xp_test, xt_test])
data_recent[i + config.len_seq3, :, :] = ans
np.save(predict_day, data_recent)
truth = np.load(truth_day)[:, 0:81, :]
predict = np.load(predict_day)
mae_compute(truth, predict)
print('Testing Done...')
def test_LSTM_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day):
warnings.filterwarnings("ignore")
# ——————————————————————————————组织数据———————————————————————————————
# 由于>25的数量极其少,将>25的值全都默认为25
# sub_Metro_Flow2[np.where(sub_Metro_Flow2 > 25)] = 25
out_maximum = 30 # 估摸出站的最大阈值 因为在getMetroFlow函数中已经除了100近似归一化了
data_week /= out_maximum
data_day /= out_maximum
# ——————————————————————建立模型———————————————————————————
model = lstm_TaxiBJ(c_conf=(len_seq3, N_flow, N_station), p_conf=(len_seq2, N_flow, N_station),
t_conf=(len_seq1, N_flow, N_station)) # 对应修改这里,和训练阶段保持一致
model.load_weights('./log/LSTM/TaxiBJ/100-0.51149772.hdf5')
# model.load_weights(config.model_weights_stresnet)
# model.summary()
xr_test = np.zeros([1, N_station, len_seq3 * N_flow])
xp_test = np.zeros([1, N_station, len_seq2 * N_flow])
xt_test = np.zeros([1, N_station, len_seq1 * N_flow])
sum_of_predictions = 24 * 2 - config.len_seq3
for i in range(sum_of_predictions):
# if i + 4 + config.len_seq1 >= len(data_week) or i + 3 + config.len_seq2 >= len(
# data_day) or i + config.len_seq3 >= len(data_recent):
# break
t = data_week[
i + config.len_seq3 - config.len_seq1 + 1:i + config.len_seq3 - config.len_seq1 + 1 + config.len_seq1, :,
:] # trend
p = data_day[
i + config.len_seq3 - config.len_seq2 + 1:i + config.len_seq3 - config.len_seq2 + 1 + config.len_seq2, :,
:] # period
r = data_recent[i:i + config.len_seq3, :, :] # recent
for j in range(len_seq3):
for k in range(2):
xr_test[0, :, j * 2 + k] = r[j, :, k]
for j in range(len_seq2):
for k in range(2):
xp_test[0, :, j * 2 + k] = p[j, :, k]
for j in range(len_seq1):
for k in range(2):
xt_test[0, :, j * 2 + k] = t[j, :, k]
# 对应修改了这里
ans = model.predict([xr_test, xp_test, xt_test])
data_recent[i + config.len_seq3, :, :] = ans
np.save(predict_day, data_recent)
truth = np.load(truth_day)[:, 0:81, :]
predict = np.load(predict_day)
mae_compute(truth, predict)
print('Testing Done...')
def test_stresnet_TaxiBJ_2D(data_week, data_day, data_recent, predict_day, truth_day):
warnings.filterwarnings("ignore")
# ——————————————————————————————组织数据———————————————————————————————
# 由于>25的数量极其少,将>25的值全都默认为25
# sub_Metro_Flow2[np.where(sub_Metro_Flow2 > 25)] = 25
out_maximum = 30 # 估摸出站的最大阈值 因为在getMetroFlow函数中已经除了100近似归一化了
data_week /= out_maximum
data_day /= out_maximum
# ——————————————————————建立模型———————————————————————————
model = stresnet_TaxiBJ_2D(c_conf=(len_seq3, nb_flow, map_height, map_width),
p_conf=(len_seq2, nb_flow, map_height, map_width),
t_conf=(len_seq1, nb_flow, map_height, map_width),
nb_residual_unit=4) # 这里的unit代表了大体的网络深度
model.load_weights('./log/stresnet/TaxiBJ_2D/180-0.45129254.hdf5')
# model.load_weights(config.model_weights_stresnet)
# model.summary()
xr_test = np.zeros([1, len_seq3 * N_flow, map_height, map_width]) # 1代表样本数
xp_test = np.zeros([1, len_seq2 * N_flow, map_height, map_width])
xt_test = np.zeros([1, len_seq1 * N_flow, map_height, map_width])
sum_of_predictions = 24 * 2 - config.len_seq3
for i in range(sum_of_predictions):
t = data_week[
i + config.len_seq3 - config.len_seq1 + 1:i + config.len_seq3 - config.len_seq1 + 1 + config.len_seq1, :,
:] # trend
p = data_day[
i + config.len_seq3 - config.len_seq2 + 1:i + config.len_seq3 - config.len_seq2 + 1 + config.len_seq2, :,
:] # period
r = data_recent[i:i + config.len_seq3, :, :] # recent
for j in range(len_seq3):
for k in range(2):
xr_test[0, j * 2 + k, :, :] = r[j, k, :, :]
for j in range(len_seq2):
for k in range(2):
xp_test[0, j * 2 + k, :, :] = p[j, k, :, :]
for j in range(len_seq1):
for k in range(2):
xt_test[0, j * 2 + k, :, :] = t[j, k, :, :]
# 对应修改了这里
ans = model.predict([xr_test, xp_test, xt_test])
data_recent[i + config.len_seq3, :, :] = ans
np.save(predict_day, data_recent)
truth = np.load(truth_day)
truth = truth.reshape([truth.shape[0], truth.shape[2], 32, 32])
predict = np.load(predict_day)
mae_compute(truth, predict)
print('Testing Done...')
if __name__ == '__main__':
warnings.filterwarnings("ignore")
# ################stresnet
# # -------------------------------------- test_TaxiBJ_0402day-start -------------------------------------- #
# # node_data
# print('test_TaxiBJ_0402day-start')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0401.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0326.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_day0402.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0402.npy'
# test_stresnet_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0402day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0403ay-start -------------------------------------- #
# # node_data
# print('test_TaxiBJ_0403day-start')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0402.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0327.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_day0403.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0403.npy'
# test_stresnet_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0405day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0404day-start -------------------------------------- #
# # node_dataa
# print('test_TaxiBJ_0404day-start ')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0403.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0328.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_day0404.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0404.npy'
# test_stresnet_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0404day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0405day-start -------------------------------------- #
# # node_data
# print('test_TaxiBJ_0405day-start')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0404.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0329.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_day0405.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0405.npy'
# test_stresnet_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0405day-end -------------------------------------- #
#
# ##############LSTM
# # -------------------------------------- test_TaxiBJ_0402day-start -------------------------------------- #
# # node_data
# print('test_LSTM_TaxiBJ_0402day-start')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0401.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0326.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_LSTM_day0402.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0402.npy'
# test_LSTM_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0402day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0403ay-start -------------------------------------- #
# # node_data
# print('test_LSTM_TaxiBJ_0403day-start')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0402.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0327.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_LSTM_day0403.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0403.npy'
# test_LSTM_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0405day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0404day-start -------------------------------------- #
# # node_data
# print('test_LSTM_TaxiBJ_0404day-start ')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0403.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0328.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_LSTM_day0404.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0404.npy'
# test_LSTM_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0404day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0405day-start -------------------------------------- #
# # node_data
# print('test_LSTM_TaxiBJ_0405day-start')
# data_day = np.load('./npy/test_data/taxibj_node_data_day0404.npy')[:, 0:81, :]
# data_week = np.load('./npy/test_data/taxibj_node_data_day0329.npy')[:, 0:81, :]
# data_recent = np.zeros([N_hours * 2, N_station, N_flow])
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_LSTM_day0405.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0405.npy'
# test_LSTM_TaxiBJ(data_week, data_day, data_recent, predict_day, truth_day)
#
# # -------------------------------------- test_TaxiBJ_0405day-end -------------------------------------- #
# #################Arima
# # -------------------------------------- test_TaxiBJ_0402day-start -------------------------------------- #
# # node_data
# print('test_Arima_TaxiBJ_0402day-start')
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_arima_TaxiBj_day0402.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0402.npy'
#
# truth = np.load(truth_day)[:, 0:81, :]
# predict = np.load(predict_day)
# mae_compute(truth, predict)
#
# # -------------------------------------- test_TaxiBJ_0402day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0403ay-start -------------------------------------- #
# # node_data
# print('test_Arima_TaxiBJ_0403day-start')
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_arima_TaxiBj_day0403.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0403.npy'
# truth = np.load(truth_day)[:, 0:81, :]
# predict = np.load(predict_day)
# mae_compute(truth, predict)
#
# # -------------------------------------- test_TaxiBJ_0405day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0404day-start -------------------------------------- #
# # node_data
# print('test_Arima_TaxiBJ_0404day-start ')
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_arima_TaxiBj_day0404.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0404.npy'
# truth = np.load(truth_day)[:, 0:81, :]
# predict = np.load(predict_day)
# mae_compute(truth, predict)
#
# # -------------------------------------- test_TaxiBJ_0404day-end -------------------------------------- #
# # -------------------------------------- test_TaxiBJ_0405day-start -------------------------------------- #
# # node_data
# print('test_Arima_TaxiBJ_0405day-start')
#
# # 预测文件
# predict_day = './npy/mae_compare/predict_arima_TaxiBj_day0405.npy'
#
# # 真实文件
# truth_day = './npy/test_data/taxibj_node_data_day0405.npy'
# truth = np.load(truth_day)[:, 0:81, :]
# predict = np.load(predict_day)
# mae_compute(truth, predict)
#
# # -------------------------------------- test_TaxiBJ_0405day-end -------------------------------------- #
###############stresnet_taxibj_2D
# -------------------------------------- test_TaxiBJ_2D_0402day-start -------------------------------------- #
# node_data
print('test_TaxiBJ_2D_0402day-start')
data_day = np.load('./npy/test_data/taxibj_node_data_day0401.npy')
data_day = data_day.reshape([data_day.shape[0], data_day.shape[2], 32, 32])
data_week = np.load('./npy/test_data/taxibj_node_data_day0326.npy')
data_week = data_week.reshape([data_week.shape[0], data_week.shape[2], 32, 32])
data_recent = np.zeros([N_hours * 2, N_flow, map_height, map_width])
# 预测文件
predict_day = './npy/mae_compare/predict_taxibj_2D_day0402.npy'
# 真实文件
truth_day = './npy/test_data/taxibj_node_data_day0402.npy'
test_stresnet_TaxiBJ_2D(data_week, data_day, data_recent, predict_day, truth_day)
# -------------------------------------- test_TaxiBJ_2D_0402day-end -------------------------------------- #
# -------------------------------------- test_TaxiBJ_2D_0403ay-start -------------------------------------- #
# node_data
print('test_TaxiBJ_2D_0403day-start')
data_day = np.load('./npy/test_data/taxibj_node_data_day0402.npy')
data_day = data_day.reshape([data_day.shape[0], data_day.shape[2], 32, 32])
data_week = np.load('./npy/test_data/taxibj_node_data_day0327.npy')
data_week = data_week.reshape([data_week.shape[0], data_week.shape[2], 32, 32])
data_recent = np.zeros([N_hours * 2, N_flow, map_height, map_width])
# 预测文件
predict_day = './npy/mae_compare/predict_taxibj_2D_day0403.npy'
# 真实文件
truth_day = './npy/test_data/taxibj_node_data_day0403.npy'
test_stresnet_TaxiBJ_2D(data_week, data_day, data_recent, predict_day, truth_day)
# -------------------------------------- test_TaxiBJ_2D_0405day-end -------------------------------------- #
# -------------------------------------- test_TaxiBJ_2D_0404day-start -------------------------------------- #
# node_data
print('test_TaxiBJ_2D_0404day-start ')
data_day = np.load('./npy/test_data/taxibj_node_data_day0403.npy')
data_day = data_day.reshape([data_day.shape[0], data_day.shape[2], 32, 32])
data_week = np.load('./npy/test_data/taxibj_node_data_day0328.npy')
data_week = data_week.reshape([data_week.shape[0], data_week.shape[2], 32, 32])
data_recent = np.zeros([N_hours * 2, N_flow, map_height, map_width])
# 预测文件
predict_day = './npy/mae_compare/predict_taxibj_2D_day0404.npy'
# 真实文件
truth_day = './npy/test_data/taxibj_node_data_day0404.npy'
test_stresnet_TaxiBJ_2D(data_week, data_day, data_recent, predict_day, truth_day)
# -------------------------------------- test_TaxiBJ_2D_0404day-end -------------------------------------- #
# -------------------------------------- test_TaxiBJ_2D_0405day-start -------------------------------------- #
# node_data
print('test_TaxiBJ_2D_0405day-start')
data_day = np.load('./npy/test_data/taxibj_node_data_day0404.npy')
data_day = data_day.reshape([data_day.shape[0], data_day.shape[2], 32, 32])
data_week = np.load('./npy/test_data/taxibj_node_data_day0329.npy')
data_week = data_week.reshape([data_week.shape[0], data_week.shape[2], 32, 32])
data_recent = np.zeros([N_hours * 2, N_flow, map_height, map_width])
# 预测文件
predict_day = './npy/mae_compare/predict_taxibj_2D_day0405.npy'
# 真实文件
truth_day = './npy/test_data/taxibj_node_data_day0405.npy'
test_stresnet_TaxiBJ_2D(data_week, data_day, data_recent, predict_day, truth_day)
# -------------------------------------- test_TaxiBJ_2D_0405day-end -------------------------------------- #