## 4 Experiment
### Baseline  
In nonRNN algorithms, we choose logistic regression and random forests. Because they cannot handle time series with different lengths, we will impute the time series less than the maximum time step with zero. In the deep learning algorithms, we choose LSTM and GRU.  
Three imputation methods of missing values will be used in the four algorithms mentioned above, which are mean imputation (Equation (21)), forward imputation (Equation (22)) and zero imputation (Equation (23)). We refer these approaches as RF-forward, RF-mean, RF-zero, LR-forward, LR-mean, LR-zero, LSTM-forward, LSTM-mean, LSTM-zero, GRU-forward, GRU-mean and GRU-zero. In addition to the imputed time series, we input the binary mask indicator into the four models we choose by concatenating them together. The purpose is to know whether the models are able to capture missing pattern information in the mask indicator and improve classification performances. We refer these approaches as RF-mask-forward, RF-mask-mean, LR-mask-forward, LR-mask-mean, LSTM-mask-mean, GRU-mask-forward and GRU-mask-mean. Moreover, in such sparse time series (missing rate more than 80%), feature engineering is one of the effective ways to ease from the lack of data. We use logistic regression and random forests to perform the experiments using feature engineering. Besides the mask indicator, the maximum, minimum, mean values and missing rate of every variables are input into the models along with time series. We refer these approaches as RF-mask-forward-m and LR-mask-forward-m. In the interest of testing if the missing rate improves the classification performances, we do contrast experiments by simply removing it from the baselines. We refer these approaches as RF-mask-forward-m w/o \(\mu\) and LR-mask-forward-m w/o \(\mu\). We do the feature extraction and imputation before time step sampling, so that only when the variables are completely missing can we not find its last observation or the maximum, minimum, mean values:  
\[\tilde{x}_{t}^{d}=\begin{cases}x_{t}^{d},&\text{if }x_{t}^{d}\text{ is observed},\\ x_{mean}^{d},&\text{otherwise},\end{cases} \tag{21}\]  
\[\tilde{x}_{t}^{d}=\begin{cases}x_{t}^{d},&\text{if }x_{t}^{d}\text{ is observed},\\ x_{last}^{d},&\text{otherwise},\end{cases} \tag{22}\]  
\[\tilde{x}_{t}^{d}=\begin{cases}x_{t}^{d},&\text{if }x_{t}^{d}\text{ is observed},\\ 0,&\text{otherwise}.\end{cases} \tag{23}\]  
\(x_{mean}^{d}\) indicates the mean value of variable \(d\) in the training set. \(x_{last}^{d}\) indicates the last observation of variable \(d\) in time series \(x\) if there is an observation before time step \(t\); otherwise, it is zero.  
We compare our method with the state-of-the-art GRU-D. GRU-D does not need to choose the imputation method because of the dynamic imputation mechanism.  
Because the filling of missing data will directly affect the experimental results and we are not sure whether the dynamic imputation mechanism is effective, we separate it from VS-GRU and VS-GRU-i, which are VS-GRU w/o di and VS-GRU-i w/o di, using forward imputation instead.  
Figure 8: The label distribution in ICD-9 Code tasks. \(x\)-axis, label id in the ICD-9 diagnosis category; \(y\)-axis, the number of ICU records with positive labels.