# A Spatial-Temporal-Semantic Neural Network Algorithm for Location Prediction on Moving Objects
## 4 Experiments
### Evaluation Based on External Comparison  
In this section, the STS feature extraction method is compared with Geohash, and the LSTM-based model is compared separately with several classic models. First, the Geohash partitioning algorithm is implemented to transform trajectory into cells. The optimal parameter of the Geohash is set to 8, indicating that the side length of a cell is 19 m. The size of time bin and the distance threshold in the courier dataset are set to 16 s and 10 m, which become 30 s and 50 m in the MTA bus dataset. \(maxLength\) of the location sequence is set to 20 and other parameters of the model are fixed during the comparison. The result is shown in Table 8.  
Furthermore, to evaluate the performance of the LSTM model, several classic models are used for comparison. The HMM model is implemented in Python. Optimal parameters are set as follows: \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multicolumn{2}{c}{**Parameter**} & & & \\ \hline
**Time Bin Size** & **Distance Threshold** & **Precision** & **Recall** & **F-Score** \\ \hline \multirow{4}{*}{8 s} & 5 m & 0.9150 & 0.9169 & 0.9130 \\  & 10 m & 0.9277 & 0.9252 & 0.9228 \\  & 15 m & 0.9286 & 0.9306 & 0.9267 \\  & 5 m & 0.8863 & 0.8803 & 0.8785 \\  & 10 m & 0.8975 & 0.8890 & 0.8874 \\  & 15 m & 0.8945 & 0.8863 & 0.8855 \\  & 5 m & 0.8474 & 0.8396 & 0.8369 \\  & 10 m & 0.8612 & 0.8611 & 0.8564 \\  & 15 m & 0.8704 & 0.8688 & 0.8666 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: The evaluation results of prediction with different parameter settings of the courier dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multicolumn{2}{c}{**Parameter**} & & & \\ \hline
**Time Bin Size** & **Distance Threshold** & **Precision** & **Recall** & **F-Score** \\ \hline \multirow{4}{*}{30 s} & 50 m & 0.8605 & 0.8571 & 0.8511 \\  & 100 m & 0.8656 & 0.8633 & 0.8603 \\  & 150 m & 0.8742 & 0.8688 & 0.8652 \\  & 50 m & 0.8295 & 0.8204 & 0.8187 \\  & 100 m & 0.8369 & 0.8257 & 0.8235 \\  & 150 m & 0.8434 & 0.8324 & 0.8302 \\  & 50 m & 0.8118 & 0.8021 & 0.7965 \\  & 100 m & 0.8220 & 0.8117 & 0.8068 \\  & 150 m & 0.8301 & 0.8189 & 0.8114 \\ \hline \hline \end{tabular}
\end{table} 
Table 7: The results of prediction with different parameter settings of the MTA bus dataset. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multicolumn{2}{c}{**Datasets**} & **Methods** & **Avg Deviation Distance (Meters)** & **Precision** & **Recall** & **F-Score** \\ \hline \multirow{3}{*}{**Courier**} & Geohash & 53.09 & 0.8377 & 0.8256 & 0.8234 \\  & STS Feature & 9.51 & 0.8957 & 0.8890 & 0.8874 \\ \cline{1-1}  & Geohash & 53.12 & 0.6734 & 0.6648 & 0.6650 \\ \cline{1-1}  & STS Feature & 3.35 & 0.8605 & 0.8571 & 0.8511 \\ \hline \hline \end{tabular}
\end{table} 
Table 8: The precision of prediction between Geohash and STS feature extraction on two datasets. the cost used in the forward part of the forward-backward algorithm is set to \(0.1\), \(learningRate=0.01\), \(maxIteration=100\). The XGBoost method is implemented in Python by the \"XGBoost\" package. The tuning parameters in XGBoost are \(numRound\), \(eta\), \(maxDepth\), \(scalePosWeight\), \(minChildWeight\), etc. Five-fold cross-validation is used to tune the parameters. Parameter tuning method can be found in [36] in detail. Optimal parameters are set as follows: \(numRound=500\), \(eta=0.05\), \(maxDepth=6\), \(scalePosWeight=5\), \(minChildWeight=1\). RNN and LSTM are implemented in Python using the \"Keras\" package. As introduced in Section 3.2, RNN and LSTM have similar ideas of the hidden loop layer but LSTM is more complicated. There exists similarities in the parameter setting of RNN and LSTM. They both share the activation function as \(tanh\) and \(learning\ rate=0.05\). To avoid over-fitting, the dropout of each layer is set to \(0.2\). The categorical cross-entropy is selected as the loss function and the RMSprop algorithm is utilized to update the weights. \(Batch\ size\) defines the number of samples that are going to be propagated through the network and is set to \(100\).