## 4 Methodology
### Repeat steps (b) and (c) until convergence.
In the online stage, RSS values from the available WLAN APs are initially translated through BoF, and then the KNN classification algorithm is applied to estimate the indoor location of the test device. For comparison, we employ simple KNN, probabilistic, SVM, DT, ensemble learning-based classification, and DAC, with the proposed BoF-assisted KNN outperforming comparatively. The virtual 30 m \(\times\) 30 m environment is tested using the BoF-based indoor positioning approach. The proposed BoF approach provides an MAE of 1.702 m, which is lower than \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Scenario** & **Dimensions** & **APs** & **Coordinates of APs** \\ \hline Scenario 1 & 30 m \(\times\) 30 m & 4 APs & (25, 25) (19, 23) (13, 27) (11, 7) \\ \hline Scenario 2 & 50 m \(\times\) 50 m & 5 APs & (25, 25) (37, 25) (25, 19) (28, 13) (16, 25) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: WLAN access point configurations. Figure 4: Floor map with 30 m by 30 m dimensions. Figure 5: Floor map with 50 m by 50 m dimensions. that of the other models. The MAEs of KNN, probabilistic, SVM, DT, ensemble learning-based classification, and DAC are shown in Table 3 and are higher than our proposed BoF approach. The CDF plot of this simulated environment is shown in Figure 6.

In addition, the proposed BoF approach is validated on a virtual environment of dimensions 50 m \(\times\) 50 m, resulting in an MAE of 2.837 m, which is approximately 1.1 m less than the second-best KNN classification model. The MAEs of the other methods are shown in Table 4. Moreover, the CDF plot of this environment is shown in Figure 7. It can be noted that the CDF plot shows our model outperforms previously reported methods. ### Real-Time Testbed Experiment

All experiments are performed inside a residential building between two adjacent apartments. These two apartments have a living room and a bedroom each. The floor map of the area can be seen in Figure 8. This area is divided into two regions, namely, Region A and Region B, with dimensions of 3.95 m \(\times\) 11.1 m and 8.4 m \(\times\) 9.3 m, respectively. In this environment, we label a total of 30 RPs for the site survey, in which 10 RPs are in Region A and 20 RPs are in region B, with grid spacing of two meters, as shown in Figure 9. This experimental environment is less crowded and remains the same throughout the day, with no significant change. A Huawei smartphone (model: KIN-L21) with an android application installed [52] is used to collect Wi-Fi RSS data from five TPlink A1200 APs (notated as AP1 to AP5) for 25 s at each RP with 20 RSS samples. The details of this environmental setup along with photos of the hardware devices used for the real-time experiment can be seen in Figure 10. In a similar way, 10 TPs are also labeled for testing, where 3 TPs belong to Region A, and 7 TPs belong to Region B. The MAE obtained by BoF in the real environment is 1.581 m, which is 0.19 m lower than that of the KNN model. The MAEs of KNN, probabilistic, SVM, DT, ensemble learning-based classification, DAC, and the proposed model are given in Table 5, and the CDF plot can be seen in Figure 11.

## 6 Conclusions

The indoor positioning framework presented in this article enhances the reliability of positioning accuracy. The proposed BoF model transforms the raw RSS of the access points into robust and distinctive features with reduced localization error. Experimental validation of the proposed BoF integrated with KNN tested on both virtual and real-time testbeds shows promising performance. The proposed approach scores 1.702 m, 2.837 m, and 1.581 m mean absolute error on the simulated 30 m \(\times\) 30 m and 50 m \(\times\) 50 m and the real-time residential apartment environment, respectively, indicating lower error than other methods. Moreover, the CDF graphs clearly show the performance of our proposed approach remains more robust and distinct than state-of-the-art models, even in the presence of environmental artifacts.