Implemented Dataset ClassΒΆ
Here we introduce the functions of several dataset classes that have been implemented.
AbstractDatasetBase class for all dataset classes. Note that this is an abstract class and can not be used directly.
TrajectoryDatasetBase class for all trajectory location prediction tasks. The raw trajectory records will be cut according to the set
window_sizeandcut_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_encoderparameter to extract the features of the trajectory and generate model input.TrafficStateDatasetOne 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_windowis used to predict the data corresponding tooutput_window. The Batch object generated by this class contains two keys, oneXand oney. Hereinput_windowandoutput_windoware parameters for data, see here for details.TrafficStateCPTDatasetAnother 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_trendis 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_trendare parameters for data, see here for details.TrafficStatePointDatasetA class inherited
TrafficStateDatasetfor 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.TrafficStateGridDatasetA class inherited
TrafficStateDatasetfor 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.TrafficStateOdDatasetA class inherited
TrafficStateDatasetfor 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.TrafficStateGridOdDatasetA class inherited
TrafficStateDatasetfor 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.MapMatchingDatasetBase class for all map matching tasks. This class generates a dictionary which contains 3 keys:
rd_nwk,trajectoryandroute, representing road network, trajectory of GPS samples and ground truth respectively. ifdelta_time=Trueis set,trajectorywill include atimecolumn indicating the reading of the seconds.delta_timeis a parameters for dataset, see here for details. see here for introduction of standard data input.ETADatasetBase class for all estimated time of arrival (ETA) tasks. Function
_load_dynawill load the trajectory information. Function_encode_trajwill call the corresponding trajectory spatio-temporal feature encoder according to the parametereta_encoderto extract the features of the trajectory. The extracted features will be divided in training data, evaluation data and test data to generate model input.