# Application of Online Transportation Mode Recognition in Games
## 5 Results
### Transportation Mode Data Sampling, Offline Classification Training Models, and Prediction
\begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline
**a** & **b** & **c** & **d** & **e** & **f** & **g** & **h** & **i** & **j** & **TP Rate** \\ \hline
1786 & 166 & 107 & 112 & 30 & 50 & 61 & 28 & 164 & 96 & a—TP 68.7 Idle \\ \hline
80 & 2348 & 67 & 403 & 38 & 268 & 151 & 15 & 76 & 128 & b—TP 65.7 Bus \\ \hline
75 & 94 & 1290 & 47 & 67 & 14 & 37 & 11 & 35 & 34 & c—TP 75.7 Foot \\ \hline
60 & 395 & 51 & 2593 & 57 & 342 & 143 & 9 & 53 & 110 & d—TP 68.0 Car \\ \hline
29 & 25 & 107 & 64 & 600 & 6 & 23 & 1 & 2 & 6 & e—TP 69.5 Bike \\ \hline
31 & 280 & 23 & 281 & 5 & 1651 & 99 & 32 & 74 & 213 & f—TP 61.4 Train \\ \hline
21 & 179 & 31 & 228 & 18 & 108 & 653 & 3 & 63 & 5 & g—TP 49.9 Tram \\ \hline
40 & 123 & 21 & 23 & 2 & 47 & 24 & 127 & 28 & 9 & h—TP 28.6 Subway \\ \hline
42 & 99 & 14 & 31 & 0 & 68 & 49 & 4 & 956 & 11 & i—TP 75.0 Boat \\ \hline
71 & 161 & 22 & 177 & 20 & 229 & 22 & 6 & 36 & 2082 & j—TP 73.7 Plane \\ \hline \end{tabular}
\end{table} 
Table 5: Confusion matrix for the classes (10-fold, RF). A comparative analysis of Table 6 reveals that the accuracy for the four machine-learning approaches (10-fold cross-validation) decreases with an increase in HSS sizes (starting from size 10 to 50). However, the results for two-fold cross-validation are rather inconclusive. Random forest performs the best for both 10-fold and two-fold cross-validation followed by random tree while naive Bayesian is the worst performing machine-learning approach. Table 8 presents the confusion matrix for the best performing classification results (two-fold cross-validation, RF, HSS 20). Note that almost all classes have now reached over 95% classification TP rate, with the exception of subway (which is under-sampled and is misclassified as bus) and tram (which is also relatively under-sampled and misclassified as bus or car). The performance of all classifiers is lower than those results presented by [PERSON] and colleagues, but the same ranking of classifiers is shown, where RF performs best, followed by RT, BN, and NB (84%, 80%, 78%, and 54% accordingly in their results) [36]. Some possible reasons for the lower accuracy rates are less samples for training and testing (roughly half), less total time for the corresponding samples (each sample recorded by [PERSON] et al. is an average of 10 s vs. our 5 s), and the increased number of classes (10 instead of seven). Table 9 shows the confusion matrix for the best results when using normalized acceleration values (two-fold cross-validation, RF, HSS 30). Most transportation modes have TP rates above 90%, with the exception of train, tram, and subway, all of which misclassified as bus or car. Table 10 depicts the training and prediction times required by the various classifiers when run on a laptop (featuring an Intel Core i7-4700 MQ CPU @ 2.40 GHz). While training the classifiers on the target development Android device (a Sony Xperia Z3 Compact), the corresponding training times are multiplied by a factor of more than 5, making the random forest classifier eventually unsuitable for iterated testing (i.e., training the classifier would take minutes instead of seconds). The table specifically shows the total time required to train the classifiers and predict all values when performing the 10-fold cross-validation with and without using the historical set (HSS 0 and 50). All time values presented are in \begin{table}
\begin{tabular}{c c c c c c c c} \hline
**Classifier** & **HSS 0** & **HSS 10** & **HSS 20** & **HSS 30** & **HSS 40** & **HSS 50** \\ \hline
**Random Forest** & 65\% & 93\% & 95\% & 95\% & 94\% & 93\% \\ \hline
**Random Tree** & 54\% & 89\% & 91\% & 93\% & 94\% & 94\% \\ \hline
**Bayesian Network** & 48\% & 73\% & 78\% & 79\% & 79\% & 79\% \\ \hline
**Naïve Bayesian** & 29\% & 34\% & 36\% & 37\% & 38\% & 38\% \\ \hline \end{tabular}
\end{table} 
Table 7: Classifier results for 2-fold cross-validation (RF) for varying historical set sizes (HSS).