<figure><img src="image_1.png" /></figure>

HAL
open science

# Multi-Way adaptive Time Aware LSTM for irregularly collected sequential ICU data

Mamadou Ben Hamidou Cissoko, Vincent Castelain, Nicolas Lachiche

► To cite this version:

Mamadou Ben Hamidou Cissoko, Vincent Castelain, Nicolas Lachiche. Multi-Way adaptive Time Aware LSTM for irregularly collected sequential ICU data. Expert Systems with Applications, 2024, 261, pp.125548. 10.1016/j.eswa.2024.125548. hal-04941835

HAL Id: hal-04941835

https://hal.science/hal-04941835v1

Submitted on 12 Feb 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_3.png" /></figure>

<figure><img src="image_4.png" /></figure>

# Multi-Way adaptive Time Aware LSTM for irregularly collected sequential ICU data

Mamadou Ben Hamidou Cissoko<sup>a,*</sup>, Vincent Castelain<sup>b</sup>, Nicolas Lachiche<sup>a,1</sup>

## ARTICLE INFO

**Keywords:**

EHR (Electronic Health Records)
Irregular timing
Patient's health trajectory modeling
Personalized predictive medicine
Mortality & Length of stay prediction
Time series forecasting
Long-Short Term Memory (LSTM)

## ABSTRACT

In personalized predictive medicine, accurately modeling a patient's illness and care processes is essential, given their inherent long-term temporal dependencies. However, electronic medical records contain episodic and irregularly timed data due to patients visiting hospitals based on treatment needs, resulting in unique patterns for each hospital stay. Consequently, when constructing a personalized predictive model, it is crucial to consider these factors in order to accurately capture the patient's health journey.

To address this challenge, we present a novel deep dynamic memory neural network called Multi-Way adaptive Time Aware LSTM (MWTA-LSTM). The primary objective of MWTA-LSTM is to leverage medical records, memorize illness trajectories and care processes, estimate current illness states, and predict future risks, thereby providing a high level of precision and predictive power. To enhance its capabilities, MWTA-LSTM extends the conventional Long Short-Term Memory (LSTM) model in two key ways. Firstly, it incorporates frequency measurement and the most recent observation(last observation) to enhance personalized predictive modeling of patient illnesses, enabling a more accurate understanding of the patient's condition. Secondly, it parameterizes the cell state to handle irregular timing effectively, utilizing both frequency measurement and elapsed times. Furthermore, the model capitalizes on both to comprehend the impact of interventions on the course of illness on the cell state, facilitating the memorization of illness courses and improving its ability to capture the temporal dynamics of healthcare data, accommodating variations and irregularities in event and observation timing. Lastly, we introduce a novel adaptive pooling strategy that specifically targets and resolves outlier issues that can potentially occur during the analysis of EHR data. By incorporating these features, MWTA-LSTM significantly improves its ability to capture the temporal dynamics of healthcare data, accommodating variations and irregularities in event and observation timing.

We validate the effectiveness of our proposed model through empirical experiments conducted on two real-world clinical datasets and three real-world time series datasets. Our results demonstrate the superiority of MWTA-LSTM over current state-of-the-art models and other robust baselines. This showcases the potential of MWTA-LSTM in advancing personalized predictive medicine by offering a more accurate and comprehensive approach to modeling patient health trajectories.

## 1. Introduction

Medical history is a critical factor in clinical decision-making. Physicians rely on past patient information, including lab tests, procedures, medications, and diagnoses, to choose the best course of treatment. In essence, large, systematic, and longitudinal patient data sets are crucial in the healthcare industry.

The widespread adoption of Electronic Health Records (EHR) in hospitals has attracted significant interest from the machine learning community, aiming to develop evidence-based clinical decision-making tools through various ML algorithms (Xiao, Choi, & Sun, 2018). EHRs are digital records of patients' health information, storing heterogeneous data such as diagnoses, lab results, medications, and demographic information, as illustrated in (Fig. 1) using a sample of clinical

<footnote><sup>a</sup> University of Strasbourg, CNRS (ICube UMR 7357) - Engineering Science, Computer Science and Imaging Laboratory, 67412 Illkirch, Strasbourg, France</footnote>

<footnote><sup>b</sup> Medical Intensive Care Unit - Hautepierre Hospital, University Hospitals of Strasbourg, 67200 Strasbourg, France</footnote>

<footnote>* Correspondence to: The Engineering Science, Computer Science and Imaging Laboratory UMR 7357 (ICube), 300 bd Sébastien Brant - CS 10413 - F-67412 Illkirch, France.
E-mail addresses: mbhcissoko@unistra.fr (M.B.H. Cissoko), Vincent.CASTELAIN@chru-strasbourg.fr (V. Castelain), nicolas.lachiche@unistra.fr (N. Lachiche).</footnote>

<footnote n="1">¹ We express our gratitude for the support received from the French National Research Agency (ANR) project ArtIC - 20-THIA-0006 (Artificial Intelligence for Care), which made this work possible.</footnote>
<figure><img src="image_5.png" /><figcaption>**Fig. 1.** Heterogeneous time events. The sampling rates of different events vary considerably from each other.</figcaption></figure>

features. These records are characterized by non-uniform health trajectories and varying observation frequencies such as Mean Arterial Pressure (MAP), Heart Rate (HR), and Respiration Rate (RR), Blood glucose levels, which can differ among patients and within a patient's health journey. This variability and uneven timing pose challenges in extracting meaningful clinical patterns and developing precise models to accurately capture a patient's shifting health condition. For example, in stable patients, Mean Arterial Pressure (MAP) and Heart Rate (HR) may be measured hourly, while in unstable patients, these and other parameters may be measured more frequently. This dynamic nature of health trajectories necessitates tailored interventions to optimize patient outcomes, as illustrated in (Fig. 2), for a patient admitted twice to the ICU, with each stay showing a unique pattern. These trajectories highlight the dynamic nature of a patient's health status based on those critical features, therefore emphasizing the need for tailored interventions to optimize patient's outcomes. Therefore, when developing models to learn from a patient's temporal representation timeline, it is crucial to consider the data's heterogeneity and irregularity, along with the complex relationships between clinical events. This ensures that the model accurately reflects the patient's health status and provides valuable insights for clinical decision-making.

Existing methods often struggle with the complexities of EHR data, such as variable lengths and long-term dependencies (Jackson, Sharples, Thompson, Duffy, & Couto, 2003; Tran et al., 2014; Zhao, Papapetrou, Asker, & Boström, 2017). Temporal models based on the Markovian assumption fail to capture temporal irregularities and may forget significant past illnesses when irrelevant episodes are introduced (Rezende, Mohamed, & Wierstra, 2014). Other approaches focus on converting clinical observations into sequences of probability distributions, which may not adequately address the irregular nature of EHR data. Some methods (Che, Purushotham, Cho, Sontag, & Liu, 2018; Lipton, Kale, Elkan, & Wetzel, 2015; Purushotham, Meng, Che, & Liu, 2018) transform irregularly sampled data into regularly sampled time series by aggregating measurements into discrete intervals for each care episode, while others (Choi, Bahadori, Schuetz, Stewart, & Sun, 2016; Choi, Bahadori, Sun, et al., 2016) handle visit-level irregularity by adding time span as a feature.

Recurrent Neural Networks (RNNs), which retain memory of previous states through a directed cycle of connections, are effective for handling sequential data. However, RNNs face challenges in optimizing long-term dependencies due to vanishing and exploding gradients (Pascanu, Mikolov, & Bengio, 2013). To address this, specialized RNN variants like Long Short-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) networks have been developed. LSTMs manage long-term dependencies without optimization issues, showing promising results in health informatics applications (Che et al., 2018; Lipton

<figure><img src="image_6.png" /><figcaption>(a) First ICU admission</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>(b) Second ICU admission</figcaption></figure>

<caption>**Fig. 2.** The illustration portrays a patient's health trajectories during his hospitalization, where the individual was admitted to the ICU twice, and each admission showed a distinct pattern. The X-axis indicates the time of measurement for each clinical feature (hourly), and the Y-axis represents the measured value.</caption>

et al., 2015). While traditional LSTM architectures excel at modeling sequential data, they struggle with irregular time intervals. Standard LSTMs assume uniform time distribution between sequence elements, which is not suitable for EHR data where time gaps between records can vary greatly. Recognizing these irregular timing patterns is crucial for decision-making, as the time span between clinical parameter records provides valuable insights into a patient's health status and disease progression, as depicted in (Fig. 2).
To address these challenges, several LSTM-based models have been developed. “Deep-Care” by Pham, Tran, Phung, and Venkatesh (2017), enhances understanding of a patient’s health journey with irregular data. “T-LSTM” by Baytas et al. (2017) decomposes cell memory into short and long-term memories, using a decay function to adapt to time irregularities. Zhang (2019) introduced “ATTAIN”, a time-aware model that uses the attention mechanism to generate decay weights based on time intervals, adjusting the impact of historical information on the current state based on time.

We propose that addressing temporal irregularities and treating each feature differently based on their importance can significantly enhance the accuracy of predicting patient outcomes. This assertion is supported by two key factors that underscore the advantages of this approach.

Firstly, analyzing temporal irregularities for each feature individually provides a more nuanced and precise understanding of time span information. This approach allows us to gain comprehensive insights into the evolution of each specific feature over time and its influence on patient outcomes.

Secondly, acknowledging that different features within EHR data exhibit distinct decaying patterns is crucial. Some features may decay more rapidly than others within the same time interval, necessitating a customized handling approach. By considering the unique temporal characteristics of each feature, we can accurately capture the diverse dynamics inherent in different features, facilitating a comprehensive analysis of their temporal behavior.

The frequency of measurements, actually their number, is another piece of information that can be used both to assess its criticality, and to detect fluctuations in the time gaps between measures.

Time series are convenient to analyze variations. However the information about the health status, in particular the actual values at the decision time, are somehow buried in the flow of the time series. To address the challenges encountered in EHR data analysis, we introduce MWTA-LSTM, which stands for Multi-Way adaptive Time Aware Long Short-Term Memory, an end-to-end deep neural network. MWTA-LSTM leverages the power of LSTM and incorporates three essential pieces of information: the elapsed time between events in a sequence, the frequency of measurements, and the last observed value of the feature. By integrating these factors, MWTA-LSTM effectively processes irregularly spaced multivariate time series, manages timing irregularities, and minimizes noise in sparse EHR records.

Our contributions can be summarized as follows:

*   **Novel Framework:** We introduce MWTA-LSTM, a framework that handles timing irregularities and captures complex interactions between different clinical features at various stages. MWTA-LSTM extends the standard LSTM gates (forget, input, and output) with an additional time gate to adjust the memory cell, diminishing the influence of previous memory as elapsed time increases. This adjustment is achieved through two time gate mechanisms: one proposed by Baytas et al. (2017), and the other our proposed approach.

*   **Adaptive Pooling Strategy:** We propose a novel adaptive pooling strategy to address outlier issues during EHR data analysis, enhancing the robustness and reliability of our framework.

Our model not only captures long-term temporal dependencies in time series observations but also effectively addresses timing irregularities by leveraging frequency measurements, leading to significantly enhanced prediction performance. Empirical experiments conducted on two real-world clinical datasets and three time series datasets demonstrate the superiority of our proposed model over current state-of-the-art models and other robust baselines.

Our research represents the first attempt to jointly incorporate event time intervals as intervention data into LSTM units for adjusting the cell state. We also utilize time intervals and frequency measurements as decay mechanisms, effectively managing timing irregularities and

missing data in EHR analysis. Overall, the MWTA-LSTM framework, coupled with feature customization and adaptive pooling, offers a robust solution for handling timing irregularities, capturing complex interactions, and addressing outliers in EHR analysis.

The subsequent sections of this paper are organized as follows: Section 2 provides an extensive review of previous studies related to our topic. Transitioning to Section 3, we delve into the technical intricacies of our proposed approach. Our utilization of datasets and the preprocessing steps taken to obtain benchmark datasets are outlined in Section 4. The outcomes of our experiments are presented in Section 5. Lastly, in Section 6, we engage in a comprehensive discussion and draw conclusions based on our research findings.

## 2. Related works

In this section, after the introduction of the necessary notations, we present the recent related works.

### 2.1. Notations

We analyze a clinical time series dataset comprising $N$ stays. To form our cohort of subjects, we represent each sample as:

$$X = \{ (X^{(n)}, X_{\text{last}}^{(n)}, F_X^{(n)}, \Delta_t^{(n)}, S^{(n)}) \}_{n=1}^N, \quad (1)$$

where each sample is associated with a unique index $n$.

For each stay within our cohort of $N$ stays, we examine a multi-variate time series that incorporates $D$ physiological variables, such as laboratory results and vital signs, observed over a duration of time $T$ (window size):

$$X = \{x_1, x_2, \dots, x_T\} \in \mathbb{R}^{T \times D} \quad (2)$$

where each $x_t^d$ represents the observation of the $d$th variable (e.g. diastolic blood pressure) measured at timestamp $t \in \{1, 2, \dots, T\}$ for stay $n$th.

To address missing values in $X$, we introduce a masking vector $M = \{m_1, \dots, m_2, \dots, m_T\} \in \mathbb{R}^{T \times D}$ of the same size as $X$. This vector indicates which variables are observed or missing at each time step. We initialize $M$ as follows:

$$m_t^d = \begin{cases} 1, & \text{if } x_t^d \text{ is observed in the input data} \\ 0, & \text{otherwise} \end{cases} \quad (3)$$

We calculate the frequency measurements of $f_x$ based on the number of times $n_x$, $x$ has been measured over a given windows size $T$.

$$f_x = n_{x^d} / T \quad (4)$$

In $X_{\text{last}}$, we store the last observation $x_{\text{last}}^d$ of each physiological variable $x^d$ within the past $T$ time steps.

To incorporate essential temporal information encapsulated in the time intervals between data collections, we introduce a time interval variable $\Delta_t^d \in \mathbb{R}^D$ for each variable $x_t^d$. We assume that the initial observation is made at timestamp $t=1$, and $\Delta_1 = 0$. The definition of the time interval is expressed as follows:

$$\Delta_t^d = \begin{cases} 0, & t=1 \\ \Delta_{t-1}^d + 1, & t > 1, m_{t-1}^d = 0 \\ 0, & t > 1, m_{t-1}^d = 1 \end{cases} \quad (5)$$

A set of static features, e.g. demographic features, denoted $S$ is also extracted for each stay:

$$S_i = [s_{i,1}, s_{i,2}, \dots, s_{i,n}] \in \mathbb{R}^S, \quad i = 1, 2, \dots, N \quad (6)$$
## 2.2. LSTM

We briefly remind the Long Short-Term Memory (LSTM) architecture (Hochreiter & Schmidhuber, 1997), which is the basis of our approach and of recent related works. LSTM addresses the challenge of capturing long-term dependencies in neural networks by incorporating recurrent connections. The LSTM architecture employs three gates, governing the information flow for input $i_t$, forgetfulness $f_t$, and output $o_t$ operations at each time step. LTSM's unit operation are expressed from Eqs. (7) to (8)

$$ 
\begin{aligned}
i_t &= \sigma(W_i[c_{t-1}, h_{t-1}, \mathbf{x}_t] + b_i) \\
f_t &= \sigma(W_f[c_{t-1}, h_{t-1}, \mathbf{x}_t] + b_f) \\
\tilde{c}_t &= \tanh(W_c[h_{t-1}, \mathbf{x}_t] + b_c) \\
c_t &= f_t \odot c_{t-1} + i_t \odot \tilde{c}_t
\end{aligned} 
\quad (7) $$

Finally, the new hidden states are generated by filtering the new cell state through an output gate layer $o_t$.

$$ 
\begin{aligned}
o_t &= \sigma(W_o[c_t, h_{t-1}, \mathbf{x}_t] + b_o) \\
h_t &= o_t \odot \tanh(c_t) \\
p_t &= \sigma(U h_t)
\end{aligned} 
\quad (8) $$

As mentioned previously, the conventional LSTM fails to account for timing irregularities present in longitudinal data derived from EHR records.

## 2.3. Time-aware models

In recent decades, various methods have been proposed to address the challenge of time irregularities in multivariate event time series. One such approach is presented in “Patient Subtyping via Time-Aware LSTM Networks” by Baytas et al. (2017). The authors introduce the T-LSTM model, aiming to improve patient subtyping accuracy by incorporating time information into the learning process. T-LSTM employs Long Short-Term Memory (LSTM) networks, modifying the memory cell to include short-term (D-STM) and long-term (LTM) memories, discounted based on the elapsed time between events. It divided the previous cell memory as short-term (D-STM) ($\hat{c}_{t-1}^S$) and long-term (LTM) ($c_{t-1} - c_{t-1}^S$), then discounted only the short-term memory through the same decay function. The new cell memory is calculated as follows:

$$ C_{t-1}^{S} = \tanh(W_d C_{t-1} + b_d) \quad (Short term memory) \quad (9) $$

$$ \hat{C}_{t-1}^{S} = g(\Delta_t) * C_{t-1}^{S} \quad (Discounted short term memory) \quad (10) $$

where $g(\Delta_t) = (W_{\Delta_t} \otimes \frac{1}{\log(e+\Delta_t)})$ (Pham et al., 2017), particularly suitable for datasets that involve large elapsed times and $\otimes$ denotes matrix multiplication.

$$ C_{t-1}^* = \underbrace{C_{t-1} - C_{t-1}^S}_{\text{LTM}} + \underbrace{\hat{C}_{t-1}^S}_{\text{D-STM}} \quad (\text{Adjusted previous memory}) \quad (11) $$

$$ C_t = f_t \odot C_{t-1}^* + i_t \odot \tilde{C}_t \quad (\text{Current memory}) \quad (12) $$

This adaptation allows the model to reduce the influence of previous memory as the time gap increases, enhancing its ability to understand the temporal context. However, T-LSTM's reliance on the previous cell state limits its capacity to determine the relative importance of events in predicting the current outcome.

Zhu et al. (2017) proposed a modification to the standard LSTM unit called “Time-LSTM”, by introducing a “Time Gate” to address time irregularities in modeling user behavior. Their Time-LSTM network captures temporal patterns by considering historical behavior, context, and time information, dynamically adapting to changes in user behavior over time for accurate predictions about the next item interaction. The framework effectively accounts for infrequent interactions over

extended periods, with the time gate assigning more weight to recent time intervals or older intervals based on user interest stability.

In clinical settings, where patient outcomes are crucial, (Zhu et al., 2017)'s Time-LSTM framework could predict outcomes, detect early signs of deterioration, and optimize treatment plans by leveraging historical patient data. This framework contributes to a more comprehensive understanding of a patient's health journey.

$$ 
\begin{aligned}
T_m &= \sigma(x_m W_{xt} + \sigma_{\Delta_t}(\Delta_t W_{\Delta_t}) + b_t) \\
c_m &= f_m \odot c_{m-1} + i_m \odot T_m \odot \tilde{c}_m \\
o_m &= \sigma(W_{xo}[h_{m-1}, \mathbf{x}_m] + \Delta_t W_{to} + w_{co} \odot c_m + b_o)
\end{aligned} 
\quad (13) $$

Zhang (2019) introduced ATTAIN, an attention-based time-aware disease progression model that integrates the attention mechanism to capture time irregularities between events. Unlike traditional LSTM models that rely on memory from a single previous event, ATTAIN dynamically adjusts the previous memory cell $c_{t-1}^S$ by retrospectively combining memories from multiple past events. This fusion is weighted based on attention mechanisms and time intervals, facilitating a more comprehensive understanding of disease progression. The study explores three attention mechanisms, global, local, and flexible, to derive attention weights, capturing the significance of past events in tracking disease progression.

## 2.4. Attention models on EHR data analysis

In the realm of Attention models for Electronic Health Record (EHR) data analysis, several noteworthy contributions have emerged, each tackling specific challenges and enhancing both interpretability and prediction accuracy.

One such model is RETAIN, introduced by Choi, Bahadori, Sun, et al. (2016). Built upon the Gated Recurrent Unit (GRU), RETAIN employs a dual-level attention mechanism to pinpoint significant visits and features for prediction. Notably, it integrates a reverse time attention mechanism, enhancing interpretability. By concatenating visit times-tamps, RETAIN effectively harnesses irregular EHR data, capturing temporal relationships to boost prediction accuracy.

Another notable contribution is HiTANet, introduced by Luo, Ye, Xiao, and Ma (2020). This Hierarchical Time-aware Attention Network, based on the Transformer architecture, employs hierarchical attention to capture temporal dynamics at both local and global levels. At the local stage, it addresses the challenge of incorporating historical patient data by leveraging a time-aware Transformer, enabling the learning of local attention weights for visits and patient-level representations. The time-aware key-query attention mechanism in the global stage enhances interpretability by capturing disease progression over time.

The mTAND model, proposed by Shukla and Marlin (2021), adopts a transformer-like attention mechanism to re-represent irregularly sampled time series at fixed reference points. By employing time points as queries and observed time points as keys, mTAND adeptly handles irregular sampling, showcasing its utility in both interpolation and classification tasks.

ConCare, proposed by Ma et al. (2020), is a transformer-based model tailored for handling irregular EHR data and extracting feature inter-relationships for personalized healthcare prediction. It enhances multi-head self-attention through cross-head decorrelation, effectively capturing inter-dependencies among dynamic features and static baseline information to construct a comprehensive personal health context.

Despite the strides made in accuracy by these models, they still encounter challenges in effectively addressing time irregularities and temporal interactions across various stages. This hinders their ability to precisely model a patient's health journey and, consequently, optimize patient outcomes.

## 3. Multi-way adaptive time aware LSTM “MWTA-LSTM”

The time intervals between successive events during a patient's hospitalization can exhibit considerable variation, ranging from mere
<figure><img src="image_8.png" /><figcaption>Fig. 3. The framework of Multi-Way adaptive Time Aware LSTM (MWTA-LSTM).</figcaption></figure>

minutes to several weeks. As the significance of past events diminishes with time, it becomes crucial to mitigate their influence on current assessments. Therefore, considering elapsed time is pivotal for ensuring accurate predictions of present outcomes. To enhance prediction performance, it is essential to adopt an architecture capable of handling this irregularity, particularly in scenarios where the frequency and volume of patient records can vary greatly. Rather than viewing varying elapsed times as obstacles, they should be regarded as integral components of a patient's medical history and leveraged during the processing of EHRs data.

MWTA-LSTM is an advanced end-to-end deep-learning model designed to capture the complex temporal dynamics of sequential data with time irregularities. It has four main layers. The bottom layer is built upon an extended modified version of T-LSTM and Time-LSTM which were first proposed in Baytas et al. (2017), Zhu et al. (2017), whose memory cells are modified to handle the temporal irregularity of a patient's medical records. The subsequent layers include a multi-head attention pooling layer, a gating mechanism layer, a temporal convolutional block, and an output layer, as depicted in Fig. 3. In the subsequent discussion, we delve into the specifics of each layer.

### 3.1. MWTA - LSTM unit 1

We utilize two patient-related datasets. The input sequence comprises temporal patient data denoted by $X$, and the elapsed time $\Delta_t$ between successive records for each clinical feature related to the patient stay, which is shown in Fig. 4.

As initially proposed by Baytas et al. (2017), we decompose the existing memory into long-term and short-term components using equations from (Eq. (9)) to (Eq. (11)). Subsequently, the short-term memory undergoes reduction via a time decay factor calculated based on the time interval between consecutive records ($\Delta_t$). The resulting discounted short-term memory (D-STM) and long-term memory (LTM) are merged to update the memory. This modification allows for customized memory content in the new cell state unit, lessening the impact of past memory on the current output, especially when there is a significant time gap between successive recordings of a clinical feature. This is crucial as $x_t$ contains information on the patient's current health status, reflecting both short and long-term medical conditions, while $c_{t-1}$ tracks their long-term medical history based on past records.

To accommodate the fluctuating time intervals between successive medical records more effectively, we have introduced an additional time gate to govern the state update process. This adjustment stems from the recognition that a patient's medical condition is in constant flux, and each preceding medical encounter uniquely influences their current state, denoted as $c_t$. It is crucial to capture the impact of diverse time intervals between records. The time gate serves to regulate the influence of these factors, considering the time gap denoted as $\Delta_t$.

$$T_t = \sigma(W_{x_t} x_t + \sigma_{\Delta_t}(g(\Delta_t)) + b_t) \quad (14)$$

where $\sigma$ is the sigmoid function, $\Delta_t$ is the time interval between records for each clinical feature at time span $t-1$, and $t$. This time gap can vary from hours to days.

#### 3.1.1. Modeling effect of interventions

Assessing a patient's health status involves recording clinical feature measurements over time, and the elapsed time vector plays a pivotal role in this process. Considered an intervention, this vector monitors the frequency of measurements for each clinical feature, directly reflecting the patient's health condition. Shorter intervals between measurements for vital clinical features may signal a rapidly deteriorating condition, while longer intervals may indicate stability. Hence, the elapsed time vector serves as a crucial tool in evaluating a patient's health status over time, aligning with the goal of interventions to either cure diseases or alleviate the patient's illness.

This intervention effect is modeled by regulating the cell state $c_t$ using (Eq. (11) and (14)) as illustrated in (Fig. 4).

$$c_t = (f_t + T_t) \odot C_{t-1}^* + i_t \odot T_t \odot \tilde{c}_t \quad (15)$$

In this way, the input gate $i_t$ is not only responsible for filtering input information but also the time gate $T_t$, which plays a vital role in regulating the influence of $x_t$ on the patient's current state and modeling their long-term medical condition.

In healthcare, the significance of certain events or interventions may vary based on their temporal context. Consequently, the output gate, which governs illness states, is also influenced by the current intervention, as outlined below:

$$o_t = \sigma(W_o[c_t, h_{t-1}, x_t] + T_t + b_o) \quad (16)$$

Through the inclusion of $c_t$ and the time gate $T_t$ in the output gate, the MWTA-LSTM is capable of assigning distinct weights to features,
<figure><img src="image_9.png" /><figcaption>Fig. 4. MWTA-LSTM 1 (unit) on analyzing healthcare records. Red arrows correspond to the modifications compared to standard LSTM. Shade blue boxes indicate networks and shade blue circles denote point-wise operators.</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Fig. 5. MWTA-LSTM 2 (unit) on analyzing healthcare records. Goldenrod arrows correspond to the modifications compared to MWTA-LSTM 1 (unit). Shade blue boxes indicate networks and shade blue circles denote point-wise operators.</figcaption></figure>

considering their correlation with specific events. This capability allows the model to distinguish between events occurring in close proximity or further apart, capturing the nuanced impact of these events on the patient's health state. Furthermore, it facilitates the learning of patient-specific patterns, such as variations in response to treatments or the progression of diseases, resulting in more precise and personalized predictions.

## 3.2. MWTA - LSTM unit 2

In this version, two additional pieces of information have been incorporated: the last observation denoted as $X_{last}$ and the frequency measurement of each physiological variable represented by $f_X$ (refer to Fig. 5).

The utilization of $X_{last}$ and $f_X$ offers several advantages when constructing a personalized predictive model:

Firstly, incorporating the last observation of each clinical variable allows for a more accurate representation of the patient's current health status. This is because the most recent value is likely to better reflect the patient's present health condition compared to earlier measurements. Mathematically, this is expressed as follows:

$$L_{X_t} = \text{ELU}(X_{last} W_{X_{last}} + b_{X_{last}}) \qquad (17)$$

where ELU is the activation function (Clevert, Unterthiner, & Hochreiter, 2015) and expressed as:

$$\text{ELU} = \begin{cases} x, & \text{if } x \ge 0 \\ \alpha(e^x - 1), & \text{otherwise} \end{cases} \qquad (18)$$
with α being the hyperparameter that controls the saturation of the function for negative inputs.

The choice to use the ELU activation function in analyzing EHRs data is driven by its advantages: ELU effectively captures complex non-linear relationships in EHR data, improving pattern recognition. It is more robust to outliers than ReLU, handling the irregularities common in EHRs data and avoiding large gradients for large negative inputs. Additionally, ELU acts as a regularizer, preventing overfitting by limiting output magnitude for large negative inputs, leading to a more generalized model.

Secondly, the use of frequency measurement of each clinical parameter also provides a more accurate indication of a patient's condition(patient management) for several key reasons

*   **Longitudinal Monitoring**, By tracking the frequency of clinical parameters over time, healthcare providers can identify trends and changes in a patient's condition. This is crucial for detecting gradual deterioration or improvement that may not be evident from a single measurement.

*   **Early Detection of Complications**, Regular monitoring can detect early signs of complications. For example, frequent glucose level checks in diabetic patients can help detect hyperglycemia or hypoglycemia early, allowing for timely interventions (Vashist, 2012). Similarly, in patients with chronic heart failure, frequent monitoring of blood pressure and heart rate can help detect worsening heart failure or the effects of medication adjustments.

*   **Personalized Medicine**, Frequent monitoring supports personalized treatment by providing detailed insights into how a patient responds to different therapies over time. This approach is beneficial in managing chronic conditions like heart failure, as it allows clinicians to make informed decisions about adjusting dosages or changing medications to achieve better outcomes.

In conclusion, frequency measurement provides a comprehensive view of the patient's health status, encompassing various physiological and biochemical parameters. This comprehensive data is essential for creating a detailed health profile that can guide holistic patient management. It also allows for a better understanding of the interplay between different aspects of the patient's health, such as the relationship between clinical parameters.

Furthermore, incorporating both the last observation and the frequency measurement of each clinical variable is beneficial for addressing issues related to missing data, especially when certain clinical variables are not measured at every encounter. This approach ensures a more complete and accurate picture of the patient's health.

Below, we present the detailed mathematical expressions for the proposed MWTA-LSTM 2:

Within an LSTM unit, the hidden state $h_t$ functions as the model's memory, retaining information from prior time steps. Our proposal involves modifying the previous hidden state $h_{t-1}$ and the cell state $c_t$ by incorporating the last observation $L_{x_t}$ (Eq. (17)) of each feature. This implies that, at each time step, the hidden state is adjusted to encompass the most recent recorded data for each feature.

Adjusted previous memory

$$h_{t-1}^* = \underbrace{h_{t-1} + L_{x_t}}_{\text{Adjusted current memory}} \qquad (19)$$

$$h_t = o_t \odot \tanh(c_t + L_{x_t})$$

We have also made adjustments to the output gate (Eq. (16)) to incorporate $L_{x_t}$ (Eq. (17)), expressed as follows:

$$o_t = \sigma(W_o[c_t, h_{t-1}^*, x_t] + T_t + L_{x_t} + b_o) \qquad (20)$$

This modification transforms the output gate into a filter, granting the model the ability to selectively screen out irrelevant information and focus on the most crucial features.

### 3.2.1. Capturing time irregularity

When using LSTM to model a patient's medical history, the memory cell contains crucial information about their illness trajectory. However, it is crucial to recognize that this memory must not remain static, given the dynamic nature of the patient's health status. To address this, we introduce two forget mechanisms, Time-based decay and Frequency-based decay, within the MWTA-LSTM. These mechanisms modify the forget gate and the input gate (Eq. (7)) to enable the memory cell to adapt and update in response to changes. The definitions of these terms are as follows:

$$ \begin{aligned} t_d &= g(\Delta_t) \quad (\text{Time-based}) \\ f_d &= e^{-\beta * f_{x_d}} W_{f_d} + b_{f_d} \quad (\text{Frequency-based}) \end{aligned} \qquad (21) $$

where $\beta \in [0, 1]$ is the hyper-parameter (constant) that will determine the rate at which the transformed values decrease as the feature's frequency measurement increases. $W_{f_d}$, $W_{t_d}$, $b_{f_d}$ and $b_{t_d}$ are the weights and biases for the two terms.

The modified input gate and updated forget gate value are expressed as follows:

$$i_t = \sigma(W_i[c_{t-1}, h_{t-1}^*, x_t] + L_{x_t} + f_d + b_i) \qquad (22)$$

By integrating the frequency measurement and the last observation into the input gate of the MWTA-LSTM unit, it functions as a filter. This allows the model to efficiently sift through unnecessary information and focus on essential features, thereby enhancing the model's capacity to understand the temporal context of each variable in the patient's medical history.

$$f_t = \underbrace{f_t * t_d}_{\text{Time-based decay}} + \underbrace{(1 - f_t) * f_d}_{\text{Frequency-based decay}} \qquad (23)$$

where $f_t$ is the updated forget gate, $f_t$ the forget gate (Eq. (7)).

Incorporating these two decay terms when adjusting the forget gate results in several benefits, which are outlined below.

*   **Time-based decay:** The first term in the equation (Eq. (23)) introduces time-based decay, reducing the forget gate's activation value as more time elapses since the last update. This is particularly relevant for Electronic Health Record (EHR) data, where the significance of past medical history diminishes over time. The MWTA-LSTM Unit, through time-based decay, can dynamically regulate its forgetfulness based on the elapsed time since the previous time step. This ensures the model does not retain outdated information, which is crucial in applications like EHR data analysis, language modeling, or speech recognition where recent information holds greater importance.

*   **Frequency-based decay:** EHR data often involves varying frequencies of medical conditions or events. The second term in the equation (Eq. (23)) introduces a frequency-based decay, adjusting the forget gate's activation value based on the frequency of input data. This mechanism allows the forget gate to prioritize frequently occurring information, preventing it from being forgotten too quickly. The MWTA-LSTM unit can adapt its memory retention to capture essential patterns in the data, even if they are less frequent, while efficiently discarding irrelevant or redundant information for frequently occurring events.

*   **Adaptive behavior:** Combining time and frequency based decays empowers the MWTA-LSTM Unit to adapt the forget gate behavior dynamically. It can selectively forget or retain information based on its relevance and importance, leading to efficient memory utilization and enhanced performance across various sequence modeling tasks.
### 3.3. Gating mechanisms & temporal self attention

#### 3.3.1. Multi-head attention

Time series data often have dependencies that span long intervals. Multi-head attention can effectively capture these long-range dependencies by allowing each head to focus on different parts of the sequence. In order, to enhance the learning capability, we suggest incorporating the multi-head attention mechanism proposed in Lim, Arık, Loeff, and Pfister (2021) into MWTA-LSTM. This approach aims to capture meaningful features specific to a given dataset and facilitate the understanding of long-term dependencies across different time steps.

In the context of attention mechanisms, the values $V \in \mathbb{R}^{N \times d_v}$ are typically scaled based on the relationship between the keys $K \in \mathbb{R}^{N \times d_{attn}}$ and queries $Q \in \mathbb{R}^{N \times d_{attn}}$. The attention function is defined as:

$$ \text{Attention}(Q, K, V) = A(Q, K)V \qquad (24) $$

where $A()$ is a normalization function, and $N$ is the number of time steps feeding into the attention layer, represented as $k + t_{max}$. Scaled dot-product attention is a commonly used normalization function, as proposed by Vaswani et al. (2017):

$$ A(Q, K) = \text{Softmax}(Q, K^t / \sqrt{d_{attn}}) \qquad (25) $$

To improve the learning capacity of the standard attention mechanism, multi-head attention was introduced by Vaswani et al. (2017). This involves employing different heads for different representation subspaces:

$$ \text{MultiHead}(Q, K, V) = [H_1, \dots, H_{m_H}]W_H \qquad (26) $$

Here, $H_h$ denotes the output of the attention function for the $h$th head, and is computed as follows:

$$ H_h = \text{Attention}(QW_Q^{(h)}, KW_K^{(h)}, VW_V^{(h)}) \qquad (27) $$

The weights $W_K^{(h)}, W_Q^{(h)},$ and $W_V^{(h)}$ are head-specific and belong to the set of $\mathbb{R}^{d_{model} \times d_{attn}}$ and $\mathbb{R}^{d_{model} \times d_v}$, respectively. The outputs from all heads are concatenated and linearly combined using $W_H$, which belongs to $\mathbb{R}^{(mh \cdot d_v) \times d_{model}}$.

However, the use of varying values in each head makes it challenging to ascertain the importance of a specific feature based solely on attention weights in standard multi-head attention. To tackle this challenge, a modification to multi-head attention has been proposed by Lim et al. (2021). This modification entails sharing values across all heads and employing additive aggregation of all heads. This is expressed in Eqs. (28) through (30).

$$ \text{MultiHead}(Q, K, V) = \tilde{H}W_H \qquad (28) $$

$$ \tilde{H} = \tilde{\Lambda}(Q, K)VW_V \qquad (29) $$

$$ = \left\{ \frac{1}{m_H} \sum_{h=1}^{m_H} A(QW_Q^h, KW_K^h) \right\} VW_V \qquad (30) $$

$$ = \frac{1}{m_H} \sum_{h=1}^{m_H} \text{Attention}(QW_Q^{(h)}, KW_K^{(h)}, VW_V^{(h)}), \qquad (31) $$

where $W_V \in \mathbb{R}^{d_{model} \times d_v}$ are value weights shared across all heads, and $W_H \in \mathbb{R}^{d_{attn} \times d_{model}}$ is used for final linear mapping.

#### 3.3.2. Gating mechanisms

The relationship between inputs and targets can be ambiguous, complicating the identification of relevant variables, non-linear processing, and handling small or noisy datasets. To tackle these challenges, we propose using component gating layers based on Gated Linear Units (GLUs) (Dauphin, Fan, Auli, & Grangier, 2017), which offer model flexibility by suppressing irrelevant features and enhancing efficiency in predicting patient outcomes. Applying GLUs to EHRs data provides several benefits. GLUs refine clinical feature representation by selectively gating inputs, identifying crucial features, and ignoring noise. They mitigate the impact of missing data by activating available information, ensuring robustness. GLUs excel at modeling complex relationships between features and patient outcomes, capturing intricate non-linear interactions. Additionally, GLUs improve gradient flow, leading to faster training and better performance.

Mathematically, the GLU activation function is expressed as follows:

$$ \text{GLU}_w(h) = \sigma(W_{1,w}h + b_{1,w}) \odot (W_{2,w}h + b_{2,w}) \qquad (32) $$

Here, $h$ corresponds to the hidden state, $\sigma$ is the sigmoid activation function, $\odot$ represents the element-wise Hadamard product, and $W_{1,w}, W_{2,w}, b_{1,w},$ and $b_{2,w}$ are weights and biases $\in \mathbb{R}^D$.

### 3.4. Temporal convolutional block

To enhance the model's capability, we integrated a CNN layer (Krizhevsky, Sutskever, & Hinton, 2017) into the architecture. This addition enables the handling of multiple input feature maps and generates stacked feature maps with increasing layers, determined by the encoded input. CNN has demonstrated impressive performance in various tasks such as image, voice, video, and object detection (Krizhevsky et al., 2017; Simonyan & Zisserman, 2014). Their effectiveness lies in capturing time-invariant features within short temporal regions, a task traditional fully connected neural networks may find challenging. When applying 1D convolution and pooling operations to the temporal dimension of sensor signals, we obtain a feature map denoted as $z_{i,j}^{l,k}$ in the $l$th convolutional layer(the index $i$ traverses the spatial domain, while $j$ spans the temporal domain). The computation of this feature map can be expressed as follows:

$$ z_{i,j}^{l,k} = f \left( \sum_{k'=1}^{K'} \sum_{y=1}^{Y} x_{i,j+y-1}^{l-1,k'} \odot w_{j,k'}^{l-1,k} + b^{l-1,k} \right) \qquad (33) $$

where $x_{i,j}$ represents a set of input feature maps, $\odot$ indicates the convolutional operation, $K'$ is the number of feature maps in the $(l-1)$-th layer, $Y$ is the size of the convolution kernel running over the temporal domain of a signal, $w^{l-1,k} \in \mathbb{R}^{Y \times K'}$ is a local filter weight matrix, and $b^{l-1,k} \in \mathbb{R}$ is the bias.

However, the feature maps generated by each convolutional block can often be unwieldy in terms of their width, length, and number of channels, making them challenging to manage. This can lead to overfitting during training and high computational costs. An efficient solution to these challenges is applying a non-linear downsampling (NLDS) technique, known as a pooling layer, to reduce redundant features. Two well-known pooling techniques are average pooling and max pooling (Boureau, Ponce, & LeCun, 2010). The pooling layer reduces the spatial size of the representation, thereby reducing the number of parameters and mitigating overfitting. The output map $p_{i,j}^{l,k}$ is obtained by taking the maximum or mean value over non-overlapping regions of the feature maps $z_{i,j}^{l,k}$ with a filter size of $Q$, it is computed as follows:

$$ p_{i,j}^{l,k} = \underset{(j-1)Q+1 \le j' \le j}{\text{down}} z_{i,j'}^{l-1,k} \qquad (34) $$

where the downsampling function (down(·)) can be either average pooling or max pooling.

While average and max pooling are commonly used for their simplicity and computational efficiency, they may not be suitable for EHRs time series data containing outliers. These pooling operations assume
<figure><img src="image_11.png" /><figcaption>Fig. 6. Adaptive Stochastic Pooling (ASP) process.</figcaption></figure>

homogeneous data, where spatial or temporal relationships can be summarized by aggregated values. However, in the presence of outliers, average and max pooling can lead to distorted representations and impact overall performance. They are sensitive to the magnitude of outliers, meaning a single extreme outlier can significantly influence the pooled summary, even if it is an anomaly or measurement error. This sensitivity can result in unstable and unreliable representations, particularly with noisy or heterogeneous EHR time series data.

Max pooling, which selects the maximum value within each pooling window, is especially problematic when outliers are present. Outliers can dominate the pooled representation, leading to biases and distortions in the output. On the other hand, average pooling performs poorly when there are many zero elements in the input features, causing a significant reduction in the feature map's characteristics (Yu, Wang, Chen, & Wei, 2014). Outliers can also strongly influence the average value, pulling it towards extreme values and resulting in an inaccurate representation of the data, especially if outliers are frequent or have a significant impact on overall statistics.

To address the issue of outliers in EHR time series data, it is beneficial to consider outlier-resistant pooling techniques or alternative methods that can handle outliers effectively. We propose a novel approach called Adaptive Stochastic Pooling (ASP), as illustrated in (Fig. 6) which incorporates the Median Absolute Deviation (MAD) (Leys, Ley, Klein, Bernard, & Licata, 2013) into the pooling process. MAD, a measure of data spread, is less influenced by extreme values and allows the pooling operation to handle noisy or anomalous data points more robustly. By leveraging ASP with MAD, we can improve the pooling process and mitigate the negative impact of outliers in EHR time series analysis. This approach is mathematically expressed as follows:

$$ASP_{i,j}^{l,k} = p_{i,j}^{l,k} + \frac{mad}{(j-1)Q+1 \le j' \le Q} z_{i,j'}^{l-1,k} \cdot \mathcal{N}(0,1)(p_{i,j}^{l,k}) \quad (35)$$

where: $ASP_{i,j}^{l,k}$ represents the pooled value at position $(i, j)$ in the $l$th layer and $k$th channel. $p_{i,j}^{l,k}$ is the pooling operation used for each pool. $\mathcal{N}(0, 1)$ denotes a sample drawn from a standard normal distribution and mad is the median absolute deviation computed for each pool, expressed as:

$$\frac{mad}{(j-1)Q+1 \le j' \le Q} z_{i,j'}^{l-1,k} = M(|z_{i,j'}^{l-1,k} - M(z_{i,j'}^{l-1,k})|) \quad (36)$$

with M being the Median operation.

ASP also introduces randomness through sampling from a normal distribution, making the pooling operation non-deterministic. This helps prevent overfitting and provides regularization benefits (Nirthika, Manivannan, Ramanan, & Wang, 2022; Zeiler & Fergus, 2013). The random sampling allows the pooling operation to capture the inherent variability within each pool, which is particularly advantageous for capturing diverse patterns and fluctuations in EHR time-series data. It

also enables the model to explore different possible pooling outcomes during training, leading to improved generalization. Furthermore, ASP retains more information compared to average and max pooling by combining the mean or max and MAD-adjusted samples within each pool. This approach captures both central tendencies and variability in the pooled representations, resulting in richer and more informative feature representations. This is particularly valuable when dealing with complex and non-linear relationships within EHR time-series data, where different patients or events may exhibit varying dynamics.

# 4. Experiments on ICU data

## 4.1. Ethics approval

This study was conducted based on the analysis of publicly available and anonymized databases, each of which had received prior approval from Institutional Review Boards (IRB).

The Institutional Review Boards at the Beth Israel Deaconess Medical Center in Boston and the Massachusetts Institute of Technology in Cambridge have granted approval for the collection, processing, and release of data for the MIMIC-III database. Similarly, the eICU research committee has provided approval for data collection, processing, and release for the eICU database, and it is worth noting that the eICU database does not require Institutional Review Board approval. Furthermore, in full compliance with European Union data protection laws, all data processing was carried out using the computational infrastructure available at Strasbourg University, obviating the need for additional approval. This ensures adherence to the ethical and legal standards governing the use of health-related data in research.

## 4.2. MIMIC-III database

The Medical Information Mart for Intensive Care III (MIMIC-III) (Johnson et al., 2016) is a publicly accessible critical care database maintained by the Massachusetts Institute of Technology (MIT)'s Laboratory for Computational Physiology. Covering the period from 2001 to 2012, MIMIC-III comprises deidentified health-related data linked to 46,520 unique adult patients who were admitted to critical care units at the Beth Israel Deaconess Medical Center (BIDMC). The dataset encompasses 58,976 hospital admissions and 61,532 distinct ICU admissions.

Within MIMIC-III, a diverse range of patient health information is available, including demographics, vital signs, lab test results, medications, diagnosis codes, and clinical notes. This rich dataset serves as a valuable resource for conducting comprehensive analyses and research in critical care scenarios.

## 4.3. eICU database

The eICU Collaborative Research Database, as detailed by Pollard et al. (2018), stands as a multi-center intensive care unit repository featuring high granularity data for over 200,000 admissions to ICUs monitored by eICU programs across the United States. This extensive database encompasses 200,859 patient unit encounters involving 139,367 unique patients admitted between 2014 and 2015 to 208 hospitals situated throughout the U.S.

Derived from the eICU telehealth program, an initiative in telemedicine, this database reflects the continuous real-time monitoring and remote support provided to ICU clinicians. It offers comprehensive records, incorporating demographics, physiological readings from bedside monitors, diagnoses (International Classification of Diseases, Ninth Revision codes), and various other clinical data collected during routine medical care. The eICU database thus serves as a valuable resource for in-depth research and analysis in the field of intensive care.
<caption>**Table 1**</caption>

Baseline characteristics and in-hospital mortality outcome measures in our cohort. LOS (Length of Stay). Continuous variables are presented as Median [InterQuartile Range Q1–Q3]; binary or categorical variables as Count (%).

<table><thead><tr><th rowspan="2"></th><th rowspan="2"></th><th colspan="3">MIMIC III</th><th colspan="3">eICU</th><th rowspan="2">P-Value<br>Kruskal-Wallis/<br>Chi-squared</th></tr><tr><th>Overall</th><th>Alive (HOSPITAL)</th><th>Dead (HOSPITAL)</th><th>Overall</th><th>Alive (HOSPITAL)</th><th>Dead (HOSPITAL)</th></tr></thead><tbody><tr><td colspan="2">TOTAL ICU ADMISSIONS</td><td>53103</td><td>46509 (87.6)</td><td>6594 (12.4)</td><td>190935</td><td>174214 (91.2)</td><td>16721 (8.8)</td><td></td></tr><tr><td colspan="2">AGE, median [Q1,Q3]</td><td>65.7 [52.8,77.8]</td><td>64.7 [52.0,76.9]</td><td>73.4 [60.1,82.8]</td><td>64 [52, 75]</td><td>64 [52, 74]</td><td>70 [60, 79]</td><td>&lt;0.001</td></tr><tr><td colspan="2">ICU LOS (days), median [Q1,Q3]</td><td>2.1 [1.2,4.2]</td><td>2.1 [1.2,4.0]</td><td>3.1 [1.3,7.2]</td><td>2.30 [1.2, 4.9]</td><td>2.21 [1.2,4.6]</td><td>3.9 [1.5,8.9]</td><td>&lt;0.001</td></tr><tr><td rowspan="2">GENDER, n (%)</td><td>F</td><td>23185 (43.7)</td><td>20179 (43.4)</td><td>3006 (45.6)</td><td>86761 (45.0)</td><td>79091 (45.4)</td><td>7670 (46.0)</td><td>&lt;0.001</td></tr><tr><td>M</td><td>29918 (56.3)</td><td>26330 (56.6)</td><td>3588 (54.4)</td><td>104174 (55.0)</td><td>95123 (54.6)</td><td>9051 (54.0)</td><td>&lt;0.001</td></tr><tr><td rowspan="3">ADMISSION TYPE, n (%)</td><td>Medical</td><td>32447 (61.1)</td><td>27591 (59.3)</td><td>4856 (73.6)</td><td>16592 (8.7)</td><td>14483 (8.3)</td><td>2109 (12.6)</td><td>&lt;0.001</td></tr><tr><td>ScheduledSurgical</td><td>6266 (11.8)</td><td>6074 (13.0)</td><td>192 (2.9)</td><td>68349 (35.8)</td><td>61575 (35.3)</td><td>6774 (40.5)</td><td>&lt;0.001</td></tr><tr><td>UnscheduledSurgical</td><td>14390 (27.1)</td><td>12844 (27.7)</td><td>1546 (23.5)</td><td>105994 (55.5)</td><td>98156 (56.4)</td><td>7838 (46.9)</td><td>&lt;0.001</td></tr><tr><td colspan="2">Other Outcomes</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">ICU, n (%)</td><td>Alive</td><td>48384 (91.1)</td><td></td><td></td><td>180768 (94.7)</td><td></td><td></td><td>&lt;0.001</td></tr><tr><td>Dead</td><td>4719 (8.9)</td><td></td><td></td><td>10167 (5.3)</td><td></td><td></td><td>&lt;0.001</td></tr><tr><td rowspan="2">2-DAYS ICU, n (%)</td><td>Alive</td><td>51207 (96.4)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Dead</td><td>1896 (3.6)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">3-DAYS ICU, n (%)</td><td>Alive</td><td>50639 (95.4)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Dead</td><td>2464 (4.6)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">30-DAYS ICU, n (%)</td><td>Alive</td><td>44652 (84.1)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Dead</td><td>8451 (15.9)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">1-YEAR ICU, n (%)</td><td>Alive</td><td>37640 (70.9)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Dead</td><td>15463 (29.1)</td><td></td><td></td><td></td><td></td><td></td><td></td></tr></tbody></table>

## 4.4. Cohort selection

To define our relevant cohort, we initiated the process by excluding patients under the age of 15 and those lacking essential temporal data records. It is noteworthy that a patient's hospital admission may encompass multiple episodes of intensive care, involving transfers between various intensive care units during their stay. For the purpose of this study, we considered all instances of intensive care associated with a patient throughout their hospitalization. After applying these exclusion criteria, we identified a total of 53,103 distinct intensive care unit stays eligible for our prediction tasks in the case of MIMIC III. Within this cohort, the median age was 65.7 years, with an interquartile range (Q1–Q3: 52.0–76.9), and in-hospital and ICU mortality rates were 12.4% and 8.8%, respectively. The average length of stay in intensive care units was 4.15 days. Turning to eICU, we obtained 190,935 unique intensive care unit stays with a median age of 64.0 years and an interquartile range (Q1–Q3: 52.0–75.0). To ensure consistency across tasks, we focused on the first 24 and 48 h of ICU data for each patient. Further details are provided in (Table 1).

## 4.5. Features extraction

The benchmark datasets are processed to derive features for the subsequent prediction tasks. We gather 5 static demographic features (Age, Gender, Admission type, Comorbidity, Ethnicity), fully observed, and 103 physiological variables encompassing Labs, Vitals, and Drug measurements that vary over time for each patient stay.

For an exhaustive benchmarking comparison study, we have selected two sets of features:

* Feature Set A: This set comprises the 15 features utilized in the SAPS-II score calculation (Le Gall, Lemeshow, & Saulnier, 1993). Data for each feature are amalgamated based on medical knowledge. For instance, to calculate the Glasgow Coma Scale score, we sum the values of GCSVerbal, GCSMotor, and GCSEyes. Similarly, for urine output, we aggregate the features representing urine output. The body temperature is converted from Fahrenheit to Celsius, and the PaO2/FiO2 ratio is calculated instead of treating them as individual features.

* Feature Set B: This set comprises 103 features, encompassing the 15 features from Feature Set A. These additional features are extracted from the (labevents, outputevents, chartevents) tables.

### 4.5.1. Handling irregular time intervals

Physiological variables are often measured at irregular intervals, posing a challenge for machine learning techniques that are not specifically designed for time-series data. While some methods can be adapted for streaming data, they usually assume regular time sampling. To overcome this limitation and improve the applicability to irregularly sampled data, we transformed each feature into hourly data for the first 24 and 48 h following ICU admission. Each time series feature from a single ICU stay is aggregated into hourly intervals (e.g., 0–1 hr, 1–2 hr).

Occasionally, a feature is measured multiple times within a single hour. In these rare cases, the measured values are aggregated. The choice of aggregation function depends on each feature and is determined by a medical expert, as detailed in Appendix, Tables A.2 and A.3. For example, urine output is summed, while Mean Arterial Pressure, GCSVerbal, GCSMotor, and GCSEyes use the minimum values. Other features use either minimum or maximum values based on their clinical relevance.

In instances without observations, missing values are filled with the nearest available observation. As suggested by clinicians, missing values are imputed with the last value within a fixed-length forward time window, and remaining gaps are filled with feature-wise median values. This approach ensures a more robust and complete dataset for analysis. During hourly data sampling, it was observed that 103 variables, including both laboratory and vital signs, exhibited an absence exceeding 93% for all patients. This can be attributed to the nature of medical testing, where each patient undergoes only a few tests based on their specific needs, and these tests are often scheduled sporadically over a considerable duration. Refer to Appendix, Tables A.2, A.3(a), and A.3(b) for further details on this phenomenon.

## 4.6. Benchmark prediction tasks

This section outlines benchmark prediction tasks.
<table><caption>**Table 2**
In-hospital & ICU Mortality using First 24 HRS DATA on MIMIC III. MP denotes Max Pooling.</caption><caption>FIRST 24 HOURS DATA</caption><thead><tr><th rowspan="2">TASKS</th><th rowspan="2">MODELS</th><th colspan="5">SAPS II FEATURES</th><th colspan="5">ALL FEATURES</th></tr><tr><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th></tr></thead><tbody><tr><td rowspan="12">In-Hospital</td><td>LSTM</td><td>0.88 ± 0.0125</td><td>0.60 ± 0.0275</td><td>0.56 ± 0.0555</td><td>0.57 ± 0.0626</td><td>0.56 ± 0.0235</td><td>0.88 ± 0.0140</td><td>0.61 ± 0.0110</td><td>0.55 ± 0.0168</td><td>0.61 ± 0.0290</td><td>0.57 ± 0.0235</td></tr><tr><td>LSTM-W<sub>di</sub></td><td>0.89 ± 0.0034</td><td>0.65 ± 0.0023</td><td>0.56 ± 0.0125</td><td>0.59 ± 0.0174</td><td>0.57 ± 0.0135</td><td>0.90 ± 0.0132</td><td>0.63 ± 0.0161</td><td>0.58 ± 0.0143</td><td>0.60 ± 0.0210</td><td>0.58 ± 0.0143</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.88 ± 0.0030</td><td>0.63 ± 0.0020</td><td>0.56 ± 0.0107</td><td>0.59 ± 0.0208</td><td>0.57 ± 0.0040</td><td>0.88 ± 0.0041</td><td>0.61 ± 0.0110</td><td>0.56 ± 0.0131</td><td>0.60 ± 0.0098</td><td>0.57 ± 0.0090</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.88 ± 0.0011</td><td>0.64 ± 0.0006</td><td>0.55 ± 0.0030</td><td>0.61 ± 0.0041</td><td>0.57 ± 0.0021</td><td>0.88 ± 0.0059</td><td>0.62 ± 0.0114</td><td>0.58 ± 0.0110</td><td>0.59 ± 0.0103</td><td>0.58 ± 0.0085</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.86 ± 0.0022</td><td>0.58 ± 0.0082</td><td>0.50 ± 0.0011</td><td>0.61 ± 0.0050</td><td>0.54 ± 0.0002</td><td>0.87 ± 0.0002</td><td>0.58 ± 0.0075</td><td>0.49 ± 0.0040</td><td>0.62 ± 0.0077</td><td>0.54 ± 0.0017</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.89 ± 0.0050</td><td>0.65 ± 0.0134</td><td>0.51 ± 0.0076</td><td>0.65 ± 0.0119</td><td>0.57 ± 0.0084</td><td>0.90 ± 0.0096</td><td>0.66 ± 0.0215</td><td>0.57 ± 0.0169</td><td>0.65 ± 0.0133</td><td>0.60 ± 0.0121</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.86 ± 0.0064</td><td>0.56 ± 0.0182</td><td>0.47 ± 0.0137</td><td>0.63 ± 0.0120</td><td>0.53 ± 0.0110</td><td>0.90 ± 0.0064</td><td>0.68 ± 0.0243</td><td>0.68 ± 0.0160</td><td>0.56 ± 0.0157</td><td>0.61 ± 0.0152</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.88 ± 0.0222</td><td>0.66 ± 0.0382</td><td>0.63 ± 0.0180</td><td>0.59 ± 0.0235</td><td>0.60 ± 0.0207</td><td>0.91 ± 0.0502</td><td>0.68 ± 0.0085</td><td>0.65 ± 0.0201</td><td>0.59 ± 0.0437</td><td>0.61 ± 0.0317</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.88 ± 0.0732</td><td>0.63 ± 0.0375</td><td>0.61 ± 0.0467</td><td>0.53 ± 0.0558</td><td>0.56 ± 0.0512</td><td>0.90 ± 0.0132</td><td>0.66 ± 0.0121</td><td>0.69 ± 0.0596</td><td>0.54 ± 0.0641</td><td>0.60 ± 0.0617</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.91 ± 0.0025</td><td>0.69 ± 0.0047</td><td>0.70 ± 0.0012</td><td>0.56 ± 0.0020</td><td>0.62 ± 0.0014</td><td>0.92 ± 0.0013</td><td>0.72 ± 0.0001</td><td>0.69 ± 0.0012</td><td>0.61 ± 0.0002</td><td>0.64 ± 0.0005</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.91 ± 0.0047</td><td>0.70 ± 0.0058</td><td>0.71 ± 0.0110</td><td>0.56 ± 0.0062</td><td>0.62 ± 0.0084</td><td>0.93 ± 0.0002</td><td>0.76 ± 0.0003</td><td>0.73 ± 0.0227</td><td>0.62 ± 0.0219</td><td>0.67 ± 0.0021</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.90 ± 0.0019</td><td>0.70 ± 0.0010</td><td>0.68 ± 0.0014</td><td>0.57 ± 0.0026</td><td><b>0.62 ± 0.0001</b></td><td>0.93 ± 0.0018</td><td>0.76 ± 0.0001</td><td>0.75 ± 0.0119</td><td>0.64 ± 0.0153</td><td><b>0.69 ± 0.0123</b></td></tr><tr><td rowspan="12">ICU</td><td>LSTM</td><td>0.90 ± 0.0254</td><td>0.60 ± 0.0137</td><td>0.56 ± 0.0275</td><td>0.53 ± 0.0233</td><td>0.54 ± 0.0250</td><td>0.92 ± 0.0040</td><td>0.63 ± 0.0080</td><td>0.59 ± 0.0144</td><td>0.57 ± 0.0035</td><td>0.57 ± 0.0060</td></tr><tr><td>LSTM-W<sub>di</sub></td><td>0.92 ± 0.0012</td><td>0.63 ± 0.0037</td><td>0.56 ± 0.0226</td><td>0.61 ± 0.0157</td><td>0.58 ± 0.0169</td><td>0.92 ± 0.0060</td><td>0.65 ± 0.0052</td><td>0.57 ± 0.0018</td><td>0.65 ± 0.0093</td><td>0.60 ± 0.0040</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.91 ± 0.0011</td><td>0.64 ± 0.0010</td><td>0.57 ± 0.0051</td><td>0.58 ± 0.0064</td><td>0.58 ± 0.0050</td><td>0.91 ± 0.0010</td><td>0.62 ± 0.0040</td><td>0.60 ± 0.0028</td><td>0.57 ± 0.0127</td><td>0.58 ± 0.0080</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.91 ± 0.0020</td><td>0.64 ± 0.0004</td><td>0.53 ± 0.0035</td><td>0.63 ± 0.0063</td><td>0.57 ± 0.0005</td><td>0.92 ± 0.0033</td><td>0.64 ± 0.0072</td><td>0.63 ± 0.0088</td><td>0.56 ± 0.0031</td><td>0.59 ± 0.0022</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.89 ± 0.0032</td><td>0.58 ± 0.0080</td><td>0.52 ± 0.0127</td><td>0.57 ± 0.0074</td><td>0.54 ± 0.0098</td><td>0.90 ± 0.0016</td><td>0.59 ± 0.0013</td><td>0.54 ± 0.0064</td><td>0.57 ± 0.0074</td><td>0.55 ± 0.0002</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.90 ± 0.0104</td><td>0.63 ± 0.0234</td><td>0.53 ± 0.0288</td><td>0.61 ± 0.0105</td><td>0.56 ± 0.0191</td><td>0.92 ± 0.0073</td><td>0.64 ± 0.0220</td><td>0.63 ± 0.0216</td><td>0.60 ± 0.0203</td><td>0.61 ± 0.0201</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.88 ± 0.0076</td><td>0.55 ± 0.0224</td><td>0.48 ± 0.0172</td><td>0.61 ± 0.0226</td><td>0.53 ± 0.0186</td><td>0.90 ± 0.0112</td><td>0.60 ± 0.0251</td><td>0.57 ± 0.0284</td><td>0.61 ± 0.0197</td><td>0.58 ± 0.0237</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.90 ± 0.0022</td><td>0.60 ± 0.0402</td><td>0.60 ± 0.0078</td><td>0.55 ± 0.0131</td><td>0.57 ± 0.0102</td><td>0.91 ± 0.0122</td><td>0.65 ± 0.0325</td><td>0.65 ± 0.0179</td><td>0.57 ± 0.0253</td><td>0.60 ± 0.0217</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.90 ± 0.0128</td><td>0.59 ± 0.0352</td><td>0.63 ± 0.0278</td><td>0.51 ± 0.0435</td><td>0.56 ± 0.0392</td><td>0.90 ± 0.0087</td><td>0.60 ± 0.0371</td><td>0.61 ± 0.0136</td><td>0.56 ± 0.0321</td><td>0.58 ± 0.0217</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.93 ± 0.0038</td><td>0.69 ± 0.0131</td><td>0.71 ± 0.0057</td><td>0.56 ± 0.0301</td><td>0.62 ± 0.0172</td><td>0.94 ± 0.0001</td><td>0.72 ± 0.0074</td><td>0.71 ± 0.0017</td><td>0.59 ± 0.0135</td><td>0.64 ± 0.0074</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.93 ± 0.0012</td><td>0.72 ± 0.0034</td><td>0.73 ± 0.0210</td><td>0.57 ± 0.0032</td><td>0.64 ± 0.0103</td><td>0.95 ± 0.0005</td><td>0.75 ± 0.0054</td><td>0.75 ± 0.0002</td><td>0.63 ± 0.0012</td><td>0.68 ± 0.0004</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.93 ± 0.0041</td><td>0.73 ± 0.0035</td><td>0.71 ± 0.0070</td><td>0.59 ± 0.0087</td><td><b>0.64 ± 0.0078</b></td><td>0.96 ± 0.0028</td><td>0.80 ± 0.0076</td><td>0.80 ± 0.0056</td><td>0.64 ± 0.0116</td><td><b>0.71 ± 0.0076</b></td></tr></tbody></table>

### 4.6.1. Mortality prediction

This task is formulated as a binary classification problem, where the label represents the occurrence of a death event. Based on this, we propose the following benchmark tasks for mortality prediction as studied in Purushotham et al. (2018).

* In-hospital mortality: The aim of this task is to predict in-hospital mortality, which involves determining whether a patient will survive his hospitalization period or not.

* In-ICU mortality: Predict whether the patient dies during his stay after being admitted to an ICU.

* Short-term mortality prediction: The objective of this task is to forecast the likelihood of a patient's death within a short period after his admission to the ICU. In this regard, we establish two distinct mortality prediction tasks: the 2-days and 3-days mortality tasks, where the patient passes away within two or three days of his ICU admission, respectively. To accomplish this, we use data from the first 24 h of ICU admission to predict both 2-days and 3-days mortality. However, for 2-days mortality we only use the first 24 h ICU data.

* Long-term mortality prediction: The objective of this task is to predict the likelihood of a patient's death long after they have been discharged from the hospital. Our prediction model focuses on two distinct timeframes, namely, 30-days and 1-year mortality. These timeframes encompass situations where the patient passes away within 30 days or a year after being discharged from the hospital. It is worth noting that we utilize only the first 24-hour data and the first 48-hour data to predict both the 30-days and 1-year mortality.

### 4.6.2. Length of stay prediction

In hospitals, the Length of Stay (LOS) for a patient serves as a crucial metric for assessing the severity of illness, planning care, and allocating resources. Therefore, predicting Patient's LOS become valuable in healthcare management (Kılıç, Yüzkat, Soyalp, & Gülhaş, 2019). We approach this task as a regression problem.

### 4.7. Hyperparameters & evaluation metrics

#### 4.7.1. Model training

We employ a linear layer as the final layer, as shown in (Fig. 3) to generate the logits based on the specific task at hand. Depending on the task, we use different layer types to obtain the desired output. The corresponding loss functions are computed as follows:

* Binary classification

$$Loss(y_t, \hat{y}_t) = -(y_t \log(\hat{y}_t) + (1 - y_t) \log(1 - \hat{y}_t)) \quad (37)$$

where $y$ and $\hat{y}_t$ are the true and predicted labels.

* Regression: Suppose $(p_t)_i$ is the predicted value and the ground truth value is $(y_t)_i$ for stay $s$, then MSE is computed as follows:

$$MSE = \frac{1}{n} \sum_{i=1}^{n} \left( (p_t)_i - (y_t)_i \right)^2 \quad (38)$$

Our cohort encompasses ICU patient data from the initial 24 and 48 h, maintaining consistency across all tasks. Regardless of the architecture employed, the batch size for classification tasks is set at 64, while for regression tasks, it is fixed at 128 during training. We opt for the Adam optimizer with a learning rate of $10^{-3}$ and a decay rate of $10^{-4}$. The models undergo training for 500 epochs, and early stopping is implemented to prevent overfitting. Additionally, to further mitigate overfitting, a dropout rate of 0.3 is incorporated during the training phase.

#### 4.7.2. Evaluation metrics

We employ a 10-fold cross-validation strategy to comprehensively assess the model's performance across various prediction tasks. In this approach, the dataset is randomly divided into ten folds, with each fold constituting 10% of the data for evaluating model performance (test set), while the remaining 90% is designated as the training data. During the training phase, 80% of the training data is used for model training, and the remaining 20% serves as the validation set to optimize the training process.
<table><caption>**Table 3**
In-hospital & ICU Mortality using First 48 HRS DATA on MIMIC III.</caption><thead><tr><th colspan="11">FIRST 48 HOURS DATA</th></tr><tr><th rowspan="2">TASKS</th><th rowspan="2">MODELS</th><th colspan="5">SAPS II FEATURES</th><th colspan="5">ALL FEATURES</th></tr><tr><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th></tr></thead><tbody><tr><td rowspan="10">In-Hospital</td><td>LSTM</td><td>0.90 ± 0.0345</td><td>0.67 ± 0.0205</td><td>0.56 ± 0.0102</td><td>0.64 ± 0.0059</td><td>0.59 ± 0.0076</td><td>0.92 ± 0.0303</td><td>0.69 ± 0.0350</td><td>0.63 ± 0.0091</td><td>0.61 ± 0.0037</td><td>0.61 ± 0.0062</td></tr><tr><td>LSTM-WΔt</td><td>0.92 ± 0.0270</td><td>0.69 ± 0.0523</td><td>0.61 ± 0.0198</td><td>0.60 ± 0.0167</td><td>0.60 ± 0.0212</td><td>0.93 ± 0.0181</td><td>0.72 ± 0.0330</td><td>0.60 ± 0.0225</td><td>0.65 ± 0.0258</td><td>0.62 ± 0.0261</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.91 ± 0.0030</td><td>0.71 ± 0.0034</td><td>0.60 ± 0.0262</td><td>0.68 ± 0.0136</td><td>0.63 ± 0.0127</td><td>0.91 ± 0.0050</td><td>0.71 ± 0.0090</td><td>0.70 ± 0.0042</td><td>0.56 ± 0.0133</td><td>0.62 ± 0.0098</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.91 ± 0.0050</td><td>0.71 ± 0.0033</td><td>0.68 ± 0.0025</td><td>0.59 ± 0.0023</td><td>0.63 ± 0.0021</td><td>0.91 ± 0.0046</td><td>0.71 ± 0.0054</td><td>0.60 ± 0.0025</td><td>0.65 ± 0.0118</td><td>0.62 ± 0.0041</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.89 ± 0.0028</td><td>0.67 ± 0.0032</td><td>0.59 ± 0.0039</td><td>0.63 ± 0.0224</td><td>0.60 ± 0.0086</td><td>0.91 ± 0.0052</td><td>0.67 ± 0.0041</td><td>0.54 ± 0.0099</td><td>0.70 ± 0.0045</td><td>0.60 ± 0.0079</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.90 ± 0.0075</td><td>0.68 ± 0.0150</td><td>0.59 ± 0.0147</td><td>0.65 ± 0.0198</td><td>0.61 ± 0.0125</td><td>0.92 ± 0.0076</td><td>0.71 ± 0.0226</td><td>0.68 ± 0.0136</td><td>0.60 ± 0.0167</td><td>0.63 ± 0.0152</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.89 ± 0.0082</td><td>0.65 ± 0.0103</td><td>0.57 ± 0.0132</td><td>0.63 ± 0.0084</td><td>0.59 ± 0.0104</td><td>0.91 ± 0.0057</td><td>0.70 ± 0.0145</td><td>0.65 ± 0.0106</td><td>0.63 ± 0.0144</td><td>0.63 ± 0.0121</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.89 ± 0.0225</td><td>0.64 ± 0.0332</td><td>0.68 ± 0.0568</td><td>0.54 ± 0.0751</td><td>0.60 ± 0.0902</td><td>0.90 ± 0.0252</td><td>0.70 ± 0.0375</td><td>0.70 ± 0.0043</td><td>0.57 ± 0.0012</td><td>0.62 ± 0.0027</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.90 ± 0.0322</td><td>0.63 ± 0.0542</td><td>0.70 ± 0.0486</td><td>0.53 ± 0.0708</td><td>0.60 ± 0.0632</td><td>0.90 ± 0.0672</td><td>0.71 ± 0.0375</td><td>0.72 ± 0.0169</td><td>0.57 ± 0.0203</td><td>0.63 ± 0.0201</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.92 ± 0.0013</td><td>0.76 ± 0.0011</td><td>0.74 ± 0.0041</td><td>0.59 ± 0.0092</td><td>0.65 ± 0.0060</td><td>0.94 ± 0.0014</td><td>0.78 ± 0.0084</td><td>0.75 ± 0.0045</td><td>0.66 ± 0.0010</td><td>0.70 ± 0.0017</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.94 ± 0.0007</td><td>0.78 ± 0.0007</td><td>0.77 ± 0.0021</td><td>0.63 ± 0.0075</td><td>0.69 ± 0.0030</td><td>0.94 ± 0.0018</td><td>0.80 ± 0.0019</td><td>0.78 ± 0.0046</td><td>0.67 ± 0.0113</td><td>0.72 ± 0.0076</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.94 ± 0.0127</td><td>0.78 ± 0.0047</td><td>0.77 ± 0.0091</td><td>0.65 ± 0.0085</td><td><strong>0.70 ± 0.0080</strong></td><td>0.95 ± 0.0036</td><td>0.81 ± 0.0029</td><td>0.79 ± 0.0101</td><td>0.68 ± 0.0112</td><td><strong>0.73 ± 0.0073</strong></td></tr><tr><td rowspan="10">ICU</td><td>LSTM</td><td>0.92 ± 0.0025</td><td>0.67 ± 0.0101</td><td>0.60 ± 0.0403</td><td>0.57 ± 0.0364</td><td>0.58 ± 0.0516</td><td>0.93 ± 0.0250</td><td>0.69 ± 0.0370</td><td>0.64 ± 0.0527</td><td>0.58 ± 0.0328</td><td>0.60 ± 0.0460</td></tr><tr><td>LSTM-WΔt</td><td>0.95 ± 0.0018</td><td>0.73 ± 0.0319</td><td>0.70 ± 0.0281</td><td>0.62 ± 0.0254</td><td>0.65 ± 0.0221</td><td>0.94 ± 0.0341</td><td>0.72 ± 0.0080</td><td>0.67 ± 0.0122</td><td>0.61 ± 0.0237</td><td>0.63 ± 0.0170</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.94 ± 0.0001</td><td>0.73 ± 0.0017</td><td>0.65 ± 0.0009</td><td>0.66 ± 0.0027</td><td>0.65 ± 0.0002</td><td>0.94 ± 0.0055</td><td>0.71 ± 0.0081</td><td>0.58 ± 0.0115</td><td>0.71 ± 0.0038</td><td>0.63 ± 0.0054</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.94 ± 0.0023</td><td>0.74 ± 0.0049</td><td>0.67 ± 0.0030</td><td>0.64 ± 0.0065</td><td>0.65 ± 0.0030</td><td>0.94 ± 0.0038</td><td>0.72 ± 0.0075</td><td>0.66 ± 0.0129</td><td>0.62 ± 0.0037</td><td>0.63 ± 0.0081</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.91 ± 0.0022</td><td>0.65 ± 0.0004</td><td>0.59 ± 0.0046</td><td>0.62 ± 0.0129</td><td>0.60 ± 0.0006</td><td>0.92 ± 0.0064</td><td>0.68 ± 0.0048</td><td>0.63 ± 0.0031</td><td>0.58 ± 0.0029</td><td>0.60 ± 0.0022</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.92 ± 0.0079</td><td>0.68 ± 0.0185</td><td>0.70 ± 0.0103</td><td>0.58 ± 0.0222</td><td>0.63 ± 0.0141</td><td>0.93 ± 0.0087</td><td>0.68 ± 0.0230</td><td>0.65 ± 0.0195</td><td>0.62 ± 0.0063</td><td>0.63 ± 0.0143</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.91 ± 0.0080</td><td>0.65 ± 0.0141</td><td>0.56 ± 0.0154</td><td>0.69 ± 0.0110</td><td>0.61 ± 0.0130</td><td>0.94 ± 0.0061</td><td>0.74 ± 0.0190</td><td>0.70 ± 0.0167</td><td>0.64 ± 0.0234</td><td>0.66 ± 0.0182</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.92 ± 0.0087</td><td>0.69 ± 0.0125</td><td>0.62 ± 0.0635</td><td>0.66 ± 0.0515</td><td>0.63 ± 0.0502</td><td>0.93 ± 0.0287</td><td>0.70 ± 0.0175</td><td>0.67 ± 0.0403</td><td>0.60 ± 0.0612</td><td>0.63 ± 0.0717</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.92 ± 0.0007</td><td>0.68 ± 0.0032</td><td>0.68 ± 0.0095</td><td>0.57 ± 0.0108</td><td>0.62 ± 0.0101</td><td>0.93 ± 0.0074</td><td>0.69 ± 0.0175</td><td>0.69 ± 0.0178</td><td>0.56 ± 0.0257</td><td>0.61 ± 0.0213</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.95 ± 0.0007</td><td>0.78 ± 0.0035</td><td>0.78 ± 0.0015</td><td>0.64 ± 0.0083</td><td>0.70 ± 0.0048</td><td>0.96 ± 0.0018</td><td>0.79 ± 0.0016</td><td>0.78 ± 0.0053</td><td>0.66 ± 0.0097</td><td>0.71 ± 0.0072</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.96 ± 0.0004</td><td>0.79 ± 0.0022</td><td>0.80 ± 0.0011</td><td>0.63 ± 0.0102</td><td>0.70 ± 0.0012</td><td>0.97 ± 0.0025</td><td>0.83 ± 0.0019</td><td>0.82 ± 0.0022</td><td>0.68 ± 0.0110</td><td>0.74 ± 0.0046</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.96 ± 0.0044</td><td>0.81 ± 0.0122</td><td>0.81 ± 0.0047</td><td>0.66 ± 0.0053</td><td><strong>0.72 ± 0.0042</strong></td><td>0.97 ± 0.0024</td><td>0.85 ± 0.0028</td><td>0.85 ± 0.0057</td><td>0.71 ± 0.0105</td><td><strong>0.77 ± 0.0055</strong></td></tr></tbody></table>

<table><caption>**Table 4**
In-hospital & ICU mortality task on eICU dataset using First 24 & 48 h data.</caption><thead><tr><th colspan="11">MORTALITY TASK</th></tr><tr><th rowspan="2">MODELS</th><th rowspan="2">TASKS</th><th rowspan="2">DATA USED</th><th colspan="5">SAPS II FEATURES</th><th colspan="5">ALL FEATURES</th></tr><tr><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th></tr></thead><tbody><tr><td rowspan="4">MWTA-LSTM-2-ASP</td><td rowspan="2">In-Hospital</td><td>24 HOURS</td><td>0.91 ± 0.0008</td><td>0.62 ± 0.0032</td><td>0.56 ± 0.0078</td><td>0.60 ± 0.0095</td><td>0.57 ± 0.0087</td><td>0.91 ± 0.0023</td><td>0.68 ± 0.0011</td><td>0.61 ± 0.0027</td><td>0.67 ± 0.0063</td><td>0.63 ± 0.0030</td></tr><tr><td>48 HOURS</td><td>0.92 ± 0.0008</td><td>0.67 ± 0.0132</td><td>0.60 ± 0.0231</td><td>0.65 ± 0.0267</td><td>0.62 ± 0.0237</td><td>0.94 ± 0.0073</td><td>0.75 ± 0.0131</td><td>0.70 ± 0.0102</td><td>0.67 ± 0.0048</td><td>0.68 ± 0.0070</td></tr><tr><td rowspan="2">ICU</td><td>24 HOURS</td><td>0.93 ± 0.0053</td><td>0.65 ± 0.0024</td><td>0.63 ± 0.0033</td><td>0.61 ± 0.0047</td><td>0.61 ± 0.0030</td><td>0.93 ± 0.0008</td><td>0.71 ± 0.0052</td><td>0.72 ± 0.0066</td><td>0.64 ± 0.0035</td><td>0.67 ± 0.0050</td></tr><tr><td>48 HOURS</td><td>0.94 ± 0.0088</td><td>0.74 ± 0.0240</td><td>0.72 ± 0.0251</td><td>0.66 ± 0.0198</td><td>0.68 ± 0.0251</td><td>0.96 ± 0.0068</td><td>0.80 ± 0.0040</td><td>0.78 ± 0.0318</td><td>0.70 ± 0.0197</td><td>0.73 ± 0.0423</td></tr></tbody></table>

All performance metrics are computed based on the test dataset. For regression tasks, we report Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE). In classification tasks, we present the mean and standard error of performance scores across all 10 testing folds. Key metrics include AUROC (Area Under the Receiver Operating Characteristics), AUPRC (Area Under the Precision-Recall Curve), Precision, Recall and F1-score. This comprehensive evaluation approach ensures robust and reliable assessments of the model's predictive capabilities.

## 5. Results

In this section, we present the benchmarking results of all prediction algorithms on the MIMIC-III and eICU datasets, including the performance of prediction methods on different feature sets. The reported metrics include the mean and standard deviation of AUROC, AUPRC, and F1-Score per model across all 10 testing folds for all mortality tasks. For length-of-stay (LOS), we provide the RMSE and MAE. These results offer a comprehensive overview of the models' effectiveness in various prediction tasks and highlight their performance across different feature sets.

### 5.1. Mortality prediction task evaluation

In the domain of In-hospital and ICU Mortality Prediction, the outcomes are detailed in (Tables 2 and 3), presenting the results of diverse

prediction algorithms applied to different Feature Sets of the MIMIC-III dataset for both first 24-hour and 48-hour data. A comprehensive analysis of these tables reveals that our proposed framework consistently surpasses all other models in terms of F1-score for both time periods, demonstrating a substantial performance difference. These findings yield several noteworthy observations. Firstly, irrespective of the feature set employed, our architecture consistently achieves a higher F1-score compared to all other models. Moreover, the F1-score demonstrates a significant increase as more features are included as input variables, underscoring the effectiveness of our framework in leveraging additional information to enhance predictive performance. Secondly, with a larger dataset utilized over a 48-hour observation period, our model exhibits substantial performance improvements across various prediction tasks compared to state-of-the-art models, achieving an F1-score exceeding 10%. This suggests that a prolonged observation period, coupled with increased data availability, contributes to enhanced predictive capabilities. Although our framework may sometimes yield a lower recall score compared to baseline models for tasks like 1 year, ICU, and hospital mortality, it consistently outperforms them in F1-score. This underscores its ability to strike a balance between precision and recall across all prediction tasks.

Furthermore, our approach demonstrates a 3.2% improvement in the performance of MWTA-LSTM 2 ASP over MWTA-LSTM 2 without the ASP strategy. To ensure the generalizability of our approach, we have evaluated on eICU dataset, the results are shown in (Table 4)
<figure><img src="image_12.png" /><figcaption>Fig. 7. Pairwise comparisons (p-value < 0.05), conducted on F1-scores across the 10 testing folds for Feature Set B over a 48-hours period, reveal the significance of the models in predicting ICU Mortality. A lower p-value indicates greater statistical significance.</figcaption></figure>

and from the results, we can see that, our model always achieves a remarkable result when more features are used. This improvement can be attributed to the careful modeling of irregular timing, intervention effects, and the handling of outliers, which allows our model to better capture the underlying patterns and variability present in the patient data.

In the domain of Short-term and Long-term Mortality Prediction, (Tables 5 and 6) showcase the outcomes of these tasks, utilizing diverse feature sets from the MIMIC-III dataset for both 24-hour and 48-hour data. Notably, our framework still consistently achieves top-tier results across AUROC, AUPRC, and F1-score metrics, demonstrating its effectiveness in predicting both short-term and long-term mortality.

More specifically, for short-term mortality (2 and 3 days), our framework stands out with an impressive F1-score exceeding 10%, while for long-term mortality tasks (30 days and One year) in the 24-hour data, it maintains an F1-score above 7%. These robust results persist even when expanding the dataset to include the initial 48 h of patient data.

In summary, The MWTA-LSTM 2 with ASP emerges as the superior model. It demonstrates exceptional performance in handling outliers and accurately capturing central tendencies and variability in patient data when compared to alternative models.

Moreover, we conducted p-value calculations on the testing folds to perform pairwise comparisons among all the models. The results obtained unequivocally demonstrate a significant difference between the models in terms of mortality prediction tasks. Importantly, our proposed framework, **MWTA-LSTM-2** with ASP or without ASP consistently outperform all other models, as evidenced by the averaged F1-score displayed in (Fig. 7) and (Fig. A.1) for ICU & In-hospital mortality task. Below are two use cases that provide explanations for the figures related to the ICU Mortality task.

The paired samples t-test comparing **ATTAIN** to **MWTA-LSTM-ASP** yielded a highly significant result, with a P-value of 7.7e-09 and a t-statistic of -20, as depicted in (Figs. 7(a) and 7(b)). The remarkably small p-value strongly rejects the null hypothesis, providing robust evidence of a substantial difference between the two models. The negative t-statistic suggests that the mean of **ATTAIN** is

significantly lower than that of **MWTA-LSTM-ASP**. In summary, the t-test results affirm a statistically significant distinction between **ATTAIN** and **MWTA-LSTM-ASP**, with the negative t-statistic emphasizing the superiority of MWTA-LSTM-ASP over **ATTAIN**.

Additionally, the paired samples t-test comparing **MWTA-LSTM-2 MP** to **MWTA-LSTM-ASP** revealed a highly significant result, with a P-value of 0.00091 and a t-statistic of -4.9, as illustrated in (Figs. 7(a) and 7(b)). The small p-value indicates compelling evidence against the null hypothesis, signifying a substantial difference between the two models. The negative t-statistic further suggests that the mean of **MWTA-LSTM-2 MP** is lower than that of **MWTA-LSTM-ASP**. In summary, the t-test results confirm a statistically significant distinction between **MWTA-LSTM-2** and **MWTA-LSTM-ASP**, providing substantial evidence that **MWTA-LSTM-ASP** significantly outperforms the former. Overall, similar analyses were conducted for all other baseline models, yielding consistent results.

## 5.2. Length of stay prediction task evaluation

In regards to the Length of Stay (LOS) task, we evaluate the accuracy of predicted values compared to actual values in the test set using two metrics: mean absolute error (MAE) and root mean squared error (RMSE). The minimum, and maximum LOS for the entire population recorded were 1.2 and 173.07 days, respectively. The error values per day, measured by both MAE and RMSE, for all models, are presented in (Table 7). The best performance was achieved with a MAE of 1.21 days.

Among all the models, the MWTA-LSTM 2 ASP model consistently outperforms the others across all metrics, as shown in (Table 7). Our model demonstrates superior performance compared to state-of-the-art approaches and two other proposed models. Regardless of the features used (set A or B) and the range of observation data utilized as inputs, our model's predictions for RMSE range from 3 to 4 days when compared to the actual data.

When analyzing the performance on eICU and MIMIC-III datasets (Table 7) and (Table 8), we observe a similar pattern of results. However, there are noticeable variations in the metric magnitudes, which can be attributed to the differences in their LOS distributions. Both datasets exhibit a positive skew, but the skew is more severe in the eICU dataset than the MIMIC-III dataset as shown in (Fig. 8). This skew has a disproportionate impact on the absolute error, captured by the MSE and MAE metrics since the majority of patients spend fewer than
<table><caption>**Table 5**
Short-term & Long-term Mortality using 24 HRS DATA on MIMIC III.</caption><caption>FIRST 24 HOURS DATA</caption><thead><tr><th rowspan="2">TASKS</th><th rowspan="2">MODELS</th><th colspan="5">SAPS II FEATURES</th><th colspan="5">ALL FEATURES</th></tr><tr><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th></tr></thead><tbody><tr><td rowspan="12">2-DAYS</td><td>LSTM</td><td>0.96 ± 0.0090</td><td>0.70 ± 0.0044</td><td>0.70 ± 0.0152</td><td>0.61 ± 0.0100</td><td>0.65 ± 0.0110</td><td>0.96 ± 0.0101</td><td>0.72 ± 0.0160</td><td>0.73 ± 0.0193</td><td>0.62 ± 0.0263</td><td>0.67 ± 0.0180</td></tr><tr><td>LSTM-W4t</td><td>0.97 ± 0.0023</td><td>0.77 ± 0.0125</td><td>0.77 ± 0.0232</td><td>0.71 ± 0.0218</td><td>0.73 ± 0.0213</td><td>0.95 ± 0.0270</td><td>0.76 ± 0.0410</td><td>0.81 ± 0.0341</td><td>0.66 ± 0.0139</td><td>0.72 ± 0.0221</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.96 ± 0.0128</td><td>0.76 ± 0.0114</td><td>0.74 ± 0.0174</td><td>0.67 ± 0.0017</td><td>0.70 ± 0.0087</td><td>0.95 ± 0.0038</td><td>0.71 ± 0.0008</td><td>0.81 ± 0.0113</td><td>0.60 ± 0.0085</td><td>0.68 ± 0.0088</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.97 ± 0.0004</td><td>0.78 ± 0.0070</td><td>0.86 ± 0.0156</td><td>0.64 ± 0.0201</td><td>0.73 ± 0.0190</td><td>0.94 ± 0.0010</td><td>0.68 ± 0.0086</td><td>0.70 ± 0.0002</td><td>0.57 ± 0.0070</td><td>0.62 ± 0.0039</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.94 ± 0.0004</td><td>0.64 ± 0.0040</td><td>0.69 ± 0.0027</td><td>0.52 ± 0.0053</td><td>0.59 ± 0.0025</td><td>0.94 ± 0.0037</td><td>0.67 ± 0.0147</td><td>0.75 ± 0.0399</td><td>0.55 ± 0.0052</td><td>0.63 ± 0.0141</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.94 ± 0.0126</td><td>0.72 ± 0.0254</td><td>0.70 ± 0.0122</td><td>0.66 ± 0.0226</td><td>0.67 ± 0.0167</td><td>0.94 ± 0.0149</td><td>0.76 ± 0.0295</td><td>0.77 ± 0.0257</td><td>0.66 ± 0.0168</td><td>0.71 ± 0.0211</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.93 ± 0.0022</td><td>0.64 ± 0.0260</td><td>0.75 ± 0.0279</td><td>0.55 ± 0.0266</td><td>0.63 ± 0.0261</td><td>0.95 ± 0.0085</td><td>0.70 ± 0.0257</td><td>0.70 ± 0.0244</td><td>0.66 ± 0.0269</td><td>0.67 ± 0.0251</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.94 ± 0.0208</td><td>0.70 ± 0.0112</td><td>0.68 ± 0.0315</td><td>0.65 ± 0.0512</td><td>0.66 ± 0.0402</td><td>0.95 ± 0.0052</td><td>0.75 ± 0.0055</td><td>0.72 ± 0.0193</td><td>0.66 ± 0.0207</td><td>0.68 ± 0.0237</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.94 ± 0.0302</td><td>0.70 ± 0.0082</td><td>0.68 ± 0.0012</td><td>0.63 ± 0.0029</td><td>0.65 ± 0.0022</td><td>0.95 ± 0.0062</td><td>0.73 ± 0.0075</td><td>0.71 ± 0.0014</td><td>0.68 ± 0.0023</td><td>0.69 ± 0.0017</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.96 ± 0.0101</td><td>0.81 ± 0.0100</td><td>0.92 ± 0.0215</td><td>0.67 ± 0.0312</td><td>0.77 ± 0.0255</td><td>0.97 ± 0.0031</td><td>0.85 ± 0.0090</td><td>0.87 ± 0.0077</td><td>0.73 ± 0.0221</td><td>0.79 ± 0.0146</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.97 ± 0.0030</td><td>0.84 ± 0.0019</td><td>0.95 ± 0.0131</td><td>0.65 ± 0.0103</td><td>0.77 ± 0.0025</td><td>0.98 ± 0.0017</td><td>0.87 ± 0.0038</td><td>0.93 ± 0.0084</td><td>0.75 ± 0.0373</td><td>0.83 ± 0.0201</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.97 ± 0.0037</td><td>0.86 ± 0.0049</td><td>0.95 ± 0.0014</td><td>0.68 ± 0.0042</td><td><strong>0.79 ± 0.0023</strong></td><td>0.98 ± 0.0042</td><td>0.90 ± 0.0022</td><td>0.95 ± 0.0036</td><td>0.79 ± 0.0156</td><td><strong>0.86 ± 0.0087</strong></td></tr><tr><td rowspan="12">3-DAYS</td><td>LSTM</td><td>0.94 ± 0.0016</td><td>0.67 ± 0.0205</td><td>0.64 ± 0.0031</td><td>0.58 ± 0.0182</td><td>0.60 ± 0.0121</td><td>0.95 ± 0.0032</td><td>0.68 ± 0.0110</td><td>0.65 ± 0.0182</td><td>0.63 ± 0.0133</td><td>0.63 ± 0.0083</td></tr><tr><td>LSTM-W4t</td><td>0.94 ± 0.0024</td><td>0.69 ± 0.0375</td><td>0.67 ± 0.0199</td><td>0.59 ± 0.0041</td><td>0.62 ± 0.0141</td><td>0.97 ± 0.0080</td><td>0.72 ± 0.0730</td><td>0.70 ± 0.0183</td><td>0.62 ± 0.0259</td><td>0.65 ± 0.0217</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.93 ± 0.0081</td><td>0.68 ± 0.0119</td><td>0.79 ± 0.0170</td><td>0.55 ± 0.0183</td><td>0.64 ± 0.0184</td><td>0.93 ± 0.0005</td><td>0.64 ± 0.0111</td><td>0.61 ± 0.0015</td><td>0.61 ± 0.0012</td><td>0.61 ± 0.0007</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.94 ± 0.0044</td><td>0.71 ± 0.0022</td><td>0.81 ± 0.0288</td><td>0.56 ± 0.0167</td><td>0.66 ± 0.0124</td><td>0.92 ± 0.0015</td><td>0.60 ± 0.0005</td><td>0.63 ± 0.0107</td><td>0.51 ± 0.0040</td><td>0.56 ± 0.0056</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.92 ± 0.0019</td><td>0.59 ± 0.0102</td><td>0.69 ± 0.0412</td><td>0.52 ± 0.0173</td><td>0.56 ± 0.0262</td><td>0.92 ± 0.0001</td><td>0.63 ± 0.0017</td><td>0.69 ± 0.0253</td><td>0.51 ± 0.0137</td><td>0.58 ± 0.0143</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.92 ± 0.0135</td><td>0.67 ± 0.0392</td><td>0.66 ± 0.0416</td><td>0.64 ± 0.0383</td><td>0.64 ± 0.0369</td><td>0.94 ± 0.0087</td><td>0.69 ± 0.0273</td><td>0.71 ± 0.0286</td><td>0.61 ± 0.0353</td><td>0.65 ± 0.0305</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.90 ± 0.0154</td><td>0.63 ± 0.0300</td><td>0.64 ± 0.0279</td><td>0.56 ± 0.0190</td><td>0.59 ± 0.0233</td><td>0.92 ± 0.0146</td><td>0.66 ± 0.0242</td><td>0.69 ± 0.0193</td><td>0.53 ± 0.0231</td><td>0.60 ± 0.0210</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.91 ± 0.0642</td><td>0.68 ± 0.0385</td><td>0.68 ± 0.0451</td><td>0.62 ± 0.0501</td><td>0.64 ± 0.0502</td><td>0.93 ± 0.0432</td><td>0.70 ± 0.0375</td><td>0.72 ± 0.0015</td><td>0.62 ± 0.0032</td><td>0.66 ± 0.0017</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.92 ± 0.0267</td><td>0.67 ± 0.0102</td><td>0.68 ± 0.0147</td><td>0.61 ± 0.0363</td><td>0.64 ± 0.0252</td><td>0.93 ± 0.0052</td><td>0.68 ± 0.0035</td><td>0.70 ± 0.0189</td><td>0.61 ± 0.0285</td><td>0.65 ± 0.0237</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.96 ± 0.0012</td><td>0.75 ± 0.0059</td><td>0.83 ± 0.0101</td><td>0.61 ± 0.0140</td><td>0.70 ± 0.0115</td><td>0.96 ± 0.0030</td><td>0.79 ± 0.0008</td><td>0.83 ± 0.0108</td><td>0.69 ± 0.0138</td><td>0.75 ± 0.0119</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.96 ± 0.0027</td><td>0.78 ± 0.0033</td><td>0.88 ± 0.0025</td><td>0.63 ± 0.0134</td><td>0.73 ± 0.0061</td><td>0.98 ± 0.0048</td><td>0.85 ± 0.0016</td><td>0.88 ± 0.0025</td><td>0.70 ± 0.0313</td><td>0.78 ± 0.0161</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.96 ± 0.0012</td><td>0.80 ± 0.0030</td><td>0.87 ± 0.0057</td><td>0.68 ± 0.0109</td><td><strong>0.76 ± 0.0080</strong></td><td>0.98 ± 0.0020</td><td>0.86 ± 0.0054</td><td>0.90 ± 0.0031</td><td>0.72 ± 0.0137</td><td><strong>0.80 ± 0.0072</strong></td></tr><tr><td>LSTM</td><td>0.86 ± 0.0016</td><td>0.63 ± 0.0050</td><td>0.55 ± 0.0088</td><td>0.62 ± 0.0130</td><td>0.58 ± 0.0060</td><td>0.89 ± 0.0042</td><td>0.67 ± 0.0080</td><td>0.61 ± 0.0056</td><td>0.60 ± 0.0157</td><td>0.60 ± 0.0105</td></tr><tr><td>LSTM-W4t</td><td>0.89 ± 0.0012</td><td>0.68 ± 0.0024</td><td>0.62 ± 0.0042</td><td>0.61 ± 0.0023</td><td>0.61 ± 0.0010</td><td>0.89 ± 0.0011</td><td>0.68 ± 0.0052</td><td>0.61 ± 0.0112</td><td>0.62 ± 0.0014</td><td>0.61 ± 0.0035</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.87 ± 0.0065</td><td>0.64 ± 0.0060</td><td>0.56 ± 0.0084</td><td>0.61 ± 0.0060</td><td>0.58 ± 0.0062</td><td>0.88 ± 0.0013</td><td>0.64 ± 0.0051</td><td>0.58 ± 0.0089</td><td>0.63 ± 0.0036</td><td>0.60 ± 0.0045</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.88 ± 0.0016</td><td>0.64 ± 0.0033</td><td>0.55 ± 0.0047</td><td>0.64 ± 0.0052</td><td>0.59 ± 0.0004</td><td>0.87 ± 0.0031</td><td>0.64 ± 0.0086</td><td>0.56 ± 0.0034</td><td>0.65 ± 0.0038</td><td>0.60 ± 0.0029</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.86 ± 0.0010</td><td>0.62 ± 0.0011</td><td>0.52 ± 0.0046</td><td>0.64 ± 0.0026</td><td>0.57 ± 0.0019</td><td>0.86 ± 0.0014</td><td>0.61 ± 0.0014</td><td>0.54 ± 0.0128</td><td>0.62 ± 0.0130</td><td>0.57 ± 0.0029</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.84 ± 0.0047</td><td>0.66 ± 0.0123</td><td>0.53 ± 0.0125</td><td>0.65 ± 0.0124</td><td>0.58 ± 0.0098</td><td>0.89 ± 0.0010</td><td>0.67 ± 0.0192</td><td>0.58 ± 0.0182</td><td>0.66 ± 0.0201</td><td>0.61 ± 0.0177</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.85 ± 0.0057</td><td>0.60 ± 0.0123</td><td>0.55 ± 0.0110</td><td>0.58 ± 0.0133</td><td>0.56 ± 0.0121</td><td>0.88 ± 0.0071</td><td>0.66 ± 0.0250</td><td>0.58 ± 0.0089</td><td>0.63 ± 0.0155</td><td>0.60 ± 0.0120</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.87 ± 0.0374</td><td>0.65 ± 0.0262</td><td>0.58 ± 0.0088</td><td>0.63 ± 0.0021</td><td>0.60 ± 0.0052</td><td>0.90 ± 0.0502</td><td>0.68 ± 0.0135</td><td>0.61 ± 0.0471</td><td>0.63 ± 0.0369</td><td>0.61 ± 0.0417</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.87 ± 0.0542</td><td>0.63 ± 0.0048</td><td>0.58 ± 0.0056</td><td>0.60 ± 0.0024</td><td>0.58 ± 0.0033</td><td>0.89 ± 0.0371</td><td>0.66 ± 0.0218</td><td>0.60 ± 0.0089</td><td>0.61 ± 0.0057</td><td>0.60 ± 0.0073</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.89 ± 0.0067</td><td>0.66 ± 0.0114</td><td>0.64 ± 0.0073</td><td>0.59 ± 0.0093</td><td>0.61 ± 0.0088</td><td>0.91 ± 0.0043</td><td>0.73 ± 0.0049</td><td>0.67 ± 0.0010</td><td>0.65 ± 0.0027</td><td>0.65 ± 0.0016</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.90 ± 0.0007</td><td>0.69 ± 0.0068</td><td>0.66 ± 0.0107</td><td>0.59 ± 0.0034</td><td><strong>0.62 ± 0.0051</strong></td><td>0.93 ± 0.0012</td><td>0.77 ± 0.0019</td><td>0.71 ± 0.0014</td><td>0.67 ± 0.0108</td><td>0.69 ± 0.0010</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.91 ± 0.0057</td><td>0.70 ± 0.0168</td><td>0.66 ± 0.0234</td><td>0.60 ± 0.0114</td><td>0.62 ± 0.0151</td><td>0.93 ± 0.0004</td><td>0.79 ± 0.0021</td><td>0.74 ± 0.0034</td><td>0.67 ± 0.0050</td><td><strong>0.70 ± 0.0024</strong></td></tr><tr><td rowspan="12">1-YEAR</td><td>LSTM</td><td>0.83 ± 0.0050</td><td>0.68 ± 0.0040</td><td>0.57 ± 0.0140</td><td>0.72 ± 0.0204</td><td>0.63 ± 0.0100</td><td>0.85 ± 0.0010</td><td>0.72 ± 0.0030</td><td>0.57 ± 0.0120</td><td>0.76 ± 0.0070</td><td>0.65 ± 0.0040</td></tr><tr><td>LSTM-W4t</td><td>0.84 ± 0.0040</td><td>0.70 ± 0.0070</td><td>0.58 ± 0.0004</td><td>0.73 ± 0.0042</td><td>0.64 ± 0.0014</td><td>0.84 ± 0.0040</td><td>0.71 ± 0.0060</td><td>0.58 ± 0.0055</td><td>0.75 ± 0.0087</td><td>0.65 ± 0.0007</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.82 ± 0.0018</td><td>0.69 ± 0.0017</td><td>0.60 ± 0.0091</td><td>0.69 ± 0.0120</td><td>0.64 ± 0.0068</td><td>0.85 ± 0.0032</td><td>0.72 ± 0.0036</td><td>0.60 ± 0.0077</td><td>0.75 ± 0.0022</td><td>0.66 ± 0.0040</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.84 ± 0.0004</td><td>0.71 ± 0.0007</td><td>0.59 ± 0.0039</td><td>0.71 ± 0.0045</td><td>0.64 ± 0.0004</td><td>0.83 ± 0.0006</td><td>0.69 ± 0.0002</td><td>0.59 ± 0.0079</td><td>0.72 ± 0.0013</td><td>0.64 ± 0.0005</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.82 ± 0.0072</td><td>0.68 ± 0.0085</td><td>0.58 ± 0.0090</td><td>0.67 ± 0.0130</td><td>0.62 ± 0.0107</td><td>0.83 ± 0.0033</td><td>0.68 ± 0.0054</td><td>0.58 ± 0.0052</td><td>0.72 ± 0.0054</td><td>0.64 ± 0.0011</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.83 ± 0.0080</td><td>0.60 ± 0.0132</td><td>0.53 ± 0.0073</td><td>0.71 ± 0.0122</td><td>0.60 ± 0.0101</td><td>0.84 ± 0.0067</td><td>0.71 ± 0.0116</td><td>0.58 ± 0.0070</td><td>0.76 ± 0.0089</td><td>0.65 ± 0.0078</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.83 ± 0.0068</td><td>0.67 ± 0.0130</td><td>0.57 ± 0.0148</td><td>0.72 ± 0.0067</td><td>0.63 ± 0.0080</td><td>0.85 ± 0.0146</td><td>0.68 ± 0.0121</td><td>0.56 ± 0.0113</td><td>0.74 ± 0.0091</td><td>0.63 ± 0.0101</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.84 ± 0.0331</td><td>0.68 ± 0.0044</td><td>0.64 ± 0.0116</td><td>0.61 ± 0.0363</td><td>0.62 ± 0.0202</td><td>0.85 ± 0.0411</td><td>0.73 ± 0.0234</td><td>0.64 ± 0.0047</td><td>0.66 ± 0.0029</td><td>0.64 ± 0.0037</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.84 ± 0.0642</td><td>0.66 ± 0.0044</td><td>0.58 ± 0.0436</td><td>0.65 ± 0.0215</td><td>0.61 ± 0.0308</td><td>0.86 ± 0.0574</td><td>0.71 ± 0.0370</td><td>0.60 ± 0.0025</td><td>0.65 ± 0.0016</td><td>0.62 ± 0.0017</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.84 ± 0.0040</td><td>0.72 ± 0.0010</td><td>0.62 ± 0.0020</td><td>0.69 ± 0.0011</td><td>0.65 ± 0.0011</td><td>0.87 ± 0.0032</td><td>0.77 ± 0.0069</td><td>0.68 ± 0.0015</td><td>0.71 ± 0.0003</td><td>0.69 ± 0.0005</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.84 ± 0.0011</td><td>0.72 ± 0.0005</td><td>0.62 ± 0.0008</td><td>0.69 ± 0.0010</td><td>0.65 ± 0.0008</td><td>0.88 ± 0.0014</td><td>0.78 ± 0.0021</td><td>0.68 ± 0.0069</td><td>0.72 ± 0.0002</td><td>0.70 ± 0.0035</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.85 ± 0.0211</td><td>0.74 ± 0.0064</td><td>0.64 ± 0.0380</td><td>0.69 ± 0.0108</td><td><strong>0.66 ± 0.0208</strong></td><td>0.90 ± 0.0025</td><td>0.81 ± 0.0004</td><td>0.70 ± 0.0015</td><td>0.74 ± 0.0061</td><td><strong>0.72 ± 0.0013</strong></td></tr></tbody></table>

4 days. Consequently, predicting LOS becomes a challenging task due to this pattern.

Considering all the results obtained from the prediction task, we draw the following observations: our architecture performs significantly better when utilizing more features for prediction. This suggests that our model can effectively learn feature representations from multiple data modalities and effectively handle the irregular timing patterns present in electronic health record (EHR) data.

### 5.3. Ablation study

To evaluate the impact of auxiliary components in our model, we conducted an ablation study, systematically removing these components individually or collectively and comparing the resulting variants with the original MWTA-LSTM.

The experimental results for ICU and Hospital mortality prediction tasks on MIMIC-III are presented in (Table 9), where “w/o”
<table><caption>**Table 6**
Short & Long term Mortality using 48 HRS DATA on MIMIC III.</caption><caption>FIRST 48 HOURS DATA</caption><thead><tr><th rowspan="2">TASKS</th><th rowspan="2">MODELS</th><th colspan="5">SAPS II FEATURES</th><th colspan="5">ALL FEATURES</th></tr><tr><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th></tr></thead><tbody><tr><td rowspan="10">3-DAYS</td><td>LSTM</td><td>0.96 ± 0.0624</td><td>0.73 ± 0.0320</td><td>0.74 ± 0.0148</td><td>0.67 ± 0.0321</td><td>0.70 ± 0.0251</td><td>0.96 ± 0.0660</td><td>0.77 ± 0.0220</td><td>0.80 ± 0.0164</td><td>0.68 ± 0.0272</td><td>0.73 ± 0.0217</td></tr><tr><td>LSTM-W4t</td><td>0.94 ± 0.0423</td><td>0.78 ± 0.0710</td><td>0.80 ± 0.0129</td><td>0.73 ± 0.0281</td><td>0.76 ± 0.0202</td><td>0.96 ± 0.0040</td><td>0.84 ± 0.0251</td><td>0.83 ± 0.0154</td><td>0.77 ± 0.0017</td><td>0.79 ± 0.0063</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.97 ± 0.0047</td><td>0.85 ± 0.0019</td><td>0.85 ± 0.0100</td><td>0.75 ± 0.0102</td><td>0.80 ± 0.0013</td><td>0.96 ± 0.0005</td><td>0.79 ± 0.0032</td><td>0.83 ± 0.0042</td><td>0.66 ± 0.0101</td><td>0.73 ± 0.0046</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.97 ± 0.0010</td><td>0.86 ± 0.0020</td><td>0.90 ± 0.0029</td><td>0.76 ± 0.0046</td><td>0.82 ± 0.0040</td><td>0.96 ± 0.0015</td><td>0.80 ± 0.0060</td><td>0.85 ± 0.0192</td><td>0.67 ± 0.0006</td><td>0.74 ± 0.0071</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.92 ± 0.0022</td><td>0.73 ± 0.0004</td><td>0.76 ± 0.0074</td><td>0.66 ± 0.0058</td><td>0.70 ± 0.0006</td><td>0.95 ± 0.0011</td><td>0.77 ± 0.0042</td><td>0.85 ± 0.0309</td><td>0.65 ± 0.0061</td><td>0.73 ± 0.0173</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.95 ± 0.0342</td><td>0.76 ± 0.0232</td><td>0.74 ± 0.0261</td><td>0.71 ± 0.0376</td><td>0.72 ± 0.0402</td><td>0.96 ± 0.0203</td><td>0.82 ± 0.0180</td><td>0.83 ± 0.0284</td><td>0.74 ± 0.0183</td><td>0.78 ± 0.0221</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.94 ± 0.0100</td><td>0.72 ± 0.0115</td><td>0.71 ± 0.0119</td><td>0.67 ± 0.0138</td><td>0.68 ± 0.0128</td><td>0.95 ± 0.0013</td><td>0.80 ± 0.0232</td><td>0.84 ± 0.0097</td><td>0.69 ± 0.0279</td><td>0.75 ± 0.0185</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.95 ± 0.0351</td><td>0.80 ± 0.0182</td><td>0.83 ± 0.0063</td><td>0.73 ± 0.0067</td><td>0.77 ± 0.0057</td><td>0.97 ± 0.0002</td><td>0.84 ± 0.0375</td><td>0.84 ± 0.0452</td><td>0.78 ± 0.0768</td><td>0.80 ± 0.0617</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.95 ± 0.0047</td><td>0.78 ± 0.0483</td><td>0.81 ± 0.0517</td><td>0.73 ± 0.0708</td><td>0.76 ± 0.0607</td><td>0.96 ± 0.0532</td><td>0.84 ± 0.0065</td><td>0.83 ± 0.0025</td><td>0.77 ± 0.0063</td><td>0.79 ± 0.0042</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.98 ± 0.0018</td><td>0.90 ± 0.0029</td><td>0.93 ± 0.0031</td><td>0.79 ± 0.0043</td><td>0.85 ± 0.0036</td><td>0.99 ± 0.0043</td><td>0.91 ± 0.0057</td><td>0.92 ± 0.0008</td><td>0.82 ± 0.0032</td><td>0.86 ± 0.0011</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.98 ± 0.0056</td><td>0.92 ± 0.0100</td><td>0.94 ± 0.0083</td><td>0.81 ± 0.0031</td><td><strong>0.87 ± 0.0053</strong></td><td>0.99 ± 0.0033</td><td>0.94 ± 0.0138</td><td>0.95 ± 0.0002</td><td>0.84 ± 0.0439</td><td>0.89 ± 0.0219</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.98 ± 0.0086</td><td>0.93 ± 0.0122</td><td>0.94 ± 0.0147</td><td>0.81 ± 0.0232</td><td>0.87 ± 0.0153</td><td>0.99 ± 0.0011</td><td>0.95 ± 0.0064</td><td>0.94 ± 0.0015</td><td>0.91 ± 0.0230</td><td><strong>0.92 ± 0.0103</strong></td></tr><tr><td rowspan="10">30-DAYS</td><td>LSTM</td><td>0.87 ± 0.0344</td><td>0.68 ± 0.0228</td><td>0.59 ± 0.0029</td><td>0.61 ± 0.0104</td><td>0.59 ± 0.0063</td><td>0.89 ± 0.0230</td><td>0.70 ± 0.0151</td><td>0.60 ± 0.0331</td><td>0.61 ± 0.0360</td><td>0.60 ± 0.0023</td></tr><tr><td>LSTM-W4t</td><td>0.90 ± 0.0660</td><td>0.69 ± 0.0177</td><td>0.58 ± 0.0406</td><td>0.65 ± 0.0126</td><td>0.61 ± 0.0380</td><td>0.91 ± 0.0023</td><td>0.72 ± 0.0219</td><td>0.66 ± 0.0253</td><td>0.62 ± 0.0145</td><td>0.63 ± 0.0133</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.89 ± 0.0003</td><td>0.70 ± 0.0042</td><td>0.64 ± 0.0111</td><td>0.61 ± 0.0083</td><td>0.62 ± 0.0010</td><td>0.89 ± 0.0014</td><td>0.68 ± 0.0029</td><td>0.58 ± 0.0011</td><td>0.67 ± 0.0097</td><td>0.62 ± 0.0004</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.89 ± 0.0014</td><td>0.70 ± 0.0017</td><td>0.61 ± 0.0069</td><td>0.66 ± 0.0026</td><td>0.63 ± 0.0047</td><td>0.89 ± 0.0014</td><td>0.70 ± 0.0017</td><td>0.61 ± 0.0071</td><td>0.66 ± 0.0065</td><td>0.63 ± 0.0047</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.87 ± 0.0010</td><td>0.65 ± 0.0004</td><td>0.58 ± 0.0070</td><td>0.67 ± 0.0184</td><td>0.60 ± 0.0006</td><td>0.88 ± 0.0002</td><td>0.67 ± 0.0044</td><td>0.60 ± 0.0128</td><td>0.63 ± 0.0017</td><td>0.61 ± 0.0070</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.88 ± 0.0022</td><td>0.67 ± 0.0082</td><td>0.59 ± 0.0013</td><td>0.63 ± 0.0058</td><td>0.60 ± 0.0002</td><td>0.90 ± 0.0067</td><td>0.68 ± 0.0134</td><td>0.59 ± 0.0171</td><td>0.65 ± 0.0105</td><td>0.61 ± 0.0094</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.87 ± 0.0077</td><td>0.64 ± 0.0120</td><td>0.59 ± 0.0183</td><td>0.61 ± 0.0106</td><td>0.59 ± 0.0133</td><td>0.89 ± 0.0043</td><td>0.70 ± 0.0090</td><td>0.61 ± 0.0164</td><td>0.65 ± 0.0053</td><td>0.62 ± 0.0103</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.88 ± 0.0164</td><td>0.70 ± 0.0351</td><td>0.59 ± 0.0088</td><td>0.63 ± 0.0056</td><td>0.60 ± 0.0067</td><td>0.90 ± 0.0502</td><td>0.73 ± 0.0025</td><td>0.69 ± 0.0014</td><td>0.57 ± 0.0041</td><td>0.62 ± 0.0017</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.88 ± 0.0052</td><td>0.70 ± 0.0182</td><td>0.61 ± 0.0349</td><td>0.63 ± 0.0107</td><td>0.61 ± 0.0602</td><td>0.89 ± 0.0288</td><td>0.72 ± 0.0375</td><td>0.69 ± 0.0037</td><td>0.57 ± 0.0049</td><td>0.62 ± 0.0038</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.90 ± 0.0001</td><td>0.74 ± 0.0050</td><td>0.64 ± 0.0078</td><td>0.67 ± 0.0039</td><td>0.65 ± 0.0057</td><td>0.92 ± 0.0012</td><td>0.77 ± 0.0016</td><td>0.73 ± 0.0025</td><td>0.65 ± 0.0054</td><td>0.68 ± 0.0036</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.91 ± 0.0027</td><td>0.75 ± 0.0053</td><td>0.69 ± 0.0007</td><td>0.67 ± 0.0027</td><td>0.67 ± 0.0015</td><td>0.93 ± 0.0033</td><td>0.82 ± 0.0036</td><td>0.78 ± 0.0101</td><td>0.67 ± 0.0200</td><td>0.72 ± 0.0079</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.92 ± 0.0047</td><td>0.77 ± 0.0083</td><td>0.70 ± 0.0104</td><td>0.67 ± 0.0128</td><td><strong>0.68 ± 0.0115</strong></td><td>0.94 ± 0.0021</td><td>0.82 ± 0.0002</td><td>0.81 ± 0.0045</td><td>0.67 ± 0.0073</td><td><strong>0.73 ± 0.0036</strong></td></tr><tr><td rowspan="10">1-YEAR</td><td>LSTM</td><td>0.84 ± 0.0010</td><td>0.69 ± 0.0017</td><td>0.59 ± 0.0089</td><td>0.63 ± 0.0114</td><td>0.60 ± 0.0050</td><td>0.85 ± 0.0043</td><td>0.72 ± 0.0061</td><td>0.56 ± 0.0180</td><td>0.68 ± 0.0168</td><td>0.61 ± 0.0130</td></tr><tr><td>LSTM-W4t</td><td>0.84 ± 0.0051</td><td>0.71 ± 0.0057</td><td>0.60 ± 0.0123</td><td>0.63 ± 0.0259</td><td>0.61 ± 0.0170</td><td>0.86 ± 0.0017</td><td>0.73 ± 0.0002</td><td>0.61 ± 0.0050</td><td>0.67 ± 0.0061</td><td>0.63 ± 0.0012</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>0.84 ± 0.0060</td><td>0.71 ± 0.0080</td><td>0.58 ± 0.0002</td><td>0.73 ± 0.0226</td><td>0.64 ± 0.0086</td><td>0.83 ± 0.0059</td><td>0.70 ± 0.0020</td><td>0.60 ± 0.0130</td><td>0.73 ± 0.0049</td><td>0.65 ± 0.0088</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>0.85 ± 0.0032</td><td>0.74 ± 0.0060</td><td>0.62 ± 0.0023</td><td>0.71 ± 0.0153</td><td>0.66 ± 0.0065</td><td>0.84 ± 0.0067</td><td>0.71 ± 0.0076</td><td>0.59 ± 0.0081</td><td>0.72 ± 0.0126</td><td>0.66 ± 0.0090</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>0.81 ± 0.0010</td><td>0.68 ± 0.0086</td><td>0.58 ± 0.0090</td><td>0.67 ± 0.0130</td><td>0.62 ± 0.0107</td><td>0.83 ± 0.0058</td><td>0.69 ± 0.0063</td><td>0.56 ± 0.0063</td><td>0.78 ± 0.0077</td><td>0.65 ± 0.0014</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>0.84 ± 0.0070</td><td>0.65 ± 0.0112</td><td>0.58 ± 0.0123</td><td>0.66 ± 0.0029</td><td>0.61 ± 0.0097</td><td>0.85 ± 0.0051</td><td>0.72 ± 0.0078</td><td>0.60 ± 0.0046</td><td>0.71 ± 0.0116</td><td>0.64 ± 0.0074</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>0.83 ± 0.0053</td><td>0.69 ± 0.0082</td><td>0.58 ± 0.0077</td><td>0.71 ± 0.0068</td><td>0.63 ± 0.0070</td><td>0.86 ± 0.0047</td><td>0.73 ± 0.0835</td><td>0.59 ± 0.0065</td><td>0.71 ± 0.0051</td><td>0.64 ± 0.0058</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>0.85 ± 0.0301</td><td>0.69 ± 0.0036</td><td>0.60 ± 0.0108</td><td>0.62 ± 0.0031</td><td>0.60 ± 0.0062</td><td>0.85 ± 0.0352</td><td>0.71 ± 0.0037</td><td>0.65 ± 0.0011</td><td>0.60 ± 0.0082</td><td>0.62 ± 0.0036</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>0.84 ± 0.0092</td><td>0.68 ± 0.0045</td><td>0.69 ± 0.0724</td><td>0.57 ± 0.0856</td><td>0.62 ± 0.0802</td><td>0.85 ± 0.0002</td><td>0.71 ± 0.0175</td><td>0.63 ± 0.0639</td><td>0.65 ± 0.0495</td><td>0.63 ± 0.0603</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>0.85 ± 0.0036</td><td>0.74 ± 0.0036</td><td>0.65 ± 0.0156</td><td>0.69 ± 0.0124</td><td>0.66 ± 0.0129</td><td>0.88 ± 0.0006</td><td>0.78 ± 0.0004</td><td>0.70 ± 0.0055</td><td>0.71 ± 0.0027</td><td>0.70 ± 0.0033</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>0.86 ± 0.0016</td><td>0.76 ± 0.0049</td><td>0.66 ± 0.0084</td><td>0.69 ± 0.0101</td><td><strong>0.67 ± 0.0052</strong></td><td>0.89 ± 0.0009</td><td>0.80 ± 0.0001</td><td>0.70 ± 0.0012</td><td>0.72 ± 0.0158</td><td>0.71 ± 0.0075</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td>0.86 ± 0.0006</td><td>0.77 ± 0.0069</td><td>0.67 ± 0.0157</td><td>0.68 ± 0.0149</td><td>0.67 ± 0.0152</td><td>0.89 ± 0.0014</td><td>0.80 ± 0.0041</td><td>0.70 ± 0.0015</td><td>0.74 ± 0.0041</td><td><strong>0.72 ± 0.0015</strong></td></tr></tbody></table>

<figure><img src="image_13.png" /><figcaption>**Fig. 8.** The distribution of lengths of stay in days for the two datasets using an interval of 2 days between bars except for the final bar, which contains all lengths of stay between the 30 days till the max LOS.</figcaption></figure>
<table><caption>**Table 7**
Length of Stay prediction on MIMIC III.</caption><thead><tr><th rowspan="2">DATA USED</th><th rowspan="2">MODELS</th><th colspan="2">SAPS II FEATURES</th><th colspan="2">ALL FEATURES</th></tr><tr><th>RMSE</th><th>MAE</th><th>RMSE</th><th>MAE</th></tr></thead><tbody><tr><td rowspan="10">24 HRS DATA</td><td>LSTM</td><td>5.86 ± 0.3364</td><td>2.51 ± 0.0986</td><td>5.66 ± 0.3359</td><td>2.48 ± 0.1226</td></tr><tr><td>LSTM-Wdr</td><td>5.70 ± 0.3057</td><td>2.35 ± 0.0807</td><td>5.56 ± 0.2979</td><td>2.33 ± 0.1393</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>5.39 ± 0.1776</td><td>2.79 ± 0.0776</td><td>4.45 ± 0.1748</td><td>2.90 ± 0.0748</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>5.82 ± 0.3457</td><td>2.52 ± 0.0727</td><td>5.80 ± 0.4579</td><td>2.53 ± 0.0393</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>6.05 ± 0.2282</td><td>3.26 ± 0.0691</td><td>6.93 ± 0.2317</td><td>3.66 ± 0.0878</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>5.75 ± 0.2432</td><td>2.86 ± 0.0531</td><td>5.80 ± 0.2101</td><td>2.82 ± 0.0188</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>5.85 ± 0.2132</td><td>2.92 ± 0.0567</td><td>5.88 ± 0.2212</td><td>2.80 ± 0.0537</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>5.90 ± 0.2663</td><td>3.01 ± 0.0231</td><td>5.66 ± 0.2248</td><td>2.82 ± 0.0673</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>6.01 ± 0.2312</td><td>3.14 ± 0.0582</td><td>5.85 ± 0.2254</td><td>3.02 ± 0.0677</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>4.87 ± 0.1635</td><td>1.92 ± 0.0284</td><td>4.85 ± 0.1678</td><td>1.82 ± 0.0235</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>4.73 ± 0.1592</td><td>2.12 ± 0.0137</td><td>4.79 ± 0.1252</td><td>2.12 ± 0.0303</td></tr><tr><td rowspan="10">48 HRS DATA</td><td>MWTA-LSTM-2 ASP</td><td><b>4.57 ± 0.1308</b></td><td><b>2.08 ± 0.0387</b></td><td><b>3.68 ± 0.1712</b></td><td><b>1.57 ± 0.0128</b></td></tr><tr><td>LSTM</td><td>5.42 ± 0.2300</td><td>2.00 ± 0.1005</td><td>5.19 ± 0.3688</td><td>2.11 ± 0.1935</td></tr><tr><td>LSTM-Wdr</td><td>5.32 ± 0.3294</td><td>1.91 ± 0.0916</td><td>5.18 ± 0.3615</td><td>2.07 ± 0.1364</td></tr><tr><td>Time LSTM (Zhu et al., 2017)</td><td>4.86 ± 0.2099</td><td>2.11 ± 0.0446</td><td>5.07 ± 0.2161</td><td>2.44 ± 0.0437</td></tr><tr><td>TLSTM (Baytas et al., 2017)</td><td>4.88 ± 0.1529</td><td>2.23 ± 0.0442</td><td>5.25 ± 0.2331</td><td>2.45 ± 0.0723</td></tr><tr><td>RETAIN (Choi, Bahadori, Sun, et al., 2016)</td><td>6.19 ± 0.2902</td><td>3.29 ± 0.0432</td><td>6.59 ± 0.5105</td><td>3.39 ± 0.0638</td></tr><tr><td>ATTAIN (Zhang, 2019)</td><td>5.60 ± 0.2033</td><td>2.26 ± 0.0251</td><td>5.53 ± 0.2413</td><td>2.13 ± 0.0547</td></tr><tr><td>nTAND (Shukla & Marlin, 2021)</td><td>5.67 ± 0.2034</td><td>2.39 ± 0.0298</td><td>5.73 ± 0.2263</td><td>2.15 ± 0.0772</td></tr><tr><td>HiTANet (Luo et al., 2020)</td><td>5.71 ± 0.2437</td><td>2.33 ± 0.0572</td><td>5.49 ± 0.2134</td><td>2.24 ± 0.0727</td></tr><tr><td>ConCare (Ma et al., 2020)</td><td>5.80 ± 0.2044</td><td>2.56 ± 0.0369</td><td>5.74 ± 0.2437</td><td>2.49 ± 0.0956</td></tr><tr><td>MWTA-LSTM-1 MP</td><td>4.70 ± 0.1735</td><td>1.88 ± 0.0578</td><td>4.68 ± 0.1833</td><td>1.75 ± 0.0152</td></tr><tr><td>MWTA-LSTM-2 MP</td><td>4.33 ± 0.1835</td><td>1.74 ± 0.0378</td><td>4.43 ± 0.1632</td><td>1.72 ± 0.0352</td></tr><tr><td>MWTA-LSTM-2 ASP</td><td><b>4.03 ± 0.1722</b></td><td><b>1.37 ± 0.0216</b></td><td><b>3.27 ± 0.1038</b></td><td><b>1.21 ± 0.0186</b></td></tr></tbody></table>

<table><caption>**Table 8**
Length of Stay prediction on eICU dataset.</caption><thead><tr><th rowspan="2">DATA USED</th><th rowspan="2">MODELS</th><th colspan="2">SAPS II FEATURES</th><th colspan="2">ALL FEATURES</th></tr><tr><th>RMSE</th><th>MAE</th><th>RMSE</th><th>MAE</th></tr></thead><tbody><tr><td>24 HRS DATA</td><td>MWTA-LSTM-2 ASP</td><td><b>6.01 ± 0.1536</b></td><td><b>3.16 ± 0.0632</b></td><td><b>5.89 ± 0.1926</b></td><td><b>3.06 ± 0.0342</b></td></tr><tr><td>48 HRS DATA</td><td>MWTA-LSTM-2 ASP</td><td><b>5.88 ± 0.1764</b></td><td><b>2.92 ± 0.0345</b></td><td><b>5.84 ± 0.1732</b></td><td><b>2.69 ± 0.0126</b></td></tr></tbody></table>

denotes “without”. The performance of MWTA-LSTM 2 w/o all experiences a significant decline when all auxiliary components are removed, underscoring the importance of each considered auxiliary component in capturing intricate patterns in patients’ EHR records. Similar trends are observed for MWTA-LSTM 1 w/o all, highlighting the importance of each individual component for our framework. Despite this, our proposed method continues to outperform the baseline models in predicting these tasks, as evidenced in (Table 2) and (Table 3).

In summary, the ablation study reveals the vital role of auxiliary components in our MWTA-LSTM model. The systematic removal of these components, either individually or collectively, leads to a notable decline in performance, emphasizing their significance in capturing intricate patterns within patients’ EHR records.

## 5.4. Runtime comparison

The MWTA-LSTM model was evaluated on an NVIDIA GeForce GTX 1080 Ti GPU with 10 GB of total memory and a system RAM of 30 GB. During training, MWTA-LSTM takes 164 s per epoch. It achieves an inference speed of 5.52 ms per prediction, demonstrating its suitability for real-time applications. This performance is comparable to other

state-of-the-art methods, indicating that MWTA-LSTM is efficient in both training and inference phases.

**Practical Deployment:** In terms of resource utilization, the model runs efficiently on the specified hardware, leveraging PyTorch 1.13.0 for optimized performance. The inference speed and memory usage make MWTA-LSTM a viable option for deployment in clinical settings where quick decision-making is critical.

**Availability to Non-Expert Users:** To ensure accessibility for non-expert users, we release the code<fnref n="2" /> along with a pre-trained model for reproducibility. This will enable easy deployment and utilization by users without extensive technical expertise.

# 6. Discussion

## 6.1. Comparison to existing models

MWTA-LSTM stands out among existing models, such as those (Baytas et al., 2017; Choi, Bahadori, Sun, et al., 2016; Pham et al., 2017), offering significant advancements and novel features in the realm

<footnote n="2">² Link Github of MWTA-LSTM</footnote>
<table><caption>**Table 9**
In-hospital & ICU mortality task on MIMIC dataset using First 24 & 48 h data.</caption><thead><tr><th rowspan="2">DATA</th><th rowspan="2">TASKS</th><th rowspan="2">MODELS</th><th colspan="5">SAPS II FEATURES</th><th colspan="5">ALL FEATURES</th></tr><tr><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th><th>AUROC</th><th>AUPRC</th><th>PRECISION</th><th>RECALL</th><th>F1-SCORE</th></tr></thead><tbody><tr><td rowspan="12">24 HRS DATA</td><td rowspan="6">In-Hospital</td><td>MWTA-LSTM-2 ASP</td><td>0.90 ± 0.0019</td><td>0.70 ± 0.0010</td><td>0.68 ± 0.0014</td><td>0.57 ± 0.0026</td><td><strong>0.62 ± 0.0001</strong></td><td>0.93 ± 0.0018</td><td>0.76 ± 0.0001</td><td>0.75 ± 0.0119</td><td>0.64 ± 0.0153</td><td><strong>0.69 ± 0.0123</strong></td></tr><tr><td>MWTA-LSTM-2 w/o ASP</td><td>0.91 ± 0.0047</td><td>0.70 ± 0.0058</td><td>0.68 ± 0.0094</td><td>0.58 ± 0.0088</td><td>0.62 ± 0.0084</td><td>0.93 ± 0.0002</td><td>0.76 ± 0.0003</td><td>0.72 ± 0.0033</td><td>0.64 ± 0.0019</td><td>0.67 ± 0.0021</td></tr><tr><td>MWTA-LSTM-2 w/o attention</td><td>0.90 ± 0.0088</td><td>0.68 ± 0.0108</td><td>0.65 ± 0.0103</td><td>0.57 ± 0.0043</td><td>0.60 ± 0.0054</td><td>0.91 ± 0.0079</td><td>0.73 ± 0.0233</td><td>0.69 ± 0.0103</td><td>0.62 ± 0.0047</td><td>0.65 ± 0.0067</td></tr><tr><td>MWTA-LSTM-2 w/o gating</td><td>0.91 ± 0.0014</td><td>0.68 ± 0.0126</td><td>0.66 ± 0.0251</td><td>0.55 ± 0.0178</td><td>0.60 ± 0.0204</td><td>0.92 ± 0.0132</td><td>0.74 ± 0.0071</td><td>0.69 ± 0.0223</td><td>0.64 ± 0.0075</td><td>0.66 ± 0.0151</td></tr><tr><td>MWTA-LSTM-2 w/o all</td><td>0.89 ± 0.0017</td><td>0.68 ± 0.0075</td><td>0.66 ± 0.0083</td><td>0.56 ± 0.0077</td><td>0.60 ± 0.0084</td><td>0.91 ± 0.0097</td><td>0.70 ± 0.0120</td><td>0.68 ± 0.0108</td><td>0.58 ± 0.0097</td><td>0.62 ± 0.0100</td></tr><tr><td>MWTA-LSTM-1 w/o all</td><td>0.89 ± 0.0029</td><td>0.67 ± 0.0115</td><td>0.64 ± 0.0268</td><td>0.58 ± 0.0197</td><td>0.60 ± 0.0234</td><td>0.90 ± 0.0109</td><td>0.68 ± 0.0110</td><td>0.63 ± 0.0231</td><td>0.61 ± 0.0156</td><td>0.61 ± 0.0205</td></tr><tr><td rowspan="6">ICU</td><td>MWTA-LSTM-2 ASP</td><td>0.93 ± 0.0041</td><td>0.73 ± 0.0035</td><td>0.71 ± 0.0070</td><td>0.59 ± 0.0087</td><td><strong>0.64 ± 0.0078</strong></td><td>0.96 ± 0.0028</td><td>0.80 ± 0.0076</td><td>0.80 ± 0.0056</td><td>0.64 ± 0.0116</td><td><strong>0.71 ± 0.0076</strong></td></tr><tr><td>MWTA-LSTM-2 w/o ASP</td><td>0.93 ± 0.0012</td><td>0.72 ± 0.0034</td><td>0.69 ± 0.0123</td><td>0.61 ± 0.0100</td><td>0.64 ± 0.0103</td><td>0.95 ± 0.0005</td><td>0.75 ± 0.0054</td><td>0.74 ± 0.0002</td><td>0.63 ± 0.0017</td><td>0.68 ± 0.0004</td></tr><tr><td>MWTA-LSTM-2 w/o attention</td><td>0.92 ± 0.0054</td><td>0.70 ± 0.0037</td><td>0.67 ± 0.0121</td><td>0.59 ± 0.0087</td><td>0.62 ± 0.0093</td><td>0.93 ± 0.0225</td><td>0.74 ± 0.0144</td><td>0.72 ± 0.0142</td><td>0.64 ± 0.0085</td><td>0.67 ± 0.0109</td></tr><tr><td>MWTA-LSTM-2 w/o gating</td><td>0.92 ± 0.0158</td><td>0.70 ± 0.0078</td><td>0.65 ± 0.0274</td><td>0.58 ± 0.0185</td><td>0.61 ± 0.0209</td><td>0.93 ± 0.0165</td><td>0.73 ± 0.0077</td><td>0.70 ± 0.0089</td><td>0.65 ± 0.0075</td><td>0.67 ± 0.0089</td></tr><tr><td>MWTA-LSTM-2 w/o all</td><td>0.92 ± 0.0009</td><td>0.65 ± 0.0070</td><td>0.65 ± 0.0130</td><td>0.59 ± 0.0174</td><td>0.61 ± 0.0151</td><td>0.94 ± 0.0027</td><td>0.72 ± 0.0107</td><td>0.68 ± 0.0110</td><td>0.61 ± 0.0100</td><td>0.64 ± 0.0104</td></tr><tr><td>MWTA-LSTM-1 w/o all</td><td>0.91 ± 0.0129</td><td>0.64 ± 0.0037</td><td>0.63 ± 0.0154</td><td>0.59 ± 0.0119</td><td>0.60 ± 0.0125</td><td>0.94 ± 0.0114</td><td>0.71 ± 0.0173</td><td>0.67 ± 0.0167</td><td>0.61 ± 0.0155</td><td>0.63 ± 0.0154</td></tr><tr><td rowspan="12">48 HRS DATA</td><td rowspan="6">In-Hospital</td><td>MWTA-LSTM-2 ASP</td><td>0.94 ± 0.0127</td><td>0.78 ± 0.0047</td><td>0.77 ± 0.0091</td><td>0.65 ± 0.0085</td><td><strong>0.70 ± 0.0080</strong></td><td>0.95 ± 0.0036</td><td>0.81 ± 0.0029</td><td>0.79 ± 0.0101</td><td>0.68 ± 0.0112</td><td><strong>0.73 ± 0.0073</strong></td></tr><tr><td>MWTA-LSTM-2 w/o ASP</td><td>0.94 ± 0.0007</td><td>0.78 ± 0.0007</td><td>0.74 ± 0.0057</td><td>0.65 ± 0.0025</td><td>0.69 ± 0.0030</td><td>0.94 ± 0.0018</td><td>0.80 ± 0.0019</td><td>0.77 ± 0.0111</td><td>0.68 ± 0.0049</td><td>0.72 ± 0.0076</td></tr><tr><td>MWTA-LSTM-2 w/o attention</td><td>0.92 ± 0.0112</td><td>0.75 ± 0.0305</td><td>0.73 ± 0.0085</td><td>0.63 ± 0.0066</td><td>0.67 ± 0.0070</td><td>0.93 ± 0.0038</td><td>0.77 ± 0.0051</td><td>0.74 ± 0.0193</td><td>0.65 ± 0.0205</td><td>0.69 ± 0.0206</td></tr><tr><td>MWTA-LSTM-2 w/o gating</td><td>0.93 ± 0.0105</td><td>0.76 ± 0.0058</td><td>0.77 ± 0.0093</td><td>0.63 ± 0.0027</td><td>0.69 ± 0.0054</td><td>0.93 ± 0.0021</td><td>0.78 ± 0.0314</td><td>0.78 ± 0.0036</td><td>0.66 ± 0.0085</td><td>0.71 ± 0.0068</td></tr><tr><td>MWTA-LSTM-2 w/o all</td><td>0.93 ± 0.0223</td><td>0.73 ± 0.0089</td><td>0.67 ± 0.0079</td><td>0.63 ± 0.0068</td><td>0.64 ± 0.0073</td><td>0.94 ± 0.0103</td><td>0.75 ± 0.0107</td><td>0.70 ± 0.0039</td><td>0.61 ± 0.0085</td><td>0.65 ± 0.0061</td></tr><tr><td>MWTA-LSTM-1 w/o all</td><td>0.92 ± 0.0179</td><td>0.72 ± 0.0025</td><td>0.63 ± 0.0188</td><td>0.62 ± 0.0172</td><td>0.62 ± 0.0175</td><td>0.93 ± 0.0193</td><td>0.73 ± 0.0097</td><td>0.67 ± 0.0115</td><td>0.60 ± 0.0090</td><td>0.63 ± 0.0088</td></tr><tr><td rowspan="6">ICU</td><td>MWTA-LSTM-2 ASP</td><td>0.96 ± 0.0044</td><td>0.81 ± 0.0122</td><td>0.81 ± 0.0047</td><td>0.66 ± 0.0053</td><td><strong>0.72 ± 0.0042</strong></td><td>0.97 ± 0.0024</td><td>0.85 ± 0.0028</td><td>0.85 ± 0.0057</td><td>0.71 ± 0.0105</td><td><strong>0.77 ± 0.0055</strong></td></tr><tr><td>MWTA-LSTM-2 w/o ASP</td><td>0.96 ± 0.0004</td><td>0.79 ± 0.0022</td><td>0.75 ± 0.0020</td><td>0.67 ± 0.0017</td><td>0.70 ± 0.0012</td><td>0.97 ± 0.0025</td><td>0.83 ± 0.0019</td><td>0.84 ± 0.0058</td><td>0.67 ± 0.0041</td><td>0.74 ± 0.0046</td></tr><tr><td>MWTA-LSTM-2 w/o attention</td><td>0.94 ± 0.0208</td><td>0.76 ± 0.0075</td><td>0.73 ± 0.0134</td><td>0.64 ± 0.0107</td><td>0.68 ± 0.0117</td><td>0.95 ± 0.0057</td><td>0.80 ± 0.0107</td><td>0.80 ± 0.0277</td><td>0.65 ± 0.0300</td><td>0.71 ± 0.0312</td></tr><tr><td>MWTA-LSTM-2 w/o gating</td><td>0.94 ± 0.0207</td><td>0.76 ± 0.0502</td><td>0.73 ± 0.0287</td><td>0.66 ± 0.0121</td><td>0.69 ± 0.0219</td><td>0.96 ± 0.0176</td><td>0.80 ± 0.0067</td><td>0.82 ± 0.0056</td><td>0.65 ± 0.0084</td><td>0.72 ± 0.0067</td></tr><tr><td>MWTA-LSTM-2 w/o all</td><td>0.94 ± 0.0023</td><td>0.74 ± 0.0401</td><td>0.69 ± 0.0331</td><td>0.65 ± 0.0294</td><td>0.66 ± 0.0310</td><td>0.95 ± 0.0109</td><td>0.77 ± 0.0032</td><td>0.78 ± 0.0096</td><td>0.61 ± 0.0035</td><td>0.68 ± 0.0063</td></tr><tr><td>MWTA-LSTM-1 w/o all</td><td>0.92 ± 0.0136</td><td>0.73 ± 0.0171</td><td>0.70 ± 0.0173</td><td>0.61 ± 0.0109</td><td>0.65 ± 0.0151</td><td>0.93 ± 0.0265</td><td>0.75 ± 0.0133</td><td>0.73 ± 0.0109</td><td>0.61 ± 0.0113</td><td>0.66 ± 0.0106</td></tr></tbody></table>

of personalized healthcare. Unlike its predecessors, MWTA-LSTM is an end-to-end deep dynamic memory neural network, capable of autonomously learn relevant features from medical records. This unique feature, achieved through decay mechanisms and parameterization of time, allows MWTA-LSTM to effectively handle the temporal dynamics of healthcare data, accommodating variations and irregularities in the timing of events and observations.

Another distinguishing factor of our proposed framework is the incorporation of adaptive pooling to handle outliers in patient records. This enhancement enables MWTA-LSTM to make robust inferences about future outcomes, even in the presence of noisy or irregular data points. This adaptive pooling feature is a significant improvement compared to existing models that may struggle with outliers or noisy data, as seen in the works of Baytas et al. (2017), Pham et al. (2017).

In terms of performance, MWTA-LSTM has demonstrated its efficacy in predicting various healthcare outcomes, including mortality and length of stay. To ensure its applicability in different settings, thorough evaluations were conducted using three diverse datasets in the field of time series forecasting. The consistent superior performance of MWTA-LSTM over state-of-the-art models, as highlighted in the study by Qin et al. (2017), underscores its capabilities. For a comprehensive comparison and further details, please refer to the Appendix (A.1, specifically Table A.1). Comparative evaluations have shown that MWTA-LSTM outperforms current state-of-the-art models in these prediction tasks.

In summary, MWTA-LSTM introduces several advancements that distinguish it in the field of personalized healthcare. Its autonomous feature extraction, intervention incorporation, time parameterization, and outlier handling make it a promising and powerful tool for predictive personalized medicine.

## 6.2. Perspectives

Our approach exhibits promising capabilities and opens several new avenues for future work. Currently, predictions are made exactly 24 or 48 h after admission. However, it would be desirable to enable real-time predictions, ideally every hour or following each intervention by the medical staff.

Our approach effectively handles irregular sampling using elapsed time, frequency of measurement, and the last observation, thereby addressing the issue of timing irregularity. However, our model is not explicitly designed to replace missing values through advanced techniques such as imputation. An extension of our work could involve using the deep learning architecture to predict missing values, rather than relying on the current simple forward imputation method. Our current evaluation is limited to retrospective observational studies due to the constraints of publicly available datasets. Despite this, our model demonstrates potential for broader applications, including deployment in prospective observational studies to validate findings from retrospective analyses.

The proposed model is tailored to achieve accurate and robust predictions in multivariate time series data, even with some missing values, by leveraging frequency sampling of variables, the most recent observation(last observation) and elapsed times. This contributes to enhanced prediction performance compared to current state-of-the-art methods. Although primarily designed for healthcare applications, our model is versatile and can be effectively applied in other domains, such as traffic and climate informatics, where informative missingness is common. This versatility underscores the broader applicability of our approach beyond healthcare settings.

## 6.3. Conclusion

In this paper, we present a novel deep dynamic memory neural network called Multi-Way adaptive Time Aware LSTM (MWTA-LSTM), specifically designed for personalized healthcare. The primary objective of MWTA-LSTM is to learn medical records, memorize illness trajectories and care processes, estimate current illness states, and predict future risks, thereby providing a high level of precision and predictive power.

To enhance its capabilities, MWTA-LSTM extends the conventional Long Short-Term Memory (LSTM) model in two key ways. Firstly, it incorporates frequency measurement and the most recent observation(last observation) to enhance personalized predictive modeling of patient illnesses. This inclusion allows for a more accurate understanding of the patient's condition. Secondly, MWTA-LSTM parameterizes
<figure><img src="image_14.png" /><figcaption>Fig. A.1. Pairwise comparisons (p-value < 0.05), conducted on F1-scores across the 10 testing folds for Feature Set B over a 48-hour period, reveal the significance of the models in predicting HOSPITAL Mortality. A lower p-value indicates greater statistical significance.</figcaption></figure>

<caption>Table A.1</caption>

Time series forecasting results over the SML 2010, NASDAQ 100 Stock, and IHEPC datasets.

<table><caption>TIME SERIES FORECASTING</caption><thead><tr><th rowspan="2">HORIZON</th><th rowspan="2">DATASET</th><th colspan="3">MWTA-LSTM 2 ASP</th><th colspan="3">DA-RNN (Qin et al., 2017)</th></tr><tr><th>RMSE</th><th>MAE</th><th>R2</th><th>RMSE</th><th>MAE</th><th>R2</th></tr></thead><tbody><tr><td>1</td><td>SML 2010</td><td>0.041 ± 0.0019</td><td>0.030 ± 0.0010</td><td>0.94 ± 0.0056</td><td>0.038 ± 0.0039</td><td>0.027 ± 0.0023</td><td>0.95 ± 0.0066</td></tr><tr><td>1</td><td>NASDAQ 100</td><td>0.085 ± 0.0004</td><td>0.079 ± 0.0004</td><td>0.94 ± 0.0011</td><td>0.322 ± 0.0051</td><td>0.250±0.0025</td><td>0.89 ± 0.0156</td></tr><tr><td>24</td><td>IHEPC</td><td>0.023 ± 0.0002</td><td>0.017 ± 0.0001</td><td>0.97 ± 0.0002</td><td>0.054 ± 0.0062</td><td>0.027 ± 0.0051</td><td>0.93 ± 0.0085</td></tr></tbody></table>

time to effectively handle irregular timing, enabling the modeling of interventions and their impact on the course of illness and disease progression. This dynamic representation of time improves the overall predictive ability of the model. Lastly, an adaptive pooling is integrated into MWTA-LSTM to handle outliers present in patient records, enabling the generation of meaningful inferences about future outcomes.

The effectiveness of MWTA-LSTM is empirically demonstrated through its superior performance in predicting important healthcare metrics such as mortality, length of stay, and time series forecasting when compared to the current state-of-the-art methods. This highlights the significant advancements offered by MWTA-LSTM in the realm of personalized medicine.

### CRediT authorship contribution statement

**Mamadou Ben Hamidou Cissoko:** Conceptualization, Methodology, Writing – original draft, Visualization, Investigation, Data curation. **Vincent Castelain:** Supervision, Validation, Writing – review & editing, Funding acquisition. **Nicolas Lachiche:** Supervision, Validation, Writing – review & editing, Funding acquisition.

### Declaration of competing interest

The authors declare the following financial interests/personal relationships which may be considered as potential competing interests: CISSOKO Mamadou Ben Hamidou reports financial support was provided by ArtIC project Artificial Intelligence for Care (grant ANR-20-THIA-0006-01) and co funded by Région Grand Est, Inria Nancy - Grand Est, IHU of Strasbourg, University of Strasbourg and University of Haute-Alsace. If there are other authors, they declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.

### Acknowledgments

This work was funded by ArtIC project “Artificial Intelligence for Care” (grant ANR-20-THIA-0006-01) and co funded by Région Grand Est, Inria Nancy - Grand Est, IHU of Strasbourg, University of Strasbourg and University of Haute-Alsace.

### Appendix

#### A.1. Time series forecasting

The SML 2010 dataset, a publicly available dataset, is utilized for predicting indoor temperatures. It is derived from a monitoring system installed in a residential house. The target series in this dataset is the room temperature, and we have selected 16 relevant driving series that encompass approximately 40 days of monitoring data. The data points were recorded at one-minute intervals and then smoothed using 15-minute averages.

In the NASDAQ 100 Stock dataset (Qin et al., 2017),<fnref n="3" /> we have collected the stock prices of 81 major corporations listed under NASDAQ 100, which serve as the driving time series. The target series in this dataset is the index value of the NASDAQ 100. The data was collected on a minute-by-minute basis and covers a period of 105 days from July 26, 2016, to December 22, 2016. Each day encompasses 390 data points representing the market's opening and closing, except for November 25 (210 data points) and December 22 (which has 180 data points).

The Individual Household Electric Power Consumption (IHEPC) dataset (Hebrail & Berard, 2012) consists of 2.07 million measurements of electric power consumption from a single house located in Sceaux, France (7 km from Paris). The measurements were taken every minute between December 2006 and November 2010, covering a total of 47

<footnote n="3">³ https://cseweb.ucsd.edu/~yaq007/NASDAQ100.stock_data.html</footnote>
months [29]. Our focus in this study is on predicting the “Global active power” parameter. Although there is a small percentage (1.25%) of missing measurements, all the available data points are accompanied by timestamps. To ensure a standardized approach, we have resampled the dataset to have a sampling rate of 1 h. The prediction task involves forecasting the electric load for the next day, specifically 24 timesteps ahead.

## A.2. List of features

<caption>**Table A.2**</caption>

The percentage of measurements recorded for lab features within the first 24 and 48 h of data collection and Aggregate function used for each feature based on experts knowledge.

<table><thead><tr><th rowspan="2">Feature</th><th colspan="3">(a) Lab features</th></tr><tr><th>24 h</th><th>48 h</th><th>Agg(Min&Max&Sum)</th></tr></thead><tbody><tr><td>Albumin</td><td>0.0271</td><td>0.0167</td><td>Min</td></tr><tr><td>Alt</td><td>0.0364</td><td>0.0232</td><td>Max</td></tr><tr><td>Amylase</td><td>0.0164</td><td>0.0098</td><td>Max</td></tr><tr><td>Anion Gap</td><td>0.1008</td><td>0.0749</td><td>Max</td></tr><tr><td>Ast</td><td>0.0364</td><td>0.0231</td><td>Max</td></tr><tr><td>Atypical Lymphocytes</td><td>0.0031</td><td>0.0018</td><td>Max</td></tr><tr><td>Bands</td><td>0.0085</td><td>0.0048</td><td>Min</td></tr><tr><td>Base Excess</td><td>0.0922</td><td>0.0616</td><td>Max</td></tr><tr><td>Basophils</td><td>0.0278</td><td>0.0154</td><td>Max</td></tr><tr><td>Bicarbonate</td><td>0.1072</td><td>0.0786</td><td>Min</td></tr><tr><td>Bilirubin</td><td>0.0361</td><td>0.0231</td><td>Max</td></tr><tr><td>Calcium Total</td><td>0.0798</td><td>0.0607</td><td>Max</td></tr><tr><td>Calculated Total Co2</td><td>0.1131</td><td>0.0763</td><td>Min</td></tr><tr><td>Carboxyhemoglobin</td><td>0.0012</td><td>0.0006</td><td>Max</td></tr><tr><td>Chloride</td><td>0.1187</td><td>0.0860</td><td>Max</td></tr><tr><td>Creatinine</td><td>0.1081</td><td>0.0794</td><td>Max</td></tr><tr><td>D-Dimer</td><td>0.0010</td><td>0.0006</td><td>Max</td></tr><tr><td>Eosinophils</td><td>0.0300</td><td>0.0167</td><td>Max</td></tr><tr><td>Epithelial Cells</td><td>0.0027</td><td>0.0015</td><td>Max</td></tr><tr><td>Ferritin</td><td>0.0040</td><td>0.0024</td><td>Max</td></tr><tr><td>Fibrinogen</td><td>0.0169</td><td>0.0103</td><td>Min</td></tr><tr><td>Fio2</td><td>0.1439</td><td>0.1125</td><td>Max</td></tr><tr><td>Glucose</td><td>0.2876</td><td>0.2231</td><td>Max</td></tr><tr><td>Granulocyte Count</td><td>0.0010</td><td>0.0006</td><td>Max</td></tr><tr><td>Height</td><td>0.0166</td><td>0.0094</td><td>Max</td></tr><tr><td>Hematocrit</td><td>0.1444</td><td>0.1047</td><td>Min</td></tr><tr><td>Hemoglobin</td><td>0.1201</td><td>0.0851</td><td>Min</td></tr><tr><td>Inr(Pt)</td><td>0.0858</td><td>0.0578</td><td>Max</td></tr><tr><td>Ketone</td><td>0.0045</td><td>0.0026</td><td>Max</td></tr><tr><td>Lactate</td><td>0.0626</td><td>0.0386</td><td>Max</td></tr><tr><td>Lipase</td><td>0.0180</td><td>0.0106</td><td>Max</td></tr><tr><td>Lymphocytes</td><td>0.0377</td><td>0.0213</td><td>Min</td></tr><tr><td>Magnesium</td><td>0.0904</td><td>0.0701</td><td>Min</td></tr></tbody></table>

<table><thead><tr><th rowspan="2">Feature</th><th colspan="3">(b) (Next)</th></tr><tr><th>24 h</th><th>48 h</th><th>Agg(Min&Max&Sum)</th></tr></thead><tbody><tr><td>Mch</td><td>0.1022</td><td>0.0740</td><td>Min</td></tr><tr><td>Mchc</td><td>0.1023</td><td>0.0741</td><td>Min</td></tr><tr><td>Mcv</td><td>0.1022</td><td>0.0740</td><td>Min</td></tr><tr><td>Metamyelocytes</td><td>0.0041</td><td>0.0023</td><td>Max</td></tr><tr><td>Methemoglobin</td><td>0.0006</td><td>0.0003</td><td>Max</td></tr><tr><td>Monocytes</td><td>0.0369</td><td>0.0208</td><td>Max</td></tr><tr><td>Myelocytes</td><td>0.0024</td><td>0.0014</td><td>Max</td></tr><tr><td>Neutrophils</td><td>0.0368</td><td>0.0207</td><td>Max</td></tr><tr><td>Nucleated Rbc</td><td>0.0018</td><td>0.0010</td><td>Max</td></tr><tr><td>O2 Flow</td><td>0.1374</td><td>0.1134</td><td>Max</td></tr><tr><td>Pco2</td><td>0.1131</td><td>0.0763</td><td>Min</td></tr><tr><td>Ph</td><td>0.1385</td><td>0.0936</td><td>Min</td></tr><tr><td>Phosphate</td><td>0.0797</td><td>0.0609</td><td>Max</td></tr></tbody></table>

(continued on next page)

<table><caption>**Table A.2 (continued).**</caption><thead><tr><th rowspan="2">Feature</th><th colspan="3">(b) (Next)</th></tr><tr><th>24 h</th><th>48 h</th><th>Agg(Min&Max&Sum)</th></tr></thead><tbody><tr><td>Platelet Count</td><td>0.1077</td><td>0.0777</td><td>Min</td></tr><tr><td>Po2</td><td>0.1131</td><td>0.0763</td><td>Min</td></tr><tr><td>Potassium</td><td>0.1512</td><td>0.1093</td><td>Min</td></tr><tr><td>Promyelocytes</td><td>0.0004</td><td>0.0002</td><td>Max</td></tr><tr><td>Protein Total</td><td>0.0018</td><td>0.0011</td><td>Max</td></tr><tr><td>Ptt</td><td>0.0868</td><td>0.0593</td><td>Max</td></tr><tr><td>Rbc</td><td>0.1022</td><td>0.0740</td><td>Max</td></tr><tr><td>Required O2</td><td>0.0092</td><td>0.0054</td><td>Max</td></tr><tr><td>Reticulocyte Count</td><td>0.0026</td><td>0.0016</td><td>Max</td></tr><tr><td>Sao2</td><td>0.0450</td><td>0.0309</td><td>Min</td></tr><tr><td>Sodium</td><td>0.1269</td><td>0.0915</td><td>Min</td></tr><tr><td>Specific Gravity</td><td>0.0304</td><td>0.0174</td><td>Max</td></tr><tr><td>Thrombin</td><td>0.0002</td><td>0.0001</td><td>Max</td></tr><tr><td>Transferrin</td><td>0.0043</td><td>0.0025</td><td>Max</td></tr><tr><td>Troponin T</td><td>0.0239</td><td>0.0142</td><td>Max</td></tr><tr><td>Urea</td><td>0.1078</td><td>0.0791</td><td>Max</td></tr><tr><td>Urobilinogen</td><td>0.0079</td><td>0.0045</td><td>Max</td></tr><tr><td>Wbc</td><td>0.1028</td><td>0.0744</td><td>Min</td></tr><tr><td>Weight</td><td>0.0549</td><td>0.0327</td><td>Max</td></tr></tbody></table>

<caption>**Table A.3**</caption>

The percentage of measurements recorded for vital signs and drug features within the first 24 and 48 h of data collection and Aggregate function used for each feature based on experts knowledge.

<table><thead><tr><th rowspan="2">Feature</th><th colspan="3">(a) Vital signs & Others</th></tr><tr><th>24 h</th><th>48 h</th><th>Agg(Min&Max&Sum)</th></tr></thead><tbody><tr><td>Diastolic Blood</td><td>0.8385</td><td>0.7186</td><td>Min</td></tr><tr><td>Heart Rate</td><td>0.8584</td><td>0.7385</td><td>Min</td></tr><tr><td>Mean Arterial</td><td>0.8350</td><td>0.7155</td><td>Min</td></tr><tr><td>Respiration Rate</td><td>0.8452</td><td>0.7263</td><td>Max</td></tr><tr><td>Spo2</td><td>0.8285</td><td>0.7084</td><td>Min</td></tr><tr><td>Systolic Blood</td><td>0.8342</td><td>0.7143</td><td>Min</td></tr><tr><td>Temperature</td><td>0.3345</td><td>0.2703</td><td>Max</td></tr><tr><td>Gcs Eyes</td><td>0.3060</td><td>0.2490</td><td>Min</td></tr><tr><td>Gcs Motor</td><td>0.3045</td><td>0.2479</td><td>Min</td></tr><tr><td>Gcs Verbal</td><td>0.3048</td><td>0.2481</td><td>Min</td></tr><tr><td>Urine Output</td><td>0.5500</td><td>0.4815</td><td>Sum</td></tr></tbody></table>

<table><thead><tr><th rowspan="2">Feature</th><th colspan="3">(b) Drugs features</th></tr><tr><th>24 h</th><th>48 h</th><th>Agg(Min&Max&Sum)</th></tr></thead><tbody><tr><td>Argatroban</td><td>0.0004</td><td>0.0004</td><td>Max</td></tr><tr><td>Diltiazem</td><td>0.0038</td><td>0.0036</td><td>Max</td></tr><tr><td>Dobutamine</td><td>0.0045</td><td>0.0041</td><td>Max</td></tr><tr><td>Dopamine</td><td>0.0178</td><td>0.0137</td><td>Max</td></tr><tr><td>Epinephrine</td><td>0.0100</td><td>0.0071</td><td>Max</td></tr><tr><td>Esmolol</td><td>0.0023</td><td>0.0021</td><td>Max</td></tr><tr><td>Fentanyl</td><td>0.0327</td><td>0.0344</td><td>Max</td></tr><tr><td>Furosemide</td><td>0.0032</td><td>0.0037</td><td>Max</td></tr><tr><td>Hydromorphone</td><td>0.0006</td><td>0.0007</td><td>Max</td></tr><tr><td>Integrelin</td><td>0.0104</td><td>0.0058</td><td>Max</td></tr><tr><td>Labetalol</td><td>0.0047</td><td>0.0040</td><td>Max</td></tr><tr><td>Lorazepam</td><td>0.0044</td><td>0.0050</td><td>Max</td></tr><tr><td>Midazolam</td><td>0.0227</td><td>0.0228</td><td>Max</td></tr><tr><td>Milrinone</td><td>0.0087</td><td>0.0082</td><td>Max</td></tr><tr><td>Morphine[Sulfate]</td><td>0.0036</td><td>0.0039</td><td>Max</td></tr></tbody></table>

(continued on next page)
<table><caption>Table A.3 (continued).</caption><tr><td>Natrecor</td><td>0.0014</td><td>0.0015</td><td>Max</td></tr><tr><td>Nicardipine</td><td>0.0042</td><td>0.0037</td><td>Max</td></tr><tr><td>Nitroglycerine</td><td>0.0371</td><td>0.0257</td><td>Max</td></tr><tr><td>Nitroprusside</td><td>0.0124</td><td>0.0098</td><td>Max</td></tr><tr><td>Norepinephrine</td><td>0.0403</td><td>0.0352</td><td>Max</td></tr><tr><td>Phenylephrine</td><td>0.0597</td><td>0.0463</td><td>Max</td></tr><tr><td>Precedex</td><td>0.0022</td><td>0.0020</td><td>Max</td></tr><tr><td>Propofol</td><td>0.1032</td><td>0.0773</td><td>Max</td></tr><tr><td>Vancomycin Level</td><td>0.0039</td><td>0.0036</td><td>Max</td></tr><tr><td>Vasopressin</td><td>0.0070</td><td>0.0078</td><td>Max</td></tr></table>

## Data availability

We will release the full script (data pre-processing and model).

## References

Baytas, I. M., Xiao, C., Zhang, X., Wang, F., Jain, A. K., & Zhou, J. (2017). Patient subtyping via time-aware LSTM networks. In *Proceedings of the 23rd ACM SIGKDD international conference on knowledge discovery and data mining* (pp. 65–74).

Boureau, Y. L., Ponce, J., & LeCun, Y. (2010). A theoretical analysis of feature pooling in visual recognition. In *Proceedings of the 27th international conference on machine learning* (pp. 111–118).

Che, Z., Purushotham, S., Cho, K., Sontag, D., & Liu, Y. (2018). Recurrent neural networks for multivariate time series with missing values. *Scientific Reports*, 8(1), 6085.

Choi, E., Bahadori, M. T., Schuetz, A., Stewart, W. F., & Sun, J. (2016). Doctor ai: Predicting clinical events via recurrent neural networks. In *Machine learning for healthcare conference* (pp. 301–318). PMLR.

Choi, E., Bahadori, M. T., Sun, J., Kulas, J., Schuetz, A., & Stewart, W. (2016). Retain: An interpretable predictive model for healthcare using reverse time attention mechanism. *Advances in Neural Information Processing Systems*, 29.

Clevert, D.-A., Unterthiner, T., & Hochreiter, S. (2015). Fast and accurate deep network learning by exponential linear units (elus). arXiv preprint arXiv:1511.07289.

Dauphin, Y. N., Fan, A., Auli, M., & Grangier, D. (2017). Language modeling with gated convolutional networks. In *International conference on machine learning* (pp. 933–941). PMLR.

Hebrail, G., & Berard, A. (2012). Individual household electric power consumption. http://dx.doi.org/10.24432/C58K54, UCI Machine Learning Repository.

Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. *Neural Computation*, 9(8), 1735–1780.

Jackson, C. H., Sharples, L. D., Thompson, S. G., Duffy, S. W., & Couto, E. (2003). Multistate Markov models for disease progression with classification error. *Journal of the Royal Statistical Society: Series D (the Statistician)*, 52(2), 193–209.

Johnson, A. E., Pollard, T. J., Shen, L., Lehman, L.-w. H., Feng, M., Ghassemi, M., et al. (2016). MIMIC-III, a freely accessible critical care database. *Scientific Data*, 3(1), 1–9.

Kılıç, M., Yüzkat, N., Soyalp, C., & Gülhâs, N. (2019). Cost analysis on intensive care unit costs based on the length of stay. *Turkish Journal of Anaesthesiology and Reanimation*, 47(2), 142.

Krizhevsky, A., Sutskever, I., & Hinton, G. E. (2017). Imagenet classification with deep convolutional neural networks. *Communications of the ACM*, 60(6), 84–90.

Le Gall, J. R., Lemeshow, S., & Saulnier, F. (1993). A new simplified acute physiology score (SAPS II) based on a European/North American multicenter study. *Jama*, 270(24), 2957–2963.

Leys, C., Ley, C., Klein, O., Bernard, P., & Licata, L. (2013). Detecting outliers: Do not use standard deviation around the mean, use absolute deviation around the median. *Journal of Experimental Social Psychology*, 49(4), 764–766.

Lim, B., Arık, S. Ö., Loeff, N., & Pfister, T. (2021). Temporal fusion transformers for interpretable multi-horizon time series forecasting. *International Journal of Forecasting*, 37(4), 1748–1764.

Lipton, Z. C., Kale, D. C., Elkan, C., & Wetzel, R. (2015). Learning to diagnose with LSTM recurrent neural networks. arXiv preprint arXiv:1511.03677.

Luo, J., Ye, M., Xiao, C., & Ma, F. (2020). Hitanet: Hierarchical time-aware attention networks for risk prediction on electronic health records. In *Proceedings of the 26th ACM SIGKDD international conference on knowledge discovery & data mining* (pp. 647–656).

Ma, L., Zhang, C., Wang, Y., Ruan, W., Wang, J., Tang, W., et al. (2020). Concure: Personalized clinical feature embedding via capturing the healthcare context. In *Proceedings of the AAAI conference on artificial intelligence*, vol. 34, no. 01 (pp. 833–840).

Nirthika, R., Manivannan, S., Ramanan, A., & Wang, R. (2022). Pooling in convolutional neural networks for medical image analysis: a survey and an empirical study. *Neural Computing and Applications*, 34(7), 5321–5347.

Pascanu, R., Mikolov, T., & Bengio, Y. (2013). On the difficulty of training recurrent neural networks. In *International conference on machine learning* (pp. 1310–1318). PMLR.

Pham, T., Tran, T., Phung, D., & Venkatesh, S. (2017). Predicting healthcare trajectories from medical records: A deep learning approach. *Journal of Biomedical Informatics*, 69, 218–229.

Pollard, T. J., Johnson, A. E., Raffa, J. D., Celi, L. A., Mark, R. G., & Badawi, O. (2018). The eICU Collaborative Research Database, a freely available multi-center database for critical care research. *Scientific Data*, 5(1), 1–13.

Purushotham, S., Meng, C., Che, Z., & Liu, Y. (2018). Benchmarking deep learning models on large healthcare datasets. *Journal of Biomedical Informatics*, 83, 112–134.

Qin, Y., Song, D., Chen, H., Cheng, W., Jiang, G., & Cottrell, G. (2017). A dual-stage attention-based recurrent neural network for time series prediction. arXiv preprint arXiv:1704.02971.

Rezende, D. J., Mohamed, S., & Wierstra, D. (2014). Stochastic backpropagation and approximate inference in deep generative models. In *International conference on machine learning* (pp. 1278–1286). PMLR.

Shukla, S. N., & Marlin, B. (2021). Multi-time attention networks for irregularly sampled time series. In *International conference on learning representations*. arXiv preprint arXiv:2101.10318 URL https://openreview.net/forum?id=4c0J6lwQ4.

Simonyan, K., & Zisserman, A. (2014). Two-stream convolutional networks for action recognition in videos. *Advances in Neural Information Processing Systems*, 27.

Tran, T., Luo, W., Phung, D., Gupta, S., Rana, S., Kennedy, R. L., et al. (2014). A framework for feature extraction from hospital medical data with applications in risk prediction. *BMC Bioinformatics*, 15(1), 1–9.

Vashist, S. K. (2012). Non-invasive glucose monitoring technology in diabetes management: A review. *Analytica Chimica Acta*, 750, 16–27.

Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., et al. (2017). Attention is all you need. *Advances in Neural Information Processing Systems*, 30.

Xiao, C., Choi, E., & Sun, J. (2018). Opportunities and challenges in developing deep learning models using electronic health records data: a systematic review. *Journal of the American Medical Informatics Association*, 25(10), 1419–1428.

Yu, D., Wang, H., Chen, P., & Wei, Z. (2014). Mixed pooling for convolutional neural networks. In *Rough sets and knowledge technology: 9th international conference, RSKT 2014, Shanghai, China, October 24-26, 2014, proceedings 9* (pp. 364–375). Springer.

Zeiler, M. D., & Fergus, R. (2013). Stochastic pooling for regularization of deep convolutional neural networks. arXiv preprint arXiv:1301.3557.

Zhang, Y. (2019). ATTAIN: Attention-based time-aware LSTM networks for disease progression modeling. In *In proceedings of the 28th international joint conference on artificial intelligence* (pp. 4369–4375).

Zhao, J., Papapetrou, P., Asker, L., & Boström, H. (2017). Learning from heterogeneous temporal data in electronic health records. *Journal of Biomedical Informatics*, 65, 105–119.

Zhu, Y., Li, H., Liao, Y., Wang, B., Guan, Z., Liu, H., et al. (2017). What to do next: Modeling user behaviors by time-LSTM. In *IJCAI, Vol. 17* (pp. 3602–3608).