# Enhancing Data Integrity in Blockchain Oracles Through Multi-Label Analysis
## 3 Methods
### Selection of Methods and Evaluation Based on State-of-the-Art Metrics
Among them, the following were considered: Bagging (RandomForest), which generates multiple versions of the classifier by averaging the results to improve accuracy; Gradient Boosting and XGBoost, both sequential boosting approaches that iteratively optimize errors; Extra Trees, a variant of RandomForest that introduces more randomization to prevent overfitting; Random Subspace, which applies Bagging to random subsets of features; and RUSBoost, designed to handle imbalanced datasets by combining undersampling and boosting. These techniques were compared regarding precision, recall, F1 score, hamming accuracy, and exact match ratio to determine the most effective data integrity detection. After evaluating each of the proposals using different metrics see Figure 4, it was determined that following the ANOVA analysis of the classification algorithms, which included Bagging (RF), Boosting (GB), Boosting (XG), Extra Trees, Random Subspace, and RUSBoost, an F-statistic of 15.05 and a \(p\)-value of \(9\times 10^{3}\) were obtained, indicating significant differences among the evaluated models. Bagging (RF) stood out as the best model, achieving an average score of 0.83, significantly surpassing the other algorithms, whose average scores ranged from 0.70 to 0.78 [39]. This superior performance suggests that Bagging (RF) can remarkably reduce variance and improve accuracy. Given the significant differences found, it is recommended to use Bagging (RF) as the preferred option for classification tasks in the context of data integrity. Finally, the Bagging (RF) algorithm was evaluated using hard and soft voting techniques to determine which technique better supports the algorithm's solutions. These  
Figure 5: Evaluation results of ensemble algorithms for data integrity assessment. techniques help improve the model's accuracy and robustness by combining the predictions of multiple classifiers. Hard voting uses the most votes from the classifiers to make the final decision, selecting the class that receives the most votes, which is effective when individual classifiers have similar performance and a more stable solution is sought. On the other hand, soft voting considers the probabilities of each class predicted by the classifiers, deciding based on the sum of these probabilities. It can improve performance when some classifiers are more reliable than others. After evaluating the models, it is established that, after implementing voting techniques in the Bagging method with Random Forest (RF), the analysis of the voting methods reveals that hard voting outperforms soft voting in terms of performance (see Figure 6), which is reflected in the evaluated metrics. ANOVA analysis allowed us to determine that the differences in the results are statistically significant, as indicated by a t-statistic of 5.97 and a \(p\)-value of 0.0019. It suggests that the hard voting method is preferable and performs better than soft voting in this context. Identifying the characteristics that affect the quality and reliability of the data is fundamental for sound decision making. In this regard, hard voting can significantly improve the accuracy of the solutions implemented to assess data integrity [40] by demonstrating better classification performance. A Hybrid Approach for Evaluating Data Integrity in ML Models Based on the Results of the Model Evaluation  
These models are available externally and are used when the smart contract requires validating the integrity of the data. A multi-level weighted voting technique combines the predictions of multiple models and makes a final decision.