Machine learning-based dynamic mortality prediction after traumatic brain injury

Our aim was to create simple and largely scalable machine learning-based algorithms that could predict mortality in a real-time fashion during intensive care after traumatic brain injury. We performed an observational multicenter study including adult TBI patients that were monitored for intracranial pressure (ICP) for at least 24 h in three ICUs. We used machine learning-based logistic regression modeling to create two algorithms (based on ICP, mean arterial pressure [MAP], cerebral perfusion pressure [CPP] and Glasgow Coma Scale [GCS]) to predict 30-day mortality. We used a stratified cross-validation technique for internal validation. Of 472 included patients, 92 patients (19%) died within 30 days. Following cross-validation, the ICP-MAP-CPP algorithm’s area under the receiver operating characteristic curve (AUC) increased from 0.67 (95% confidence interval [CI] 0.60–0.74) on day 1 to 0.81 (95% CI 0.75–0.87) on day 5. The ICP-MAP-CPP-GCS algorithm’s AUC increased from 0.72 (95% CI 0.64–0.78) on day 1 to 0.84 (95% CI 0.78–0.90) on day 5. Algorithm misclassification was seen among patients undergoing decompressive craniectomy. In conclusion, we present a new concept of dynamic prognostication for patients with TBI treated in the ICU. Our simple algorithms, based on only three and four main variables, discriminated between survivors and non-survivors with accuracies up to 81% and 84%. These open-sourced simple algorithms can likely be further developed, also in low and middle-income countries.


Introductio
Background and objectives 3a Explain the medical context (including whether diagnostic or prognostic) and rationale for developing or validating the multivariable prediction model, including references to existing models. OK 3b Specify the objectives, including whether the study describes the development or validation of the model or both.

Methods
Source of data 4a Describe the study design or source of data (e.g., randomized trial, cohort, or registry data), separately for the development and validation data sets, if applicable.
OK 4b Specify the key study dates, including start of accrual; end of accrual; and, if applicable, end of follow-up. OK
The ICP-MAP-CPP algorithm 1. Total of 55 features considered: The ICP-MAP-CPP-GCS algorithm 1. Total of 76 features considered: Figure 1: Showing the predictions of the four false negatives with a last probability of death over 60%. All of these patients survived. Numbers one to three recovered to live dependently in a nursing home facility and number four was left severely disabled and bedridden. Numbers two to four underwent decompressive craniectomy that effectively lowered their rise in intracranial pressure. 7.6 (6.5-9.2) 7.8 (6.9-9.1) 7.4 (6.6-9.1) 0.33 Hb (g/l) †, median (IQR) 131 (

Load data
The data resides in the Google Cloud BigQuery data warehouse. In this section we load the data into Pandas dataframes for analysis.
# standard data science libraries import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # Google BigQuery API import google.datalab.bigquery as bq # libraries for HTML display and progress bars from IPython.display import HTML from tqdm import tqdm_notebook The data is arranged into three datasets. The raw data from HUS and KYS is processed into patient_data and then combined in combined_patient_data, as explained in other notebooks. %%bq datasets list A quick peek into the patients dataset shows the patient ids (4-1692 for HUS patients, 12220-150050 for KYS patients and 74000-14910000 for TYKS patients), the targets dead30 and age categories. %%bq query -n patients SELECT

Create features
In our case, the most crucial part in preparing the model is feature engineering. We will analyse the monitor data time series using four hour rolling windows. In these windows we compute various statistics and inspect their trends, which results in a number of derived time series. Finally, we turn these derived series into features by computing value averages over initial 24h and final 8h windows, and including a linear trend coefficient.

Fit models and cross-validate
We proceed to fitting and evaluating a logistic regression model. We will adjust the regularization coefficient C and the class weight w by using (black-box) Bayesian optimization.

Prediction on the full dataset
We illustrate the model performance by making predictions of the full dataset. In order to truthfully report the performance we use "cross-validated predictions". Here, for each data point the prediction is obtained from a model that was fitted without using this point.

View the predictions dynamically
One of the central requirements for our model was to have it predict dynamically, i.e. to make it sensitive to changes in the ICP-MAP measurements for each patient. The features facilitating this are naturally the final 8h means of each derived series as well as their linear trend coefficients. Below we illustrate this by rolling out the monitor data in 8 hour windows and predicting as we go.
Notice that the model is fit on the full dataset of untruncated time series. While the rolled out monitor data is in principle unseen to the model, some features such as the initial 24h means do not change. One should therefore view this primarily as an illustration and not a test.

Load data
The data resides in the Google Cloud BigQuery data warehouse. In this section we load the data into Pandas dataframes for analysis.
# standard data science libraries import pandas as pd import numpy as np import seaborn as sns import matplotlib.pyplot as plt # Google BigQuery API import google.datalab.bigquery as bq # libraries for HTML display and progress bars from IPython.display import HTML from tqdm import tqdm_notebook The data is arranged into three datasets. The raw data from HUS and KYS is processed into patient_data and then combined in combined_patient_data, as explained in other notebooks. %%bq datasets list A quick peek into the patients dataset shows the patient ids (4-1692 for HUS patients, 12220-150050 for KYS patients and 74000-14910000 for TYKS patients), the targets dead30 and age categories. %%bq query -n patients SELECT id, agecat, dead30 FROM `combined_patient_data.patients_HUS_KYS_TYKST he monitor data with ICP and MAP are stored in a BigQuery view format with the following schema. %%bq tables describe -n combined_patient_data.ICP_HUS_KYS_TYKS %%bq query -n ICP SELECT id, delta_icp as delta, value FROM `combined_patient_data.

Create features
In our case, the most crucial part in preparing the model is feature engineering. We will analyse the monitor data time series using four hour rolling windows. In these windows we compute various statistics and inspect their trends, which results in a number of derived time series. Finally, we turn these derived series into features by computing value averages over initial 24h and final 8h windows, and including a linear trend coefficient.   data_full, target = prepare_data(df_patients, df_icp, df_map, df_cpp, df_mr, df_er) data_full. A class imbalance exists but is not critical.

Fit models and cross-validate
We proceed to fitting and evaluating a logistic regression model. We will adjust the regularization coefficient C and the class weight w by using (black-box) Bayesian optimization.