数据集地址:PVCGN/data at master · liuwj2000/PVCGN (github.com)
import pickle
import os
os.chdir('data/shanghai/')
f=open('train.pkl','rb')
a=pickle.load(f)
a
字符串5:30表示从5:15到5:30的时间间隔
a['x'].shape,a['y'].shape
#((4092, 4, 288, 2), (4092, 4, 288, 2))
a['xtime'].shape,a['ytime'].shape
#((4092, 4), (4092, 4))
import pickle
f=open('val.pkl','rb')
a=pickle.load(f)
a['x'].shape,a['y'].shape,a['xtime'].shape,a['ytime'].shape
#((594, 4, 288, 2), (594, 4, 288, 2), (594, 4), (594, 4))
import pickle
f=open('test.pkl','rb')
a=pickle.load(f)
a['x'].shape,a['y'].shape,a['xtime'].shape,a['ytime'].shape
#((1386, 4, 288, 2), (1386, 4, 288, 2), (1386, 4), (1386, 4))
import pickle
f=open('graph_sh_conn.pkl','rb')
a=pickle.load(f)
a,a.shape
'''
(array([[1., 1., 0., ..., 0., 0., 0.],
[1., 1., 1., ..., 0., 0., 0.],
[0., 1., 1., ..., 0., 0., 0.],
...,
[0., 0., 0., ..., 1., 1., 0.],
[0., 0., 0., ..., 1., 1., 1.],
[0., 0., 0., ..., 0., 1., 1.]]),
(288, 288))
'''
import pickle
f=open('graph_sh_cor.pkl','rb')
a=pickle.load(f)
a,a.shape
'''
(array([[0. , 0.01539433, 0.02738432, ..., 0. , 0. ,
0. ],
[0. , 0. , 0. , ..., 0. , 0. ,
0. ],
[0. , 0.01502989, 0. , ..., 0. , 0. ,
0. ],
...,
[0. , 0. , 0. , ..., 0.01615014, 0. ,
0.03536008],
[0. , 0. , 0. , ..., 0. , 0.0092369 ,
0. ],
[0. , 0. , 0. , ..., 0.03341621, 0.00712248,
0.01228689]]),
(288, 288))
'''
import pickle
f=open('graph_sh_sml.pkl','rb')
a=pickle.load(f)
a,a.shape
'''
(array([[1. , 0. , 0.13627907, ..., 0. , 0. ,
0. ],
[0. , 1. , 0. , ..., 0. , 0. ,
0. ],
[0.13627907, 0. , 1. , ..., 0. , 0. ,
0. ],
...,
[0. , 0. , 0. , ..., 1. , 0. ,
0. ],
[0. , 0. , 0. , ..., 0. , 1. ,
0. ],
[0. , 0. , 0. , ..., 0. , 0. ,
1. ]]),
(288, 288))
'''