Lakshika Tennakoon

Lakshika Tennakoon
Prediction of Firearm Injury Using the National Inpatient Sample: A Random Forest Approach

Lakshika Tennakoon

Speakers Day 1
University / Institution

Stanford University School of Medicine

Representing

USA

Abstract

We conducted a retrospective cohort study using the 2022 National Inpatient Sample (NIS), including hospitalized patients aged ≥13 years, to develop and evaluate a machine learning model for firearm injury prediction. Firearm injury was defined as the primary outcome using ICD-10 diagnosis codes. Predictor variables included patient demographics (age, sex, race, socioeconomic status), comorbidities (including substance use disorders), hospital characteristics, and clinical severity measures such as APRDRG severity and mortality risk. A Random Forest (RF) model was constructed to capture nonlinear relationships and interactions among predictors. The dataset was randomly split into training (70%) and testing (30%) subsets, with cross-validation applied during training to enhance generalizability and reduce overfitting. Model performance was assessed using the area under the receiver operating characteristic curve (AUC), log loss, root mean square error (RMSE), and classification error. Feature importance and SHAP (Shapley Additive Explanations) values were used to interpret model outputs and identify key predictors. The RF model demonstrated strong discrimination with an AUC of 0.85 in a large national cohort (n≈5.7 million). Low log loss (0.012) and RMSE (0.043) indicated stable and well-calibrated predictions; however, mean class error (0.42) and low AUCPR (0.04) reflected challenges related to class imbalance. Opioid use emerged as the strongest predictor, followed by clinical severity, socioeconomic status, and race, highlighting both clinical and structural contributors. Substance use disorder increased risk, while female sex and older age were associated with lower predicted risk. Overall, the model supports population-level risk stratification, though refinement is needed for improved individual-level prediction.Top of FormBottom of Form