# Internet of Things for Sensing: A Case Study in the Healthcare System
## 6 Results and Discussion
### Classification Results
#### 6.1.3. Results Obtained Using SVM, KNN, and RF Classifiers  
The KNN and RF classifiers were trained and tested using 120 samples. The confusion matrices obtained for SVM, KNN, and RF classifiers are shown in Table 4, respectively.  
Based on these confusion matrices, we have obtained the values of six performance metrics as shown in Table 5.  
Table 5 shows the accuracy, precision, recall, specificity, F-measure, and Kappa values obtained using support vector machine. In the earlier section, we discussed the percentage accuracy using three kernel functions considering 10 SVM features. The accuracy presented in Table 5 is obtained using the RBF kernel function considering 10 SVM features, as shown in Table 3. The precision for all five human activities is more than 90%, while for sleep attack, it is 94%. The recall values received using SVM vary between 91% and 94.4%. The specificity obtained is more than 96% for all activities. The F-measure values also vary between 90% and 95.4%. The average [PERSON]'s Kappa coefficient value obtained for all five human activities is 0.925. Table 5 indicates the six performance metrics received using KNN classifier. The accuracy for sitting, walking and squatting is 94.8%, 92.8%, and 90.2%, respectively.  
The accuracy rate for push-ups, and sleep attack is 86.6% and 88.5%, respectively. The precision values for walking and squatting are below 90%, while the rest of the three are above 90%. The recall values for push-ups and sleep attacks are 86.6% and 88.6%, respectively. The other three values are above 90%. The specificity is more than 90% for all five human activities. The F-measure values for all human activities are near to 90% except squatting activity (87%). The average Cohen's Kappa coefficient for all five activities is 0.811.  
We further examine the results obtained using random forest algorithm as shown in Table 5. The accuracy rate for sitting and walking is approximately 87%. For push-ups, the accuracy is 88.1%, while for squatting and sleep attacks, the accuracy rate is approximately 91%. Looking at the precision values, sitting has a received value of 87.5%, walking has 80.0%, and the rest have received values of  
\begin{table}  
\end{table}
Table 4: Classification results considering different approaches.  
\begin{table}  
\end{table}
Table 5: Classification results..  
more than 90%. The recall value for sitting and walking is approximately 87%, the push-ups value is 88.1%, and for squatting and sleep attacks, the value is approximately 91%. The specificity for all five human activities is more than 94%. The F-measure value for sitting and walking activity is 84.4% and 83.4%, respectively, while the value for value is more than 90% for the rest of the three activities. The average Cohen's Kappa coefficient for all five human activities is 0.865%.  
When we compare the values of all the six performance parameters, it is observed that the SVM algorithm provides the best results as compared to the other two classification techniques. All the values of the six performance metrics considering five human activities are more than 90%, except for of walking, which is 84.1%. As far as the KNN and RF classifiers are concerned, there are multiple instances where the values of the performance metrics are below 90%.