# Examine the Prediction Error of Ride-Hailing Travel Demands with Various Ignored Sparse Demand Effects

Authors: Zhiju Chen; Kai Liu; Tao Feng
Journal: Journal of Advanced Transportation
 (2022)

---

## Abstract

The accurate short-term travel demand predictions of ride-hailing orders can promote the optimal dispatching of vehicles in space and time, which is the crucial issue to achieve sustainable development of such dynamic demand-responsive service. The sparse demands are always ignored in the previous models, and the uncertainties in the spatiotemporal distribution of the predictions induced by setting subjective thresholds are rarely explored. This paper attempts to fill this gap and examine the spatiotemporal sparsity effect on ride-hailing travel demand prediction by using Didi Chuxing order data recorded in Chengdu, China. To obtain the spatiotemporal characteristics of the travel demand, three hexagon-based deep learning models (H-CNN-LSTM, H-CNN-GRU, and H-ConvLSTM) are compared by setting various threshold values. The results show that the H-ConvLSTM model has better prediction performance than the others due to its ability to simultaneously capture spatiotemporal features, especially in areas with a high proportion of sparse demands. We found that increasing the minimum demand threshold to delete more sparse data improves the overall prediction accuracy to a certain extent, but the spatiotemporal coverage of the data is also significantly reduced. Results of this study could guide traffic operations in providing better travel services for different regions.


---

## Body

## 1. Introduction

Ride-hailing services achieve shared mobility between travel demand and idle supply via Internet matching. By effectively improving vehicle utilization, this energy-efficient mode of transportation reduces fuel consumption, traffic congestion, and vehicle emissions, which is conducive to urban sustainability [1–3]. Benefiting from the rapid development of information and communication technologies, the service platform has collected a large number of order data, which also provides strong support for the analysis of travel behavior, traffic management, and energy consumption [4, 5]. Compared with traditional taxi services, online booking effectively integrates the time and locational information between passengers and vehicles, which reduces the waiting time and improves the overall efficiency [6]. To meet the diversified and customized travel demand of residents in different urban areas, a variety of ride-hailing services have been constantly updated and evolved, which effectively alleviates the problems in traditional transport services, for example, taxi-hailing difficulty in rush hour and low service levels [7, 8]. However, due to the high heterogeneity of individuals’ travel requests in different times and spaces [9–11], the problem of mismatching between drivers and passengers is still common; for example, cruising drivers spend much time finding passengers, and travel requests cannot be responded on time during peak hours. Thus, accurate short-term prediction of ride-hailing travel demand is needed and timely to solve the mismatching problems.A large number of existing studies have explored the temporal and spatial patterns of travel demand in ride-hailing [12–15]. They usually focus on central urban areas where demand is high and omit or ignore the areas with sparse demands by setting a threshold of the minimum demand. Because the effects of the areas with sparse travel demand are relatively small, the treatment of the small travel requests does not influence the overall prediction performance of the models. Although private car ownership is abundant in cities [16], it possibly leads to a social equity issue in practice as passengers living in rural areas or less dense areas will have to face a lower level of services anyhow. Moreover, from a methodological point of view, the selection of the minimum demand threshold based on experience lacks a unified standard. More importantly, an improper setting of the minimum demand threshold may unavoidably increase the uncertainty of demand distribution and spatiotemporal sparsity of travel demand, which misleads the demand prediction and vehicle dispatch. A proper method that considers the sparse travel demand is needed. In particular, the effects of incorporating sparse travel requests into the overall demand prediction, which has been overlooked for a long time in the existing literature, need to be further investigated.Therefore, in this paper, we attempt to assess the effects of the sparsity difference of ride-hailing travel requests in different urban areas on travel demand prediction. We comparatively utilize three deep learning methods that have been proposed in the literature to verify the influence of the choice of minimum demand threshold on the accuracy of short-term travel demand prediction. To overcome the issues of square-based spatial partition, that is, two different kinds of adjacent neighbors between each square, side-connected and corner-connected, hexagon partition, which is considered to have a symmetric and equivalent distribution, is adopted. Specifically, three hybrid models that combine a convolutional neural network and long short-term memory (H-CNN-LSTM), convolutional neural network and gate recurrent unit (H-CNN-GRU), and hexagon partition and convolutional LSTM (H-ConvLSTM) are applied. The results of the models are evaluated using the big data from Didi Chuxing GAIA Initiative, an open data project of Didi company [17].The rest of this paper is organized as follows. The “Related Works” section briefly reviews the existing literature on traffic demand prediction with an emphasis on the use of deep learning methods. The method adopted in this paper will be presented in the “Methodology” section. The “Experimental Result” section will introduce the data and present the experimental implementation details, followed by the conclusions and outline directions for further research in the “Conclusions” section.


## 2. Related Works

How to effectively mine the potential spatiotemporal characteristics of mobility patterns and accurately predict travel demand using ride-hailing data has been increasingly concerned in the domains of demand-responsive mobility. In this section, we mainly discuss the related work of travel demand prediction and sparse demand processing.Early researches on traffic prediction are mainly based on time series models, such as the autoregressive integrated moving average (ARIMIA) model and its integration with other models [18–22]. Pavlyuk [23] compares ARIMA with different vector autoregressive models to discuss the influence of temporal aggregation on the spatiotemporal prediction accuracy of traffic flow. Machine learning models provide researches with more options. Zhu et al. [24] utilize a linear conditional Gaussian (LCG) Bayesian network (BN) model to consider both continuous and discrete variables for short-term traffic flow prediction. The results indicate that the prediction accuracy increases significantly when both spatial data and speed data are included. Lu and Zhou [25] propose a short-term highway traffic state prediction method based on a Kalman filtering model, which highlights the advantage of combining a polynomial trend model and historical patterns. Li et al. [26] combine the complementary advantages of wavelets analysis and least squares support vector machine (LS-SVM) models to predict short-term travel demand. Compared with the other models, the proposed model not only has better prediction performance but also is capable of capturing the nonstationary characteristics of short-term traffic dynamic systems. Phiboonbanakit and Horanont [27] compare the prediction results of standard random forest (RF), decision tree (DT), and gradient-boosted regression tree (GBDT) with actual operational data to reveal the mobility patterns of taxi trajectories. Liu et al. [28] propose a combined model of the random forest model (RFM) and ridge regression model (RRM) and take environmental and meteorological factors into account to predict the taxi demand in hotspots. The results indicate that the prediction effect of the combined model is better than those of RFM and RRM. Li et al. [29] develop a Markov-based time series model (MTSM) framework to predict traffic network conditions by integrating archived and real-time data under various external conditions, including weather, work zones, incidents, and special events. Sharma et al. [30] present an artificial neural network- (ANN-) based short-term traffic volume prediction model for two-lane undivided highways with mixed traffic conditions in India. These models are fit for different scenarios. However, with the explosive growth of the scale of data and the computational complexity between different dimensional features in the big data scenario, these methods will struggle to capture complex temporal and spatial correlations [31].Deep learning has been widely used in traffic prediction [32, 33] in recent years due to its successful performance in big data processing and computational vision. CNN has a strong ability to capture local trend features and scale-invariant features when the nearby data points typically have a strong relationship with each other [34]. Zhang et al. [35] partition a city into a grid map based on the longitude and latitude and apply CNN to predict the travel flow in real time. Fedorov et al. [36] employ the state-of-the-art Faster R-CNN two-stage detector together with an SORT tracker to address the problem of traffic flow estimation with data from a video surveillance camera. By setting gated recurrent learning units inside the network, LSTM has the ability to capture the time characteristics of long and short states and has been broadly used in time series prediction [37]. Tang et al. [38] propose a Genetic Algorithm with Attention-based LSTM and combine with spatiotemporal correlation analysis to predict urban road traffic volume. Zhao et al. [39] further improve the computational efficiency of the LSTM model by simplifying the gating structure using GRU. To overcome the shortcomings of a single technology, the fusion of multiple intelligent prediction methods is also the focus of recent research. Deep neural network models combining CNN with LSTM have been widely used in different disciplines, including traffic speed prediction and travel demand prediction [40–43].In the process of traffic demand forecasting, the road network is often partitioned using squares. In recent years, hexagon partition has become increasingly popular in different domains. Hexagon partition has many advantages over square and other forms of partitioning. For instance, in the case of image processing, hexagon partition has higher computational efficiency, better robustness, and more accurate image alignment [44–46]. Because of the better approximation of the shape to a circular, a hexagon per unit area has a lower perimeter than a square. This improvement in reducing bias produced by edge effects allows hexagon partition to better aggregate travel demands with similar travel characteristics. Ke et al. [14] propose a hexagon-based convolutional neural network to predict the short-term supply-demand gap in ridesharing services. In addition, each square is connected to adjacent neighbors in two ways, by edges and angles, respectively. However, hexagon partition, which is symmetrically equivalent to its six adjacent neighbors [47], can better characterize the connectivity in the hierarchical network topology and become a popular grid division method for optimal scheduling of ride-hailing [48, 49].Furthermore, as a common data processing method, setting the minimum demand threshold has been applied in many studies where the central urban areas with intensive travel demand are often the research focus. For example, Yao et al. [15] filter out the samples with a demand value of less than 10. Ke et al. [14] investigate the grids with daily requesting orders larger than 100. Huang et al. [50] empirically limit their research to the areas within the fourth Ring Road of Chengdu. Although the deletion of sparse demand is statistically indisputable, theoretically, it destroys the topological reliability of subsequent spatiotemporal correlation analysis. In addition, the selection of these threshold values has brought great spatiotemporal uncertainty to travel demand prediction. These issues, however, have not yet been addressed in the existing literature.Therefore, the current paper contributes to the existing literature by systematically assessing the effects of the sparsity of ride-hailing travel requests in different urban areas on travel demand prediction. Our ultimate goal is to increase the reliability of travel demand prediction by avoiding the excessive omission of sparse data (e.g., in rural areas). Due to the complex nature underlying big data, various deep learning methods are compared based on hexagon partitions. To the best of our knowledge, this is the first effort to quantitatively identify the effects of sparse data in travel demand forecasting by setting various threshold values. The findings are expected to draw attention in the transportation community to this ignored but important issue. The results of the comparative analysis among different deep learning algorithms will also offer additional insights into the performance of the various cutting-edge methods.


## 3. Methodology

To predict travel demand, we first divide a city into uniform hexagon partitions based on latitude and longitude coordinates and divide the whole day into uniform time intervals. Based on the partition in space and time, the ride-hailing orders at hexagon partitioni and time interval t are aggregated as travel demand yit.The short-term travel demand prediction problem aims to predict the future time interval travel demandyit+1 for ride-hailing in a specific partition of the city using multiple historical local spatial data Yit−h+1,…,Yit collected until time interval t, as shown in Figure 1. Yit is represented by three-layer local adjacent partitions centralized at hexagon partition i. Since the computational propagation of deep learning is based on matrix transformation, the three-layer local adjacent partitions travel demands Yit are transformed into the matrix or tensor through parity coordinate transformation following previous studies [14].Figure 1
Three-layer local adjacent partitions [14]


### 3.1. H-CNN-LSTM Model

We defineXi as the transformation matrix, and the position of the hexagon partition in a matrix is indexed by its parity coordinates. The transformation matrix of the three-layer local adjacent partitions is established as follows:(1)Xit=00yi9t0yi10t0yi11t000yi8t0yi2t0yi3t0yi12t0yi7t0yi1t0yi0t0yi4t0yi13t0yi18t0yi6t0yi5t0yi14t000yi17t0yi16t0yi15t00,where yi0t=yit denotes the travel demand for the central hexagon partition of Yit.Figure2 shows that the input of the CNN model is the image reflecting the spatial characteristics of travel demand; that is, the input Xit for hexagon partition i and time interval t is a 5×9 matrix (as shown in equation (1)) transformed by the three-layer local adjacent partitions centralized at hexagon partition i. The spatial feature of the demand is extracted by convolution layers, and the convolution operation between each layer is transformed as follows:(2)Xi,kt=aXi,k−1t∗Wkt+bkt,where a is the ReLU function, which is selected as the activation function in this paper. Wkt and bkt are parameter collections of the kth layer. ∗ denotes the convolution operation. The last convolution layer Xi,Kt is transformed into a dense vector that can be written as F^it=flattenXi,Kt, where flatten denotes the concatenating procedure. Finally, we use a fully connected layer to reduce the dimension of the dense vector F^it and learn the essential spatial feature for location i and time interval t. The output of this layer can be described as follows:(3)Fit=aWfctF^it+bfct,where Wfct and bfct are trainable parameters and a is the ReLU function.Figure 2
The architecture of H-CNN-LSTM.LSTM is a special RNN model that is proposed to solve its gradient dispersion problem. In this model, LSTM is adopted to memorize the characteristics of the temporal dimension of travel demand. The key to LSTM is the cell state, which ensures the memory and circulation of information. It has the ability to remove or increase information to the cell state by carefully designing structures called gates, which consist of forget gatefit, input gate iit, and output gate oit. The specific functional relationship of LSTM is shown as follows:(4)fit=σWf∗hit−1+Fit+bf,iit=σWi∗hit−1+Fit+bi,C˜it=tanhWc∗hit−1+Fit+bc,Cit=fit∘Cit−1+iit∘C˜it,oit=σWo∗hit−1+Fit+bo,hit=oit∘tanhCit,where ∘ denotes the Hadamard product, which calculates the elementwise products of two vectors, matrices, or tensors with the same dimensions, and σ and tanh denote the nonlinear activation function of a sigmoid function and a hyperbolic tangent function, respectively. Wf,Wi,Wc,Wo are trainable parameter matrices, and bf,bi,bc,bo are corresponding biases. The dense vector hit represents the output of the model given the input Fit, hit−1, which integrates the spatiotemporal features at location i and time interval t. The prediction demand y^it+1 for location i and time interval t+1 can be finally obtained by a fully connected network as follows:(5)y^it+1=σWfuhit+bfu,where Wfu and bfu are trainable parameters and σ is the sigmoid function, which is selected as the activation function of fully connected layers.


### 3.2. H-CNN-GRU Model

In this section, GRU is applied instead of LSTM to capture the temporal characteristics. As a variant of LSTM, GRU eliminates the cell state and uses the hidden state for information transmission. Therefore, its simpler structure facilitates faster computation, and it has a better performance on limited training data. GRU combines the forget gate and input gate into a single update gatezit, which controls how much information needs to be forgotten in the hidden layer hit−1 of the previous moment and how much information needs to be added from the candidate hidden layer h˜it of the current moment. The candidate hidden layer h˜it is similar to C˜it in LSTM, which can be regarded as the new information at the current moment. The reset gate rit is used to control how much of the previous memory needs to be retained. The specific functional relationship of GRU is shown as follows:(6)zit=σWz∗hit−1+Fit+bz,rit=σWr∗hit−1+Fit+br,h˜it=tanhWh˜∗hit−1+Fit+bh˜,hit=1−zit∘hit−1+zit∘h˜it,where ∘ denotes Hadamard product and σ and tanh denote the activation function of a sigmoid function and a hyperbolic tangent function, respectively. Wz,Wr,Wh˜ and bz,br,bh˜ are trainable parameters. As presented in the previous section, a dense vector hit can be output, and the prediction demand y^it+1 can be obtained by giving the input Fit, hit−1. Figure 3 is a structural diagram of the H-CNN-GRU model.Figure 3
The architecture of the H-CNN-GRU.


### 3.3. H-ConvLSTM Model

Figure4 shows the architecture of the H-ConvLSTM model. As an improved form of the LSTM model, ConvLSTM has convolutional structures in both the input-to-state and state-to-state transitions and has good performance in simultaneously capturing temporal and spatial features.Figure 4
The architecture of H-ConvLSTM.Similar to LSTM, ConvLSTM also consists of inputsXit−h+1,…,Xit, cell states Cit−h+1,…,Cit, hidden states ℋit−h+1,…,ℋit, and the other gates. These states are converted to 3D tensors (Xit⟶Xit) suitable for the convolution operation, the last two dimensions of which are rows and columns of spatial information. The historical local spatial features of a certain partition can therefore be directly taken and transited in the model. The specific functional relationship of ConvLSTM is shown as follows:(7)fit=σWf∗ℋit−1,Xit+bf,iit=σWi∗ℋit−1,Xit+bi,C˜it=tanhWc∗ℋit−1,Xit+bc,Cit=fit∘Cit−1+iit∘C˜it,oit=σWo∗ℋit−1,Xit+bo,ℋit=oit∘tanhCit,where ∗ denotes the convolution operator and the other parameter settings are consistent with those of LSTM. The output state ℋit−1 is finally taken into a fully connected network to obtain the prediction demand y^it+1.


### 3.4. Loss Function

The symmetric mean absolute percentage error (SMAPE) between the estimated and real demand is sensitive to sparse demand, while the root mean square error (RMSE) can better assess the prediction performance of the central area by amplifying the impact of larger outliers [15]. Therefore, a composite loss function can be created as follows:(8)L=1n∑i=1ny^it+1−yit+1y^it+1+yit+1+ε+λ∗1n∑i=1ny^it+1−yit+12,where ε is a very small value to avoid having a zero value in the denominator and λ is a hyperparameter.


## 3.1. H-CNN-LSTM Model

We defineXi as the transformation matrix, and the position of the hexagon partition in a matrix is indexed by its parity coordinates. The transformation matrix of the three-layer local adjacent partitions is established as follows:(1)Xit=00yi9t0yi10t0yi11t000yi8t0yi2t0yi3t0yi12t0yi7t0yi1t0yi0t0yi4t0yi13t0yi18t0yi6t0yi5t0yi14t000yi17t0yi16t0yi15t00,where yi0t=yit denotes the travel demand for the central hexagon partition of Yit.Figure2 shows that the input of the CNN model is the image reflecting the spatial characteristics of travel demand; that is, the input Xit for hexagon partition i and time interval t is a 5×9 matrix (as shown in equation (1)) transformed by the three-layer local adjacent partitions centralized at hexagon partition i. The spatial feature of the demand is extracted by convolution layers, and the convolution operation between each layer is transformed as follows:(2)Xi,kt=aXi,k−1t∗Wkt+bkt,where a is the ReLU function, which is selected as the activation function in this paper. Wkt and bkt are parameter collections of the kth layer. ∗ denotes the convolution operation. The last convolution layer Xi,Kt is transformed into a dense vector that can be written as F^it=flattenXi,Kt, where flatten denotes the concatenating procedure. Finally, we use a fully connected layer to reduce the dimension of the dense vector F^it and learn the essential spatial feature for location i and time interval t. The output of this layer can be described as follows:(3)Fit=aWfctF^it+bfct,where Wfct and bfct are trainable parameters and a is the ReLU function.Figure 2
The architecture of H-CNN-LSTM.LSTM is a special RNN model that is proposed to solve its gradient dispersion problem. In this model, LSTM is adopted to memorize the characteristics of the temporal dimension of travel demand. The key to LSTM is the cell state, which ensures the memory and circulation of information. It has the ability to remove or increase information to the cell state by carefully designing structures called gates, which consist of forget gatefit, input gate iit, and output gate oit. The specific functional relationship of LSTM is shown as follows:(4)fit=σWf∗hit−1+Fit+bf,iit=σWi∗hit−1+Fit+bi,C˜it=tanhWc∗hit−1+Fit+bc,Cit=fit∘Cit−1+iit∘C˜it,oit=σWo∗hit−1+Fit+bo,hit=oit∘tanhCit,where ∘ denotes the Hadamard product, which calculates the elementwise products of two vectors, matrices, or tensors with the same dimensions, and σ and tanh denote the nonlinear activation function of a sigmoid function and a hyperbolic tangent function, respectively. Wf,Wi,Wc,Wo are trainable parameter matrices, and bf,bi,bc,bo are corresponding biases. The dense vector hit represents the output of the model given the input Fit, hit−1, which integrates the spatiotemporal features at location i and time interval t. The prediction demand y^it+1 for location i and time interval t+1 can be finally obtained by a fully connected network as follows:(5)y^it+1=σWfuhit+bfu,where Wfu and bfu are trainable parameters and σ is the sigmoid function, which is selected as the activation function of fully connected layers.


## 3.2. H-CNN-GRU Model

In this section, GRU is applied instead of LSTM to capture the temporal characteristics. As a variant of LSTM, GRU eliminates the cell state and uses the hidden state for information transmission. Therefore, its simpler structure facilitates faster computation, and it has a better performance on limited training data. GRU combines the forget gate and input gate into a single update gatezit, which controls how much information needs to be forgotten in the hidden layer hit−1 of the previous moment and how much information needs to be added from the candidate hidden layer h˜it of the current moment. The candidate hidden layer h˜it is similar to C˜it in LSTM, which can be regarded as the new information at the current moment. The reset gate rit is used to control how much of the previous memory needs to be retained. The specific functional relationship of GRU is shown as follows:(6)zit=σWz∗hit−1+Fit+bz,rit=σWr∗hit−1+Fit+br,h˜it=tanhWh˜∗hit−1+Fit+bh˜,hit=1−zit∘hit−1+zit∘h˜it,where ∘ denotes Hadamard product and σ and tanh denote the activation function of a sigmoid function and a hyperbolic tangent function, respectively. Wz,Wr,Wh˜ and bz,br,bh˜ are trainable parameters. As presented in the previous section, a dense vector hit can be output, and the prediction demand y^it+1 can be obtained by giving the input Fit, hit−1. Figure 3 is a structural diagram of the H-CNN-GRU model.Figure 3
The architecture of the H-CNN-GRU.


## 3.3. H-ConvLSTM Model

Figure4 shows the architecture of the H-ConvLSTM model. As an improved form of the LSTM model, ConvLSTM has convolutional structures in both the input-to-state and state-to-state transitions and has good performance in simultaneously capturing temporal and spatial features.Figure 4
The architecture of H-ConvLSTM.Similar to LSTM, ConvLSTM also consists of inputsXit−h+1,…,Xit, cell states Cit−h+1,…,Cit, hidden states ℋit−h+1,…,ℋit, and the other gates. These states are converted to 3D tensors (Xit⟶Xit) suitable for the convolution operation, the last two dimensions of which are rows and columns of spatial information. The historical local spatial features of a certain partition can therefore be directly taken and transited in the model. The specific functional relationship of ConvLSTM is shown as follows:(7)fit=σWf∗ℋit−1,Xit+bf,iit=σWi∗ℋit−1,Xit+bi,C˜it=tanhWc∗ℋit−1,Xit+bc,Cit=fit∘Cit−1+iit∘C˜it,oit=σWo∗ℋit−1,Xit+bo,ℋit=oit∘tanhCit,where ∗ denotes the convolution operator and the other parameter settings are consistent with those of LSTM. The output state ℋit−1 is finally taken into a fully connected network to obtain the prediction demand y^it+1.


## 3.4. Loss Function

The symmetric mean absolute percentage error (SMAPE) between the estimated and real demand is sensitive to sparse demand, while the root mean square error (RMSE) can better assess the prediction performance of the central area by amplifying the impact of larger outliers [15]. Therefore, a composite loss function can be created as follows:(8)L=1n∑i=1ny^it+1−yit+1y^it+1+yit+1+ε+λ∗1n∑i=1ny^it+1−yit+12,where ε is a very small value to avoid having a zero value in the denominator and λ is a hyperparameter.


## 4. Experimental Result

### 4.1. Dataset and Preprocessing

The dataset used in this study is the online ride-hailing order data provided by the Didi Gaia Plan platform of Chengdu in November 2016. Firstly, latitude and longitude are allocated into 35 × 46 hexagon partitions, and the side length of each partition is 800 m. Secondly, a time interval of 30 min is used to label each order data point based on its starting time. The hexagon partitions and time-labeled order data points are then intersected in Quantum Geographic Information System (QGIS) to obtain the spatial labels. Finally, the ride-hailing travel demands can be easily aggregated in different time intervals and spatial partitions.Here, to evaluate the sparse effects of different models in the prediction of travel demand, two types of minimum demand thresholds are selected to screen samples with different degrees of sparsity. In the training and testing processes of the proposed deep learning models, a travel demand sampleyit needs to be expanded into the corresponding sample group Yit−h+1,…,Yit,yit+1, where Yit−h+1,…,Yit represents the input of the model and yit+1 represents the corresponding label. The first type is to set the minimum demand threshold as 1, 2, 4, and 8 for all hexagon partitions. If the demand yit at the center of Yit is less than the threshold, the sample group Yit−h+1,…,Yit,yit+1 is removed from the corresponding dataset. In order to ensure that the order coverage of different thresholds is roughly close to that of the first type for further comparative analysis, the second type selects all sample groups of the hexagon partition i with average daily demands above 25, 50, 100, and 200. For all datasets with different threshold settings, the first three weeks of data are used for training and the rest for testing. The statistical characteristics of the ride-hailing order data yit under different types of threshold scales are shown in Table 1. Under the condition of similar order volume coverage (proportion of the order sample to the total demand after removing the sparse demand), the first threshold type covers more partitions in the spatial scale but is discontinuous in the temporal scale, while the second threshold type can predict all time intervals in the temporal scales and only cover limited partitions in the spatial scale.Table 1
Order data characteristics under different minimum threshold settings.
Threshold typeThreshold scaleOrder coveragePartition numberPartition coverageAverage daily time intervalAverage coverage of daily time intervalType 1111208111.860.2520.9810260.8510.190.2140.955500.4613.170.2780.903240.2715.40.32Type 2250.983450.29481500.972670.224811000.952050.174812000.921520.13481


### 4.2. Model Setup

The experiment is run on a server with an Intel(R) Xeon(R) Gold-5218 CPU @ 2.30 GHz, 128 GB RAM, and one GPU (NVIDIA Quadro RTX 5000). The proposed model is implemented based on Python 3.6.6 with TensorFlow and Keras. For the spatial view of the CNN of H-CNN-LSTM and H-CNN-GRU, there are 4 convolution layers that use 8, 16, 32, and 32 filters of size 3 × 3, respectively. In order to better capture the spatial characteristics of the input segment, virtual partitions with zero demand values are added as neighbors of the partitions on the border. The output dimension of the CNN, which is also the input size of LSTM and GRU, is set to 64. For the temporal view of LSTM and GRU, the time step is the previous 8 time intervals, and the hidden dimension is 64. In addition, the proposed H-ConvLSTM includes 4 ConvLSTM layers, which have 8, 16, 32, and 32 hidden states. The kernel size of each layer is 3 × 3. Batch normalization and dropout are used for training the model. The training epochs are set as 50 with a batch size of 64. Adam is used for optimization. SMAPE and RMSE are used to evaluate the predictive performance. In the loss function, the hyperparameterλ is set as 100 to ensure that RMSE and SMAPE’s influence in the feedback calculation is in the same dimension.


### 4.3. Model Comparison

We compare our proposed models with the following standard models: (1) ARIMA: autoregressive integrated moving average model, which is a classical algorithm with good predictive performance for time series data. The difference orderd is set to 1, with an autoregressive coefficient p and a moving average coefficient q for iterating the previous time intervals between 1 and 8; (2) H-ANN: the spatial and historical temporal features of the demands of a hexagon partition are spliced together as the input of the fully connected neural network, and the predicted demand value of the future time is output. The model includes 5 fully connected layers, which have 128, 64, 32, 16, and 8 hidden neurons, respectively; (3) H-CNN: transform the historical spatial features of the demands of a hexagon partition into images and stack them together as input. The previous 8 time intervals are represented by the numbers of channels in the input image. The H-CNN model includes 4 convolution layers, which have 8, 16, 32, and 32 hidden states. The kernel size of each layer is 3 × 3. Batch normalization and dropout are used to train the model; (4) H-LSTM: the spatial features of the demands of hexagon partitions are flattened into 1-dimensional demand vectors as the input of each historical time interval, and the spatiotemporal demands in the eight historical time intervals are used to predict the results of the next time interval. The hidden state is set to 64.The prediction results of each model under different minimum demand threshold settings are shown in Tables2 and 3. Our proposed hybrid deep learning models that combine spatiotemporal prediction with the advantages of the hexagon partition always achieve lower SMAPE and RMSE values, indicating better performance. Due to the simplified structure of the gate unit, H-CNN-GRU has a faster training efficiency than H-CNN-LSTM. For example, when the minimum demand threshold is set to 1, the training time of H-CNN-LSTM and H-CNN-GRU is 1.32 h and 1.21 h, respectively. Instead of the simple splicing of the spatial view model (CNN) and temporal view model (LSTM and GRU), ConvLSTM adopts convolutional structures in both the input-to-state and state-to-state transitions to integrate the advantages of these models, which reduces the loss of spatial topological relations of the data. This deeper fusion minimizes the prediction error of the H-ConvLSTM model at each threshold setting while increasing the difficulty of training (the training time at the corresponding threshold 1 is 5.52 h). However, considering that there is no order of magnitude differences of the training times among the three proposed hybrid deep learning models and that all training is conducted offline, the potential disadvantage of this increased training time for achieving superior demand prediction results seems to be tolerable.Table 2
Comparison of different models in minimum demand threshold type 1.
ModelThreshold 1Threshold 2Threshold 4Threshold 8SMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSEARIMA22.674.1219.925.3216.237.2613.158.79H-ANN21.854.0118.765.1315.767.2212.948.55H-CNN21.43.5218.944.6914.286.2412.27.92H-LSTM19.453.6715.074.5413.896.4110.77.27H-CNN-LSTM17.383.414.524.1412.575.7810.066.9H-CNN-GRU17.293.3414.494.2412.415.5810.136.88H-ConvLSTM16.343.0313.753.9711.355.349.6126.66Table 3
Comparison of different models in minimum demand threshold type 2.
ModelThreshold 25Threshold 50Threshold 100Threshold 200SMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSEARIMA46.644.1137.835.2431.916.1725.737.34H-ANN45.893.8237.914.2629.475.1324.456.71H-CNN44.943.7336.644.1130.154.7923.826.2H-LSTM41.613.5537.294.0727.084.9522.755.94H-CNN-LSTM41.023.5332.653.9625.944.6420.455.36H-CNN-GRU40.243.1832.463.7426.134.6621.465.69H-ConvLSTM37.523.1832.093.7123.234.0219.545.26The continuous reduction of the minimum demand threshold gradually enhances the sparsity of the sample data, and the corresponding SMAPE also significantly increases. In the case of similar order coverage, the SMAPE of setting the minimum demand threshold of type 1 is only approximately half of that of type 2. Even the prediction performance of type 1 with a minimum demand threshold of 1 (16.34) is better than either of type 2, which indicates that there are many 0-value demand prediction problems in type 2 that are difficult to predict accurately.Figure5 presents the spatial distribution of SMAPE of the H-ConvLSTM model under different thresholds. It can be found that, with the increase in the distance from the central areas, the travel demand sparsity of the suburbs gradually increases, and SMAPE in type 2 also gradually increases. However, the corresponding SMAPE prediction results in type 1 show a trend of increasing first and decreasing afterwards. The prediction results of each hexagon partition in type 1 are divided into four interval types according to the size of SMAPE, and the demand composition of each type is statistically analyzed, as shown in Figure 6. It can be found that the sparse demand ratio between 2 and 8 has a positive correlation with the SMAPE value. In addition, it can be seen from the 1-value demand prediction results that when the sample size proportion is high enough, the prediction results of sparse demand can also be improved. Therefore, the circular region with the highest SMAPE value in type 1 may be due to the large fluctuation of demand in these regions and the relatively high proportion of sparse demand, and a large number of 1-value predictions makes the outermost region SMAPE value decrease to a certain extent.Figure 5
Spatial distribution of SMAPE of the H-ConvLSTM model under different thresholds.Figure 6
Composition of travel demand in different SMAPE hexagon partitions.Figure7 presents the spatial distribution of the SMAPE difference between H-ConvLSTM and the other two hybrid deep learning models. This shows that when the difference value in the figure is negative, indicating a smaller SMAPE value of H-ConvLSTM, the predicted results achieve better accuracy. In most cases, the prediction accuracy of H-ConvLSTM is better than that of the other two models, especially in areas where the sparse demand distribution is relatively dense.Figure 7
Spatial distribution of SMAPE difference between H-ConvLSTM and other models: (a) H-CNN-LSTM; (b) H-CNN-GRU.
(a)(b)The continuous decrease in the minimum demand threshold makes the overall sample sparser and makes the overall RMSE smaller. However, since RMSE is greatly affected by the large demand samples, the RMSE value in the central area presents a stable trend, as shown in Figure8.Figure 8
Spatial distribution of RMSE of the H-ConvLSTM model under different thresholds.


## 4.1. Dataset and Preprocessing

The dataset used in this study is the online ride-hailing order data provided by the Didi Gaia Plan platform of Chengdu in November 2016. Firstly, latitude and longitude are allocated into 35 × 46 hexagon partitions, and the side length of each partition is 800 m. Secondly, a time interval of 30 min is used to label each order data point based on its starting time. The hexagon partitions and time-labeled order data points are then intersected in Quantum Geographic Information System (QGIS) to obtain the spatial labels. Finally, the ride-hailing travel demands can be easily aggregated in different time intervals and spatial partitions.Here, to evaluate the sparse effects of different models in the prediction of travel demand, two types of minimum demand thresholds are selected to screen samples with different degrees of sparsity. In the training and testing processes of the proposed deep learning models, a travel demand sampleyit needs to be expanded into the corresponding sample group Yit−h+1,…,Yit,yit+1, where Yit−h+1,…,Yit represents the input of the model and yit+1 represents the corresponding label. The first type is to set the minimum demand threshold as 1, 2, 4, and 8 for all hexagon partitions. If the demand yit at the center of Yit is less than the threshold, the sample group Yit−h+1,…,Yit,yit+1 is removed from the corresponding dataset. In order to ensure that the order coverage of different thresholds is roughly close to that of the first type for further comparative analysis, the second type selects all sample groups of the hexagon partition i with average daily demands above 25, 50, 100, and 200. For all datasets with different threshold settings, the first three weeks of data are used for training and the rest for testing. The statistical characteristics of the ride-hailing order data yit under different types of threshold scales are shown in Table 1. Under the condition of similar order volume coverage (proportion of the order sample to the total demand after removing the sparse demand), the first threshold type covers more partitions in the spatial scale but is discontinuous in the temporal scale, while the second threshold type can predict all time intervals in the temporal scales and only cover limited partitions in the spatial scale.Table 1
Order data characteristics under different minimum threshold settings.
Threshold typeThreshold scaleOrder coveragePartition numberPartition coverageAverage daily time intervalAverage coverage of daily time intervalType 1111208111.860.2520.9810260.8510.190.2140.955500.4613.170.2780.903240.2715.40.32Type 2250.983450.29481500.972670.224811000.952050.174812000.921520.13481


## 4.2. Model Setup

The experiment is run on a server with an Intel(R) Xeon(R) Gold-5218 CPU @ 2.30 GHz, 128 GB RAM, and one GPU (NVIDIA Quadro RTX 5000). The proposed model is implemented based on Python 3.6.6 with TensorFlow and Keras. For the spatial view of the CNN of H-CNN-LSTM and H-CNN-GRU, there are 4 convolution layers that use 8, 16, 32, and 32 filters of size 3 × 3, respectively. In order to better capture the spatial characteristics of the input segment, virtual partitions with zero demand values are added as neighbors of the partitions on the border. The output dimension of the CNN, which is also the input size of LSTM and GRU, is set to 64. For the temporal view of LSTM and GRU, the time step is the previous 8 time intervals, and the hidden dimension is 64. In addition, the proposed H-ConvLSTM includes 4 ConvLSTM layers, which have 8, 16, 32, and 32 hidden states. The kernel size of each layer is 3 × 3. Batch normalization and dropout are used for training the model. The training epochs are set as 50 with a batch size of 64. Adam is used for optimization. SMAPE and RMSE are used to evaluate the predictive performance. In the loss function, the hyperparameterλ is set as 100 to ensure that RMSE and SMAPE’s influence in the feedback calculation is in the same dimension.


## 4.3. Model Comparison

We compare our proposed models with the following standard models: (1) ARIMA: autoregressive integrated moving average model, which is a classical algorithm with good predictive performance for time series data. The difference orderd is set to 1, with an autoregressive coefficient p and a moving average coefficient q for iterating the previous time intervals between 1 and 8; (2) H-ANN: the spatial and historical temporal features of the demands of a hexagon partition are spliced together as the input of the fully connected neural network, and the predicted demand value of the future time is output. The model includes 5 fully connected layers, which have 128, 64, 32, 16, and 8 hidden neurons, respectively; (3) H-CNN: transform the historical spatial features of the demands of a hexagon partition into images and stack them together as input. The previous 8 time intervals are represented by the numbers of channels in the input image. The H-CNN model includes 4 convolution layers, which have 8, 16, 32, and 32 hidden states. The kernel size of each layer is 3 × 3. Batch normalization and dropout are used to train the model; (4) H-LSTM: the spatial features of the demands of hexagon partitions are flattened into 1-dimensional demand vectors as the input of each historical time interval, and the spatiotemporal demands in the eight historical time intervals are used to predict the results of the next time interval. The hidden state is set to 64.The prediction results of each model under different minimum demand threshold settings are shown in Tables2 and 3. Our proposed hybrid deep learning models that combine spatiotemporal prediction with the advantages of the hexagon partition always achieve lower SMAPE and RMSE values, indicating better performance. Due to the simplified structure of the gate unit, H-CNN-GRU has a faster training efficiency than H-CNN-LSTM. For example, when the minimum demand threshold is set to 1, the training time of H-CNN-LSTM and H-CNN-GRU is 1.32 h and 1.21 h, respectively. Instead of the simple splicing of the spatial view model (CNN) and temporal view model (LSTM and GRU), ConvLSTM adopts convolutional structures in both the input-to-state and state-to-state transitions to integrate the advantages of these models, which reduces the loss of spatial topological relations of the data. This deeper fusion minimizes the prediction error of the H-ConvLSTM model at each threshold setting while increasing the difficulty of training (the training time at the corresponding threshold 1 is 5.52 h). However, considering that there is no order of magnitude differences of the training times among the three proposed hybrid deep learning models and that all training is conducted offline, the potential disadvantage of this increased training time for achieving superior demand prediction results seems to be tolerable.Table 2
Comparison of different models in minimum demand threshold type 1.
ModelThreshold 1Threshold 2Threshold 4Threshold 8SMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSEARIMA22.674.1219.925.3216.237.2613.158.79H-ANN21.854.0118.765.1315.767.2212.948.55H-CNN21.43.5218.944.6914.286.2412.27.92H-LSTM19.453.6715.074.5413.896.4110.77.27H-CNN-LSTM17.383.414.524.1412.575.7810.066.9H-CNN-GRU17.293.3414.494.2412.415.5810.136.88H-ConvLSTM16.343.0313.753.9711.355.349.6126.66Table 3
Comparison of different models in minimum demand threshold type 2.
ModelThreshold 25Threshold 50Threshold 100Threshold 200SMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSESMAPE (×10−2)RMSEARIMA46.644.1137.835.2431.916.1725.737.34H-ANN45.893.8237.914.2629.475.1324.456.71H-CNN44.943.7336.644.1130.154.7923.826.2H-LSTM41.613.5537.294.0727.084.9522.755.94H-CNN-LSTM41.023.5332.653.9625.944.6420.455.36H-CNN-GRU40.243.1832.463.7426.134.6621.465.69H-ConvLSTM37.523.1832.093.7123.234.0219.545.26The continuous reduction of the minimum demand threshold gradually enhances the sparsity of the sample data, and the corresponding SMAPE also significantly increases. In the case of similar order coverage, the SMAPE of setting the minimum demand threshold of type 1 is only approximately half of that of type 2. Even the prediction performance of type 1 with a minimum demand threshold of 1 (16.34) is better than either of type 2, which indicates that there are many 0-value demand prediction problems in type 2 that are difficult to predict accurately.Figure5 presents the spatial distribution of SMAPE of the H-ConvLSTM model under different thresholds. It can be found that, with the increase in the distance from the central areas, the travel demand sparsity of the suburbs gradually increases, and SMAPE in type 2 also gradually increases. However, the corresponding SMAPE prediction results in type 1 show a trend of increasing first and decreasing afterwards. The prediction results of each hexagon partition in type 1 are divided into four interval types according to the size of SMAPE, and the demand composition of each type is statistically analyzed, as shown in Figure 6. It can be found that the sparse demand ratio between 2 and 8 has a positive correlation with the SMAPE value. In addition, it can be seen from the 1-value demand prediction results that when the sample size proportion is high enough, the prediction results of sparse demand can also be improved. Therefore, the circular region with the highest SMAPE value in type 1 may be due to the large fluctuation of demand in these regions and the relatively high proportion of sparse demand, and a large number of 1-value predictions makes the outermost region SMAPE value decrease to a certain extent.Figure 5
Spatial distribution of SMAPE of the H-ConvLSTM model under different thresholds.Figure 6
Composition of travel demand in different SMAPE hexagon partitions.Figure7 presents the spatial distribution of the SMAPE difference between H-ConvLSTM and the other two hybrid deep learning models. This shows that when the difference value in the figure is negative, indicating a smaller SMAPE value of H-ConvLSTM, the predicted results achieve better accuracy. In most cases, the prediction accuracy of H-ConvLSTM is better than that of the other two models, especially in areas where the sparse demand distribution is relatively dense.Figure 7
Spatial distribution of SMAPE difference between H-ConvLSTM and other models: (a) H-CNN-LSTM; (b) H-CNN-GRU.
(a)(b)The continuous decrease in the minimum demand threshold makes the overall sample sparser and makes the overall RMSE smaller. However, since RMSE is greatly affected by the large demand samples, the RMSE value in the central area presents a stable trend, as shown in Figure8.Figure 8
Spatial distribution of RMSE of the H-ConvLSTM model under different thresholds.


## 5. Conclusions

To reduce the uncertainty in the mismatch between the supply and demand of online ride-hailing services, in this paper, we propose three hybrid deep learning methods based on hexagon partitions to analyze the effects of sparse data in travel demand prediction. The results are helpful for making policy recommendations to improve the operational efficiency and quality of ride-hailing services. The comparative results of the empirical study highlight that the H-ConvLSTM model has a better prediction performance than H-CNN-LSTM and H-CNN-GRU due to the excellent feature in capturing the temporal and spatial characteristics simultaneously, especially in the area with a high proportion of sparse demand. Because the model adopts convolutional structures in both the input-to-state and state-to-state transitions, it reduces the loss of spatial topological relations of the data.The setting of different minimum demand thresholds changes the sparsity of the whole sample data, which has a significant impact on the prediction results of the models. Since the denominator of SMAPE in the sparse demand is generally small, the proportion of sparse demand between thresholds 2 and 8 has a significant positive correlation with the SMAPE value. In addition, it can be seen from the 1-value demand prediction results that when the sample size is high enough, the prediction results of sparse demand can also be improved. Therefore, with increasing distance from the central area, the SMAPE in the case of the type 1 threshold values shows a trend of first increasing and then decreasing. The SMAPE in the type 1 threshold value is much lower than that of type 2, which indicates that there are many 0-value demand prediction problems in type 2 that are difficult to predict accurately. We also found that RMSE is largely affected by large demand values. Although the overall sparsity of the sample keeps decreasing, the central region shows a stable trend.The current study explored the effectiveness of several advanced deep learning methods to address the effects of sparse data on travel demand prediction. However, more in-depth analysis of the spatiotemporal scale of Internet-based ride-hailing demand is needed; for example, more threshold values may be tested. The proposed methods may also be applied and validated in different cities, especially smaller and megacities where large differences in travel orders exist between central and rural areas and between different times of day. Furthermore, to improve the impact of sparse differences on travel demand prediction, multiscale spatiotemporal partitioning may be considered in the future because the resolution of partitioning may determine the resolution of sparse data. Nevertheless, we leave these considerations as our future work.



---

*Source: 7690309-2022-04-12.xml*