# Prediction of Intensive Care Unit Length of Stay in the MIMIC-IV Dataset
## 2 Methods
### Feature Selection  
The experiments involve the selection of features from the MIMIC-IV dataset that are typically available in each ICU admission. Table 1 summarizes all the features considered in the experiments, categorized into demographics, administrative, vital signs, and laboratory parameters. Demographic data include age and gender, neither of which are likely to change during hospitalization. Administrative data provide the LOS necessary for prediction as a ground truth label for each ICU stay. These data also comprise diagnoses, first care unit, admission type, and admission location, which can be viewed as structural representations of patient status specific to each hospital admission. Vital signs and laboratory parameters were measured several times during each ICU stay. We collected measurements within the first 24 h of ICU admission with the goal of developing a practical approach to classify (predict) ICU stays early after admission, while retaining data necessary for prediction. In addition, we only considered vital signs (laboratory parameters) with a completeness greater than 99% (95%) of all ICU stays, which means that, for instance, blood pressure is no longer included due to its high missing rate in the MIMIC-IV data. This ensures that fewer data are excluded due to missing values, as shown in Figure 1 for vital signs (A) and laboratory parameters (B). However, despite a high rate of missing values, the body temperature is still included here as an important vital sign [40]. Figure 1: The amount of missing data (percent) for (**A**) vital signs and (**B**) laboratory measurements collected during the first 24 h after ICU admission in the MIMIC-IV dataset. The vital signs (laboratory measurements) with less than 1% (5%) of all data missing are shown herein. Heart rhythm is not included in the final dataset as it is in free-text format. As a result, the vital signs include heart rate, O2 saturation pulse oxymetry, respiratory rate, body temperature, Glasgow Coma Scale (GCS) ocular response (eye), oral response (verbal), and motor response (motor). The selected laboratory parameters also include the anion gap, bicarbonate, chloride, creatinine, glucose, sodium, magnesium, potassium, phosphate, urea nitrogen, hematocrit, hemoglobin, mean corpuscular hemoglobin concentration (MCHC), mean corpuscular volume (MCV), red cell distribution width (RDW), red blood cells, white blood cells, and platelet count. All patients with at least one ICU visit are included in the cohort. Among ICU patients, we only select adults older than 18 years. In addition, we exclude patients with an LOS greater than 21 days to avoid extremely long stays, and less than one day since we consider data collected in the first 24 h for modeling. We also exclude patients who died during their stay in the ICU or who returned to the ICU within 48 h after being discharged from the ICU. To ensure the completeness of the selected data, we only consider ICU stays that have all the features required for the analysis, i.e., complete data. We finally specify a feasible range for each feature and exclude the extreme outliers outside this range to avoid, for instance, invalid negative values for heart rate. The flowchart in Figure 2 summarizes the sequential steps for selecting data that meet these conditions, with the size of the dataset indicated at each step. \begin{table}
\begin{tabular}{l l} \hline
**Data Categories** & **Features** \\ \hline Demographic & Age, Gender \\ Administrative & Diagnoses, First care unit, Admission type, Admission location, LOS \\ Vital signs & Heart rate, O2 saturation, Respiratory rate, Body temperature, Glasgow Coma Scale (eye, verbal, motor) \\ Lab parameters & Anion gap, Bicarbonate, Chloride, Creatinine, Glucose, Sodium, Magnesium, Potassium, Phosphate, Urea nitrogen, Hematocrit, Hemoglobin, MCH, MCHC, MCV, RDW, Red blood cells, White blood cells, Platelet count \\ \hline \end{tabular}
\end{table}