# Effective Bus Travel Time Prediction System of Multiple Routes: Introducing PMLNet Based on MDARNN
## 3 Materials and Methods
### Method
#### 3.2.1 Data Pre-Processing  
Raw Datasets  
For this study, we have selected Chongqing city bus routes 805, 248, 121, and 202, as shown in Figure 5. The corresponding route information is listed in Table 1.  
To capture the characteristics of bus travel time under different seasonal and climatic conditions, we utilize the bus driving dataset from January, May, August, and October 2016. The dataset comprises 52 buses and 49,605,165 data records, and is used as a raw driving dataset \(D_{d}\); it is denoted as  
\[D_{d}= \begin{bmatrix}D_{d_{1}}^{1},D_{d_{1}}^{2},\dots,D_{d_{n}}^{46}\\ D_{d_{i}}^{1},D_{d_{i}}^{2},\dots,D_{d_{i}}^{46}\\ \vdots\\ D_{d_{k}}^{1},D_{d_{k}}^{2},\dots,D_{d_{k}}^{46}\end{bmatrix} ,i=1,2,\dots,h \tag{5}\]  
Figure 5: The bus driving routes of 805, 248, 121, and 202. \begin{table}
\begin{tabular}{c c c c c} \hline
**Route** & **Start Station** & **Destination** & **Distance (km)** & **Average Driving Time (min)** \\ \hline
805 & Chongqing University & Duijin Village & 9.6 & 34 \\
248 & Chenjiawan & Xianfeng Street & 13 & 38 \\
121 & East of Panxi & Danlong Road & 13.3 & 55 \\
202 & Ciqikou & North Station South Square & 16.4 & 61 \\ \hline \end{tabular}
\end{table} 
Table 1: The bus routes information of 805, 248, 121, and 202. Similar to \(D_{d}\), the raw route dataset \(D_{r}\) and the raw meteorological dataset \(D_{m}\) are selected and denoted as Equation (6), where \(h\), \(f\), and \(g\) correspond to the sizes of datasets \(D_{d}\), \(D_{r}\), and \(D_{m}\). \[D_{r}= \begin{bmatrix}D_{r_{1}}^{1},D_{r_{1}}^{2},\ldots,D_{r_{1}}^{8}\\ \vdots\\ D_{r_{i}}^{1},D_{r_{i}}^{2},\ldots,D_{r_{i}}^{8}\\ \vdots\\ D_{r_{h}}^{1},D_{r_{h}}^{2},\ldots,D_{r_{h}}^{8}\\ \end{bmatrix} ,D_{m}= \begin{bmatrix}D_{m_{1}}^{1},D_{m_{1}}^{2},\ldots,D_{m_{1}} ^{8}\\ \vdots\\ D_{m_{j}}^{1},D_{m_{j}}^{2},\ldots,D_{m_{j}}^{8}\\ \vdots\\ D_{m_{r}}^{1},D_{m_{j}}^{2},\ldots,D_{m_{r}}^{8}\\ \end{bmatrix} ;\quad i=1,2,\ldots,f,\quad j=1,2,\ldots,g \tag{6}\]  
The full data pre-processing process involves three stages: data fusion, travel chain construction, and dataset division. The data fusion process aims to generate a fused driving dataset consisting of 55 attributes, including 7 macro impact factors and 48 local impact factors. Algorithm 1 provides the pseudo code of the data fusion process, while Table 2 lists the corresponding explanations of variables and functions. The fused dataset is denoted as follows, where h is the size of dataset \(D_{fused}\). \[D_{fused}= \begin{bmatrix}IF_{local_{1}}^{1},\ldots,IF_{local_{1}}^{48},IF_{macro _{1}}^{1},\ldots,IF_{macro_{1}}^{7}\\ IF_{local_{i}}^{1},\ldots,IF_{local_{i}}^{48},IF_{macro_{i}}^{1},\ldots,IF_{macro _{i}}^{7}\\ \vdots\\ IF_{local_{h}}^{1},\ldots,IF_{local_{h}}^{48},IF_{macro_{h}}^{1},\ldots,IF_{macro _{h}}^{7}\\ \end{bmatrix} ,\quad i=1,2,\ldots,h \tag{7}\]  
```
Input:\(D_{d},D_{r},D_{m}\) Output:\(D_{fused}\)
1\(D_{fused}\leftarrow\) Null;
2\(T\leftarrow\) [7:00 - 9:00, 17:00 - 19:00];
3\(H\leftarrow\) [Spring Festival,...,National Day];
4\(S\leftarrow\) get_coordinate_set(\(D_{r}\));
5 foreach\(D_{d_{i}}\in D_{d}\)do
6 fill_factor(\([D_{d_{i}}^{1},\ldots,D_{d_{i}}^{46}],[IF_{local_{i}}^{1},\ldots,IF_{local_{i}}^{46}]\));
7\(((Lat_{i},Lng_{i}),t_{i},d_{i})\leftarrow\) get_data(\(D_{d_{i}}\));
8\(IF_{local_{i}}^{47}\leftarrow\) get_trip_factor(\(D_{d_{i}}\));
9\(IF_{local_{i}}^{48}\leftarrow\) get_stop_factor(\((Lat_{i},Lng_{i}),S\));
10 if\(t_{i}\subseteq T\)then
11\(IF_{macro_{i}}^{1}\leftarrow\) Peak_Label;
12 if\(d_{i}\subseteq H\)then
13\(IF_{macro_{i}}^{2}\leftarrow\) Holiday_Label;
14 fill_factor(\([D_{m_{i}}^{1},\ldots,D_{m_{i}}^{8}],[IF_{macro_{i}}^{3},\ldots,IF_{macro_{i}}^{ 2}]\));
15\(D_{fused_{i}}\leftarrow\) fuse_data(\(\{IF_{local_{i}}^{1},\ldots,IF_{local_{i}}^{48}\},\{IF_{macro_{i}}^{1},\ldots,IF_{macro_{i}}^{7}\}\));
16 add(\(D_{fused_{i}},D_{fused}\));
17
18 return\(D_{fused}\);
```  
**Algorithm 1**Datasets fusion algorithm