# Construction and Completion of the Knowledge Graph for Cow Estrus with the Association Rule Mining
## 5 Validation of Association Rules
### Evaluation Metrics and Experimental Comparison  
We used four model evaluation metrics in our experiments, namely Precision, Recall, the reconciled mean of Precision and Recall (F1-Score), and Intersection over Union (IoU). Before analyzing, it is necessary to understand the definitions of the two types of samples: positive samples are samples that belong to a specific category, which is usually the focus of the study, while negative samples are samples that do not belong to that category. The specific meanings are shown in Table 8.  
True Positives (TP) are samples that were correctly predicted as positive. False Positives (FP) are samples that were incorrectly predicted as positive when they were actually negative. False Negatives (FN) are samples that were incorrectly predicted as negative when they were actually positive. True Negatives (TN) are samples that were correctly predicted as negative. Accuracy is the proportion of all predicted samples that are correctly categorized. \[\text{Accuracy}=\ \frac{\text{TP}+\text{TN}}{\text{TP}+\text{FP}+\text{TN}+ \text{FN}} \tag{6}\]  
Precision is defined as the proportion of true positive cases among all predicted positive cases, as shown in the formula below. \[\text{Precision}=\ \frac{\text{TP}}{\text{TP}+\text{FP}} \tag{7}\]  
Recall is the ratio of the number of positive classes predicted to be positive to the number of classes that are actually positive, as shown in the formula below. \[\text{Recall}=\ \frac{\text{TP}}{\text{TP}+\text{FN}} \tag{8}\]  
Fl-score is the reconciled mean of Precision and Recall, as shown in the formula below. \[\text{F1}-\text{score}=2\ \times\ \frac{\text{Precision}\times\text{ Recall}}{\text{Precision}+\text{Recall}} \tag{9}\]  
Through the comprehensive analysis of these metrics, this study comprehensively evaluated and compared the performance of the two Boolean function validation models, graph-based and rule-based, so as to select the most suitable method for practical application. \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Actual Positive** & **Actual Negative** \\ \hline Predicted Positive & TP & FP \\ Predicted Negative & FN & TN \\ \hline \hline \end{tabular}
\end{table} 
Table 8: The meaning of samples. To validate the effectiveness of these rules, we developed rule-based Boolean functions to assess the estrus status of cows. The results showed that the precision of estrus identification improved significantly with the introduction of lift, demonstrating the effectiveness of the optimized rules in various environments, as shown in Table 9.  
To further validate the effectiveness of the strong association rules, we conducted an experiment comparing the performance of the knowledge-graph-based approach with the association-rule-based approach. The experiment involved using Boolean functions derived from both the initial knowledge graph and the enhanced knowledge graph with strong association rules. As demonstrated in Table 9, we conducted an experiment to further validate the effectiveness of the strong association rules. The experiment compared the performance of two approaches: the knowledge-graph-based method and the association-rule-based method. The data used for the experiment were varied in size, including 200, 500, and 1000 data entries, which allowed us to assess the scalability and robustness of each approach. The results of this comparative analysis are depicted in Figure 11. This figure presents a visual representation of the performance metrics--accuracy, precision, recall, and F1 score--across both methods and different dataset sizes. It provides a clear and concise comparison that underscores the advantages of integrating strong association rules into the knowledge-graph-based approach, as evidenced by the improved performance metrics. The key findings are as follows: In terms of accuracy, the knowledge-graph-based approach with strong association rules consistently outperformed the initial knowledge-graph-based approach.