## 5 Discussion  
In our study, we aimed to predict high-risk events, like AF and CEs, in hypertensive patients using DL and TL methodologies, leveraging synthetic data generation to address the challenge of small datasets. The results obtained, from testing both models on real datasets, showed the promising quality of the synthetic data and its ability to generalize on unseen data. Furthermore, with the limited real data testing set of the CE dataset, we showed the value of transfer learning. By freezing one layer from the AF model, we transferred a basic understanding of the HRV data to help in the training of another task, namely predicting severe cardiovascular events. The evaluation results demonstrated the effectiveness of the models in discriminating between individuals with and without a risk of developing AF/CEs, with moderate to high performance across different metrics. Confusion matrices provided insights into the models' predictive capabilities, highlighting their ability to accurately classify patients based on their cardiac health status. The model decision criteria were consistent with those presented in the literature; in fact, the most predictive features, listed in Figures A1 and A2 in Appendix A, were mainly related to the frequency group, such as VLF, low frequency (LF), and high frequency (HF). Our results can be understood in the context of the comparable studies summarized in Table 8. Other AI-based models have been tested for similar purposes, showing promising performance. However, a weakness in most cases is that different preprocessing steps are executed before splitting the data into training and test sets, leading to classification results being reported on the same data used to extract insights for class differentiation. For example, improperly applying undersampling or oversampling techniques, such as performing these steps before splitting the data, can introduce bias into an algorithm's predictive performance. Our model achieved an accuracy of 82% for CE prediction. This performance is on par with other leading methods. For instance, [PERSON] et al. [20] utilized a random forest model for cardiovascular event prediction using HRV data, achieving a sensitivity, specificity, and accuracy of 71.4%, 87.8%, and 85.7%, respectively. Their model demonstrated effective early risk prediction, and our approach further enhances the overall stratification by integrating synthetic data and transfer learning techniques. Similarly, [PERSON] et al. [21] employed the RUSBOOST algorithm to predict cardiovascular events, achieving an accuracy of 97.08% and an F1 score of 86.67%. Both their study and ours used balanced datasets with undersampling techniques to address the class \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Trained on** & **Classes** & **Precision** & **Recall** & **F1-Score** & **Specificity** & **AUROC** \\ \hline (1) Synthetic + Real data & (Without CE) & 0.83 & 0.83 & 0.83 & 0.80 & 0.82 \\  & (Diagnosed with CE) & 0.80 & 0.80 & 0.80 & 0.80 & 0.82 \\ \hline (2) Real data & (Without CE) & 0.80 & 0.67 & 0.73 & 0.67 & 0.73 \\  & (Diagnosed with CE) & 0.67 & 0.80 & 0.73 & 0.67 & 0.73 \\ \hline (3) No Transfer Learning & (Without CE) & 0.56 & 0.83 & 0.67 & 0.50 & 0.52 \\  & (Diagnosed with CE) & 0.50 & 0.20 & 0.29 & 0.50 & 0.52 \\ \hline \hline \end{tabular}  
* Precision: The proportion of true positives among the predicted positives. Measures accuracy in positive predictions. Recall (Sensitivity): The proportion of true positives among the actual positives. Indicates the ability to detect positive instances. F1-Score: The harmonic mean of precision and recall. Balances precision and recall in a single metric. Specificity: The proportion of true negatives among the actual negatives. Reflects the ability to correctly identify negatives. AUROC (Area Under Receiver Operating Characteristic Curve): A summary of the trade-off between true positive rate and false positive rate across all thresholds. Measures overall classification performance.  
\end{table}