# Application of Online Transportation Mode Recognition in Games
## 5 Results
### Transportation Mode Data Sampling, Offline Classification Training Models, and Prediction  
To reiterate, for data gathering, a total of 21,096 time window features (or samples) were gathered, corresponding to 29 h and 18 min of data, divided into the transport classes depicted in Table 1. To justify the need of acceleration sample normalisation, some brief data on Android device orientation gravity measurements are presented in Table 2. The columns represent different volunteers' respective devices, with standard deviations presented both on a per-device and per-orientation basis. Note the increased deviations for the face right and face left orientations, which are common for devices placed in pants' pockets while sitting. To reiterate, four common machine-learning classification approaches are employed for this research. They are: random forest, random tree, Bayesian network, and naive Bayes. Criteria for selection are: extensive use (Bayesian network) [53]; easy and fast processing (naive Bayes [54]; random tree [55]); versatility (random forest [56]). Initial classifier results using 10-fold cross-validation and two-fold cross-validation for the four types of classifiers are shown in Table 3 where the first two columns are for without 'normalised accelerometer values' while the last two columns are with 'normalised accelerometer values' (to ensure device and orientation ambiguity). Results reveal that the random forest classifier has the highest accuracy while naive Bayes has the lowest accuracy. Table 4 presents the classification details for each class when performing the 10-fold cross-validation using random forest (RF). The worst performing classification is for the subway  
Table 6 shows the results when using 10-fold cross-validation, while Table 7 shows the results using two-fold cross-validation. Both tables present the classification results of the chosen classifiers using different sizes of the history set. Percentages displayed are the true-positive rates when using historical set sizes (HSS) ranging from 0 to 50. Highlighted are those results where the classification rate reached its highest point for that classifier. \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 & 67\% & 73\% & 55\% & 42\% & 35\% & 23\% \\ \hline Random Tree & 56\% & 69\% & 54\% & 42\% & 31\% & 24\% \\ \hline Bayesian Network & 48\% & 58\% & 48\% & 37\% & 28\% & 21\% \\ \hline Naive Bayesian & 29\% & 28\% & 24\% & 19\% & 16\% & 14\% \\ \hline \end{tabular}
\end{table} 
Table 6: Classifier results for 10-fold cross-validation for varying historical set sizes (HSS). \begin{table}
\begin{tabular}{c c c c c c c c c} \hline
**TP Rate** & **FP Rate** & **Precision** & **Recall** & **F-Measure** & **MCC** & **ROC Area** & **PRC Area** & **Class** \\ \hline
0.686 & 0.024 & 0.799 & 0.686 & 0.738 & 0.707 & 0.944 & 0.827 & Idle \\ \hline
0.650 & 0.85 & 0.590 & 0.650 & 0.618 & 0.544 & 0.899 & 0.688 & Bus \\ \hline
0.759 & 0.023 & 0.745 & 0.759 & 0.752 & 0.730 & 0.967 & 0.837 & Foot \\ \hline
0.681 & 0.082 & 0.647 & 0.681 & 0.664 & 0.587 & 0.916 & 0.761 & Car \\ \hline
0.684 & 0.012 & 0.707 & 0.684 & 0.695 & 0.683 & 0.970 & 0.763 & Bike \\ \hline
0.604 & 0.061 & 0.593 & 0.604 & 0.598 & 0.539 & 0.915 & 0.633 & Train \\ \hline
0.508 & 0.032 & 0.516 & 0.508 & 0.512 & 0.480 & 0.925 & 0.587 & Tram \\ \hline
0.288 & 0.006 & 0.520 & 0.288 & 0.371 & 0.378 & 0.904 & 0.365 & Subway \\ \hline
0.759 & 0.026 & 0.648 & 0.759 & 0.699 & 0.681 & 0.975 & 0.746 & Boat \\ \hline
0.707 & 0.037 & 0.765 & 0.707 & 0.735 & 0.692 & 0.938 & 0.813 & Plane \\ \hline \end{tabular} Key: TP—true positive; FP—false positive; MCC—Matthews correlation coefficient; ROC—receiver operating characteristic; PRC—precision recall curve.  
\end{table} 
Table 4: Detailed results by class of transportation mode (RF, 10-fold).