## 4 Results
### Attention Maps' Analysis  
While in Approach 0, no attention maps could be extracted, they were available in the rest of the approaches (in Approach 1, exclusively in the time domain). Figure 3 shows each time period's contribution to the outcome across approaches. Simpler input feature processing methods (i.e., only time attention, or those with none or FC layers in Approaches 2 and 3) assigned similar attention weights to all time periods, while those with higher  
\begin{table}
\begin{tabular}{l c c c c c} \hline \hline
**Architecture** & **Cohen’s Kappa** & **PR-AUC** & **Precision** & **Recall** & **ROC-AUC** \\ \hline Approach 0—Without attention & 0.81 (0.003) & 0.77 (0.003) & 0.88 (0.004) & 0.82 (0.003) & 0.89 (0.001) \\ \hline Approach 1—Time attention & & & & & \\ Linear Reg. + no final Tanh (1) & 0.79 (0.003) & 0.75 (0.004) & 0.87 (0.003) & 0.82 (0.002) & 0.89 (0.001) \\ No linear Reg. + final Tanh (2) & 0.79 (0.003) & 0.76 (0.004) & 0.87 (0.003) & 0.82 (0.002) & 0.89 (0.002) \\ Linear Reg. + final Tanh (3) & 0.5 (0.3) & 0.53 (0.2) & 0.58 (0.3) & 0.87 (0.05) & 0.79 (0.09) \\ No linear Reg. + no final Tanh (4) & 0.6 (0.3) & 0.6 (0.2) & 0.68 (0.3) & 0.85 (0.05) & 0.82 (0.09) \\ \hline Approach 2—Domain-specific attention & & & & & \\ None & 0.7 (0.2) & 0.68 (0.2) & 0.78 (0.2) & 0.83 (0.04) & 0.85 (0.07) \\ Dense & 0.7 (0.2) & 0.68 (0.2) & 0.78 (0.2) & 0.83 (0.04) & 0.85 (0.07) \\ GRU & 0.7 (0.2) & 0.69 (0.2) & 0.79 (0.2) & 0.83 (0.04) & 0.86 (0.08) \\ Down-sampling CNN & 0.7 (0.2) & 0.68 (0.2) & 0.78 (0.2) & 0.83 (0.04) & 0.85 (0.07) \\ Down-Up CNN & 0.6 (0.3) & 0.61 (0.2) & 0.69 (0.3) & 0.85 (0.05) & 0.82 (0.09) \\ \hline Approach 3—Hierarchical attention & & & & & \\ None & 0.28 (0.03) & 0.35 (0.2) & 0.39 (0.01) & 0.75 (0.2) & 0.69 (0.04) \\ Dense & 0.45 (0.09) & 0.45 (0.05) & 0.57 (0.1) & 0.66 (0.1) & 0.74 (0.01) \\ GRU & 0.61 (0.2) & 0.61 (0.2) & 0.69 (0.3) & 0.85 (0.04) & 0.82 (0.1) \\ Down  
complexity (e.g., CNN, GRU) managed to distribute them, assigning higher weights to those closer to the prediction time. This aligns more with clinical plausibility, especially in older, frail patients, where death often follows abrupt changes. Figures 4 and 5 show each feature's contribution to the outcome, calculated by domain-specific (Approach 2) and hierarchical attention (Approach 3) methods, respectively. While domain-specific attention offers an overall attention per feature, hierarchical attention provides feature contributions per time period. This last approach, giving different weights to each type of event and different weights to each event in different periods, closely mirrors actual clinical reasoning during patient assessment, generating more informative and realistic attention maps than Approach 2. Figure 3: Attention maps on the time domain for all the architectures, by approach. The higher the number on the x-axis, the closer to the moment when the prediction was performed. The attention weights shown here are the results of averaging the attention weights of every patient on the test set. Similarly, simpler input feature processing methods (e.g., FC layer) failed to distribute attention weights among features in both approaches, assigning low weights uniformly. On the other hand, GRU, down-sampling CNN, and down-up CNN achieved a better distribution among features. In Approach 3, the down-sampling CNN failed to distribute attention weights amongst time periods, lacking clinical plausibility, while the GRU or a down-up CNN achieved it in both time and feature domains. However, the GRU's feature processing yielded clinically more plausible attention weights compared to the down-up CNN, prioritizing chronic diagnoses (Y_NDiag), frailty deficits (Y_Frag_Score), and hospital admissions (Admissions_N). Figure 4: Attention weights on the feature domain for the domain-specific attention architectures (Approach 2). The attention weights shown here are the results of averaging the attention weights of every patient on the test set. The description of each feature can be found on our GitHub [41].