# A Fast Indoor/Outdoor Transition Detection Algorithm Based on Machine Learning
## 3 Results
### Refined Classifier Performance Evaluation  
#### 3.2.1 Accuracy Evaluation of Different Features and Models  
We evaluated the accuracy of five single classification models including RF, SVM, AdaBoost, XGB and LGB, as well as a classification model based on stacking ensemble and a stacking model with HMM in four datasets. The detection accuracy was compared under different kinds of features including only statistical features in different sliding window length k, only spatial geometry distribution features; only time sequence features in different sliding window length k and a combination of the above features. Tables 5-8 show the comparison results on Dataset_1, Dataset_2, Dataset_3 and Dataset_4, respectively. \begin{table}
\begin{tabular}{l} Mate 8-3, Vivo 39-2, \\ Mate 9-3, Honor 8-2 \\ \end{tabular} & IO Transition \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The detail distribution of the datasets we segment. From Tables 5-8, we obtained the following conclusions:  
* The stacking model with HMM performed best on four datasets overall. The accuracy of dataset_1, dataset_2, dataset_3 and dataset_4 were 0.9911, 0.9453, 0.9702 and 0.9280, respectively. Furthermore, SVM obtained the lowest accuracy in almost all experiments, the accuracy of LightGBM was superior to other single classification model and slightly lower than the stacking model with HMM in most experiments. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Model** & **S1** & **S3** & **S5** & **SD** & **TS2** & **TS3** & **TS5** & **S\&SD\&TS** \\ \hline RF & 0.9312 & 0.9312 & 0.9290 & 0.8047 & 0.8401 & 0.8527 & 0.8661 & 0.9451 \\ SVM & 0.9155 & 0.9082 & 0.9032 & 0.8085 & 0.7784 & 0.8101 & 0.8228 & 0.9350 \\ AdaBoost & 0.9299 & 0.9296 & 0.9283 & 0.7877 & 0.8411 & 0.8540 & 0.8673 & 0.9413 \\ XGB & 0.9323 & 0.9303 & 0.9290 & 0.8106 & 0.8456 & 0.8620 & 0.8744 & 0.9431 \\ LGB & 0.9342 & 0.9310 & 0.9290 & 0.8041 & 0.8437 & 0.8621 & 0.8722 & 0.9446 \\ Stacking & 0.9320 & 0.9313 & 0.9293 & 0.8043 & 0.8484 & 0.8620 & 0.8738 & 0.9435 \\ Stacking & & & & & & & & \\ \&HMM & **0.9344** & **0.9332** & **0.9295** & **0.8132** & **0.8501** & **0.8644** & **0.8752** & **0.9453** \\ \&HMM & & & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Indoor/Outdoor detection accuracy using different features and models on Dataset_2. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Model** & **S1** & **S3** & **S5** & **SD** & **TS2** & **TS3** & **TS5** & **S\&SD\&TS** \\ \hline RF & 0.9256 & 0.9247 & 0.9267 & 0.7923 & 0.8394 & 0.8572 & 0.8669 & 0.9632 \\ SVM & 0.9273 & 0.9238 & 0.9300 & **0.8186** & 0.8657 & 0.8683 & 0.8673 & 0.9155 \\ AdaBoost & 0.9290 & 0.9263 & 0.9282 & 0.7796 & 0.8378 & 0.8558 & 0.8652 & 0.9689 \\ XGB & 0.9323 & 0.9278 & 0.9303 & 0.7938 & 0.8577 & 0.8740 & 0.8777 & 0.9648 \\ LGB & **0.9319** & 0.9263 & 0.9287 & 0.7960 & **0.8624** & 0.8762 & 0.8760 & **0.9710** \\ Stacking & & & & & & & & \\ Stacking & & & & & & & & \\ \&HMM & & & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 7: Indoor/Outdoor detection accuracy using different features and models on Dataset_3. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline
**Model** & **S1** & **S3** & **S5** & **SD** & **TS2** & **TS3** & **TS5** & **S\&SD\&TS** \\ \hline RF & 0.9864 & 0.9847 & 0.9851 & 0.9646 & 0.8813 & 0.8932 & 0.9019 & 0.9900 \\ SVM & 0.9787 & 0.9756 & 0.9763 & **0.9662** & 0.8557 & 0.8588 & 0.8594 & 0.9852 \\ AdaBoost & 0.9875 & 0.9856 & 0.9853 & 0.9439 & 0.8818 & 0.8929 & 0.9009 & 0.9909 \\ XGB & 0.9858 & 0.9841 & 0.9848 & 0.9590 & 0.8919 & 0.8980 & 0.9072 & 0.9900 \\ LGB & 0.9889 & **0.9873** & 0.9857 & 0.9593 & 0.8822 & 0.9027 & 0.9102 & 0.9902 \\ Stacking & & & & & & & & \\ \&HMM & & & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Indoor/Outdoor detection accuracy using different features and models on Dataset_1. * The different sliding window size influenced the accuracy of different datasets.