# Improved RSSI Indoor Localization in IoT Systems with Machine Learning Algorithms
## 5 Results and Discussion  
### Results  
For all the algorithms, FFNN, SVM and kNN, we calculated the performance evaluation matrices, precision, recall, and the f1-score, in each zone. Finally, we calculated the  
Figure 4: Testing accuracy vs. number of epochs.  
matrices of the entire dataset. The general definitions for each performance evaluation matrix are as follows:  
\[Accuracy=\frac{TP+TN}{TP+FP+FN+TN} \tag{15}\]  
\[Precision=\frac{TP}{TP+FP} \tag{16}\]  
\[Sensitivity=\frac{TP}{TP+FN} \tag{17}\]  
\[F1\text{-}Score=\frac{2\times(Sensitivity\times Precision)}{Sensitivity+ Presition} \tag{18}\]  
Without linearization and filtering, the model provided overall accuracies of approximately 77% for KNN, 70% for SVM and 42% for FFNN. Once the filters and linearization were applied, the precision of the FFNN varied from 0.50 to 0.71, the SVM from 0.75 to 0.88, and the kNN from 0.78 to 0.96. Additionally, for the recall, the FFNN was from 0.40 to 0.76, the SVM was from 0.74 to 0.90, and the kNN was from 0.81 to 0.96. For output-sensitive estimation such as localization, we required a high precision and recall. Overall, all the algorithms had over 83% precision and over 76% accuracy in location estimation. The zone-wise precision, recall and f1-score for the FFNN and SVM are presented in Tables 4 and 5, respectively, where the linear kernel used in the SVM had a gamma value of 0.001 and regularization parameter of 0.01. Table 6 shows the estimation performance zone-wise for the KNN algorithm.  
dataset and the due unavailability of RSSI filtering [18, 19, 20]. During the experiments, we considered the hyperparameter tuning of the SVM, kNN, and FFNN algorithms. For the SVM, the number of vectors was increased from 25 to 75. It can be observed that accuracy improves when the number of vectors in the SVM increases. Table 7 denotes the summary of performance for each algorithm. When increasing the vectors, it was observed that there was a significant improvement in the accuracy and f1-score. Overall, the kNN gave 0.8511 accuracies, and it outperformed the other algorithms.  
For FFNN, we adjusted the hyper-parameters, including the learning rate, batch size, and the number of epochs. It was observed that the training accuracy was consistently higher than the testing accuracy. Three distinct batch sizes, 10, 50, and 100, were used to test the training and testing accuracy. The epochs ranged from 0 to 100. Figures 4 and 5 display the outcomes. The kNN operates based on its proximity to training examples. In cases where the decision boundary is not highly complex and can be approximated well by a set of local regions, kNN can be effective. The FFNN and SVM might introduce unnecessary complexity in such scenarios. The practicality of implementing machine learning algorithms like the FFNN, k-NN, and SVM on IoT edge devices depends on factors like model complexity, computational resources, memory constraints, and the specific use case. While lightweight algorithms like k-NN are generally well-suited for edge deployment, more complex models like FFNN and SVMs may require careful optimization and the consideration of resource limitations. Additionally, model quantization, pruning, and approximate algorithms can be used to improve the feasibility of these algorithms on IoT edge devices.