# A Spatial-Temporal-Semantic Neural Network Algorithm for Location Prediction on Moving Objects
## 4 Experiments
### Evaluation Based on Visualization  
The proposed algorithm is designed to solve practical problems in applications such as food delivery or bus system. One basic need of these services is to visualize the result of the predicted location on the map. In this section, the result of the proposed algorithm is drawn by the QGIS software, cooperated with the map data stored in the PostgreSQL. A trajectory from the courier dataset that has never been used in the training is used as test data, showed as the blue line in Figure 15a. During the STS feature extraction, time bin size is set to 2 s, and the distance threshold is the max length of each road for better visualization. Points mapped to the same road will be represented by one road ID and the location is visualized by the road segment. The location sequence after the feature extraction is (391182785, 391187049, 162362370, 163825162, 121991160, 121657041, 122100440,177353870, 22799950, 177353867, 22799950, 177353867), represented by the orange lines with road id in Figure 15a. For better and concise illustration, the location sequences of the fixed road IDs are replaced as (ID0, ID1, ID2, ID3, ID4, ID5, ID6, ID7, ID8, ID9, ID8, ID9).  
The \(maxLength\) of the LSTM model is set to 5. Suppose that the current and latest four locations are collected and used as test data, as shown in Figure 15b. The rest of the sequence is used as the ground truth. The predicted location of (ID0, ID1, ID2, ID3, ID4) given by the LSTM model is ID5. The distance between the actual point and the prediction is calculated by the deviation distance, which is 11.6 meters. Then ID5 is added to the location sequences and a new sequence (ID1, ID2, ID3, ID4, ID5) is imported to the model. The output of the model is 11.5 m away from the actual point. The process is repeated and the results are listed in Table 11. All seven locations in the ground truth are successfully predicted because the deviation distance is relatively small. The seven predicted locations are drawn step by step with different colors in Figure 19c. The LSTM model will continuously predict even though the raw trajectory has ended. The next five locations are shown in Figure 19d.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Datasets** & \begin{tabular}{c} **Data Quantity** \\ **(Number of Samples)** \\ \end{tabular} & **Precision** & **Recall** & **F-Score** & \
\begin{tabular}{c} **Training Time** \\ **(s)** \\ \end{tabular} &
\begin{tabular}{c} **Predicting Time** \\ **(s)** \\ \end{tabular} \\ \hline \multirow{6}{*}{Courier} & 20\% & 2187 & 0.8505 & 0.8528 & 0.8468 & 46.38 & 1.29 \\  & 40\% & 4375 & 0.8834 & 0.8791 & 0.8749 & 78.89 & 1.33 \\  & 60\% & 6563 & 0.8844 & 0.8824 & 0.8794 & 112.04 & 1.44 \\  & 80\% & 8751 & 0.8830 & 0.8750 & 0.8722 & 144.51 & 1.36 \\  & 100\% & 10939 & 0.8975 & 0.8890 & 0.8874 & 205.73 & 1.43 \\  & 20\% & 8996 & 0.7331 & 0.7381 & 0.7191 & 146.13 & 3.70 \\  & 40\% & 17992 & 0.8199 & 0.8171 & 0.8067 & 276.48 & 3.73 \\  & 60\% & 26989 & 0.8455 & 0.8417 & 0.8338 & 404.66 & 3.85 \\  & 80\% & 35985 & 0.8540 & 0.8521 & 0.8430 & 532.62 & 3.98 \\  & 100\% & 44982 & 0.8605 & 0.8571 & 0.8511 & 654.92 & 4.29 \\ \hline \hline \end{tabular}
\end{table}
Table 10: The influence of data quantity on the performance of the LSTM models on two datasets.