# On Evaluating IoT Data Trust via Machine Learning
## 6 Discussion
### Previous Work  
A common existing approach to evaluate IoT data trust is to train supervised ML classification models, such as SVM, using datasets that are labeled via \(k\)-means clustering. That is, after clustering the unlabeled data, each data instance is given a label according to its assigned cluster. To shed some light onto the efficacy of this approach, we present the accuracy of prediction using the \(k\)-means cluster assignments as well as prediction using SVM trained on labels obtained from \(k\)-means clustering in Figure 5. The results show that \(k\)-means and SVM via \(k\)-means deliver near identical accuracy with the difference in accuracy being not greater than 2% for all considered feature sets and datasets.  
Training an SVM classifier on data annotated with labels induced by \(k\)-means clustering can logically be less effective compared to training an SVM classifier on data with ground-truth labels. According to the results in Figure 5, an SVM classifier trained on the labels inferred from \(k\)-means clustering yields similar accuracy to a classifier that uses the cluster boundaries determined by \(k\)-means clustering to infer the class label. This is because, in the absence of ground-truth data trust labels, an SVM or any other classification model fit to the clustering-induced labels is essentially redundant as it only approximates the cluster boundaries. To demonstrate this, in Figure 7, we provide a UMAP visualization of the decision boundaries produced by \(k\)-means clustering and an SVM classifier trained on labels predicted by \(k\)-means clustering when using the correlation features extracted from a dataset augmented via RWI. The figure also includes the representation of the utilized datasets as in Figure 4. We observe from Figure 7 that the decision boundaries yielded by the two approaches are very similar, which corroborates the futility of fitting any classifier, particularly linear SVM, over the data labeled via clustering.  
In Figure 5, we observe that the DST features result in less accurate models compared to the proposed correlation features, which can capture spatiotemporal patterns and correlations in the data. The DST features also yield lower generalization ability as seen in Figure 6. This is likely because the DST features do not fully take into account the temporal correlation within the data. Therefore, they cannot faithfully represent the temporal patterns, trends, or behaviors that may be indicative of the trustworthiness of the data. This is more prominent when synthetic untrustworthy data are generated via the RWI method, as seen in Figure 5.  
The DST features lead to improved performance when the untrustworthy data are synthesized via the Drift method. However, they are still outperformed by the correlation features on the same data. When the training and evaluation are performed on datasets augmented with untrustworthy data synthesized using the same method, the correlation features deliver higher accuracy compared with the DST features in all considered cases. Additionally, when using correlation features, models trained on datasets containing synthetic RWI data can classify unseen data synthesized via Drift with little loss of performance with respect to models trained on datasets containing synthetic Drift data. On the other hand, models trained on datasets augmented via the Drift method do not generalize well to datasets containing synthetic data generated by the RWI method, regardless of the feature set utilized. This attests to the superiority of RWI over Drift in terms of utility or effectiveness.