Implemented Dataset ClassΒΆ
Here we introduce the functions of several dataset classes that have been implemented.
AbstractDataset
Base class for all dataset classes. Note that this is an abstract class and can not be used directly.
TrajectoryDataset
Base class for all trajectory location prediction tasks. The raw trajectory records will be cut according to the set
window_size
andcut_method
, which means the months-long trajectory in the raw data set will be cut into sub-trajectories that meet the single travel time/distance length. After the cutting is completed, the corresponding trajectory spatiotemporal feature encoder will be called according to the settraj_encoder
parameter to extract the features of the trajectory and generate model input.TrafficStateDataset
One of base class for all traffic state prediction tasks. Note that this is an abstract class and cannot be used directly. By default, the data of
input_window
is used to predict the data corresponding tooutput_window
. The Batch object generated by this class contains two keys, oneX
and oney
. Hereinput_window
andoutput_window
are parameters for data, see here for details.TrafficStateCPTDataset
Another base class for all traffic state prediction tasks. Note that this is an abstract class and cannot be used directly. Part of the traffic prediction model realizes prediction by modeling the closeness/period/trend. By default, the data of
len_closeness
/len_period
/len_trend
is used to predict the data at the current moment(a single-step forecast). The Batch object generated by this class contains 4 keys:X
,y
,X_ext
,y_ext
. Herelen_closeness
/len_period
/len_trend
are parameters for data, see here for details.TrafficStatePointDataset
A class inherited
TrafficStateDataset
for traffic state prediction. The dataset is used for point-based/segment-based/region-based dataset as long as the spatial dimension of this data set is 1-dimensional. The shape of tensor in the Batch object generated by this class is 3-dimensional, namelyspace_dim, time_dim, feature_dim
.TrafficStateGridDataset
A class inherited
TrafficStateDataset
for traffic state prediction. The dataset is used for grid-based dataset. The shape of tensor in the Batch object generated by this class is 3-dimensional or 4-dimensional depends on parameteruse_row_column
. If setuse_row_column=True
, then the 4 dimensions aregrid_row_dim, grid_column_dim, time_dim, feature_dim
. Otherwise, the 3 dimensions arespace_dim, time_dim, feature_dim
, in this case the grid is renumbered in one dimension.TrafficStateOdDataset
A class inherited
TrafficStateDataset
for traffic state prediction. The dataset is used for od-based dataset, which means origin and destination. The shape of tensor in the Batch object generated by this class is 4-dimensional, namelyorigin_dim, destination_dim, time_dim, feature_dim
.TrafficStateGridOdDataset
A class inherited
TrafficStateDataset
for traffic state prediction. The dataset is used for grid-od-based dataset. The shape of tensor in the Batch object generated by this class is 4-dimensional or 6-dimensional depends on parameteruse_row_column
. If setuse_row_column=True
, then the 6 dimensions areorigin_grid_row_dim, origin_grid_column_dim, destination_grid_row_dim, destination_grid_column_dim, time_dim, feature_dim
. Otherwise, the 4 dimensions areorigin_dim, destination_dim, time_dim, feature_dim
, in this case the grid is renumbered in one dimension.MapMatchingDataset
Base class for all map matching tasks. This class generates a dictionary which contains 3 keys:
rd_nwk
,trajectory
androute
, representing road network, trajectory of GPS samples and ground truth respectively. ifdelta_time=True
is set,trajectory
will include atime
column indicating the reading of the seconds.delta_time
is a parameters for dataset, see here for details. see here for introduction of standard data input.ETADataset
Base class for all estimated time of arrival (ETA) tasks. Function
_load_dyna
will load the trajectory information. Function_encode_traj
will call the corresponding trajectory spatio-temporal feature encoder according to the parametereta_encoder
to extract the features of the trajectory. The extracted features will be divided in training data, evaluation data and test data to generate model input.