Predicting Survival of Intensive Care Unit Patients with Support Vector Machines

Josh Hollandsworth
Brad Lipson
Eric Miller

2023-12-01

SVM’s and Our Data Source

With Eric Miller

History and Background

  • Developed by Vapnik and Chervonenkis in 1964 then revised in 1992 to incorporate Non-linear classifiers
  • Support Vector Machines (SVM) employs supervised learning using past data to train models for new cases
  • SVM models are used to form clusters of two distinct data groups
  • SVM establishes a hyperplane to maximize the margin between data groups
  • The hyperplane acts as a line separating the clusters
  • The goal is to ensure the greatest separation between neighboring members of each cluster

Data Source

  • Our team is utilizing data from the Medical Information Mart for Intensive Care (MIMIC)
  • We are focusing on the MIMIC III dataset.
  • The dataset was pre-processed to isolate the most statistically significant features

Methods - Kernal Function

  • Support Vector Machines operate on both linear and non-linear data by using a kernel function or “kernel trick” to manipulate non-linear data into a linear space for classification. The general formula for a kernel function is as follows, where \(X_i, X_j\) is a tuple.

\[ K(X_i, X_j) = \Phi(X_i)\Phi(X_j) \]

Methods - Hyperplane

Once the data is linearly separable, we can define our maximally marginal hyperplane. A general formula for the hyperplane is as follows \[ W \times X + b = 0 \]

This formula has 2 components of import. The first is a \(W\), a weight vector and \(b\) a scalar bias.

Since \(W\) is a simple weighting vector it would be in the form of the below

\[ W = \{w_1, w_2, \dots, w_n \} \]

Methods - Support Vectors

The tuples that lie the closest to the margins of the maximal marginal hyperplane are the actual support vectors.

Using the formulas on the previous slide, if our support vectors where at \(y_i = 1\) and \(y_i = -1\) our hyperplane margins would be defined as

\[ H_1: W_0 + W_{1}X_{1} + W_{2}X_{2} + \dots + W_{n}X_{n} \ge 1 \]

and

\[ H_2: W_0 + W_{1}X_{1} + W_{2}X_{2} + \dots + W_{n}X_{n} \le -1 \]

SVM Vizualization

Modelling ICU Patient survival from the MIMIC dataset

With Josh Hollandsworth

Important Concepts

  • used the e1071 r package
  • leveraged the tune(svm, ...) function for tuning our model hyperparameters

Our intial primary model

  • was of type “C-Classification”
  • leveraged a linear kernel
  • only tuned the cost hyperparameter

Initial Model Analysis

What was wrong with our model

  • Class imbalance !!!
    • 86% of the time, patients surived
    • 14% of the time, patients died
  • Random sampling could exacerbate this problem

Fixing the model

We attempted 2 strategies to fix the

  • Oversampling of minority case
    • Ensure that minority case was a larger percentage of the training set via selection with replacement
  • Downsampling majority case
    • Take a large percentage of the minority cases, select and EQUIVALENT number of majority cases for a 50/50 split

Tuning the new model

  • tested using a rbf (radial bias kernel)
  • switched to nu-classification
  • tuned for nu and gamma
    • using grid search strategy and a bunch of packages

Tuning the new model…more problems

  • Tune SVM is VERY VERY SLOW
    • does not leverage mulitiple cpu cores
    • operates sequentially
  • doParallel and foreach to the rescue
  • still slow but much quicker at the same time

Tuning the new model and paying more for it

Tuning Results

  • nu-classification won out
  • Primary Model
    • Gamma = 0.02
    • Nu = 0.75
  • Challenger model
    • Gamma = 0.17
    • Nu = 0.87

Model results (Primary)

Model Results (Challenger)

Results and Conclusions

With Brad Lipson

Data

Characteristic Died, N = 7411 Survived, N = 3,8181 Overall, N = 4,5591
Patient Age


    Median(IQR) 73(60, 83) 65(53, 78) 67(54, 80)
    Range 17, 91 17, 91 17, 91
Patient Sex


    female 339 (46%) 1,639 (43%) 1,978 (43%)
    male 402 (54%) 2,179 (57%) 2,581 (57%)
Heart Rate


    Median(IQR) 92(77, 106) 87(76, 99) 88(76, 100)
    Range 47, 155 36, 139 36, 155
Systolic Blood Pressure


    Median(IQR) 108(100, 120) 115(106, 126) 114(105, 126)
    Range 70, 175 76, 195 70, 195
    Unknown 2 6 8
1 n (%)

Data Continued

Characteristic Died, N = 741 Survived, N = 3,818 Overall, N = 4,559
Respiration Rate


    Median(IQR) 21.5(18.4, 24.9) 18.9(16.6, 21.9) 19.3(16.8, 22.4)
    Range 11.3, 40.6 9.5, 40.4 9.5, 40.6
    Unknown 0 1 1
Body Temperature (c)


    Median(IQR) 36.62(36.11, 37.19) 36.87(36.47, 37.32) 36.82(36.41, 37.31)
    Range 31.60, 39.71 32.61, 40.10 31.60, 40.10
    Unknown 20 83 103
White Blood Cell Count


    Median(IQR) 13(9, 18) 12(8, 15) 12(8, 16)
    Range 0, 404 0, 207 0, 404

Data Continued again

Characteristic Died, N = 741 Survived, N = 3,818 Overall, N = 4,559
Platelet Count


    Median(IQR) 166(95, 253) 180(126, 245) 178(122, 246)
    Range 8, 951 5, 1,297 5, 1,297
    Unknown 1 5 6
Creatinine Level


    Median(IQR) 1.60(1.00, 2.60) 1.10(0.80, 1.70) 1.20(0.90, 1.90)
    Range 0.20, 14.40 0.10, 27.80 0.10, 27.80
    Unknown 1 1 2
Lactate Level


    Median(IQR) 2.55(1.70, 4.50) 1.80(1.30, 2.55) 1.90(1.35, 2.75)
    Range 0.40, 20.85 0.30, 16.80 0.30, 20.85

Results

  • The findings indicate that our support vector machine (SVM) model had a test set accuracy of 74.74%.
  • The model exhibited a sensitivity rate of 74.87% and a specificity rate of 63.89%
  • The study yielded a positive predictive value of 99.41% and a negative predictive value of 3%.
  • The area under the receiver operating characteristic (ROC) curve was determined to be 0.7711
  • The F1 score was determined to be 0.8541.

Model Conclusions

  • Our support vector machine (SVM) model demonstrated moderate accuracy in predicting hospital mortality.
  • The predictive accuracy of the model was higher for patients who survived compared to those who did not.
  • The model can tell the difference between patients who will die and those who will not.

Considerations for improvement

  • Potential to serve as a valuable tool for forecasting patient mortality in hospital settings.
  • Additional investigation is required to substantiate these results among a broader and more heterogeneous sample.
  • Constraints since the investigation was carried out on a limited cohort of individuals.
  • Data from just one hospital, should include globally

Considerations for improvement (Cont’d)

  • Should improve diversity in future studies
  • Limit the applicability of the findings to other healthcare institutions.
  • Failed to account for other potential confounders of the ICU patients.

Future Studies

  • Examine the outcomes of this study in a bigger, more heterogeneous sample.
  • Further investigation is warranted to explore the application of SVMs in predicting additional clinical outcomes
  • Should study duration of hospitalization and rates of patient readmission
  • Predict length of stay in hospital
  • Predict length of time patients may live with certain conditions, depending on severity

Thank you! Any Questions?