Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2024 Oct 1;139(4):690-699.
doi: 10.1213/ANE.0000000000006832. Epub 2024 Sep 4.

Classifying High-Risk Patients for Persistent Opioid Use After Major Spine Surgery: A Machine-Learning Approach

Affiliations

Classifying High-Risk Patients for Persistent Opioid Use After Major Spine Surgery: A Machine-Learning Approach

Sierra Simpson et al. Anesth Analg. .

Abstract

Background: Persistent opioid use is a common occurrence after surgery and prolonged exposure to opioids may result in escalation and dependence. The objective of this study was to develop machine-learning-based predictive models for persistent opioid use after major spine surgery.

Methods: Five classification models were evaluated to predict persistent opioid use: logistic regression, random forest, neural network, balanced random forest, and balanced bagging. Synthetic Minority Oversampling Technique was used to improve class balance. The primary outcome was persistent opioid use, defined as patient reporting to use opioids after 3 months postoperatively. The data were split into a training and test set. Performance metrics were evaluated on the test set and included the F1 score and the area under the receiver operating characteristics curve (AUC). Feature importance was ranked based on SHapley Additive exPlanations (SHAP).

Results: After exclusion (patients with missing follow-up data), 2611 patients were included in the analysis, of which 1209 (46.3%) continued to use opioids 3 months after surgery. The balanced random forest classifiers had the highest AUC (0.877, 95% confidence interval [CI], 0.834-0.894) compared to neural networks (0.729, 95% CI, 0.672-0.787), logistic regression (0.709, 95% CI, 0.652-0.767), balanced bagging classifier (0.859, 95% CI, 0.814-0.905), and random forest classifier (0.855, 95% CI, 0.813-0.897). The balanced random forest classifier had the highest F1 (0.758, 95% CI, 0.677-0.839). Furthermore, the specificity, sensitivity, precision, and accuracy were 0.883, 0.700, 0.836, and 0.780, respectively. The features based on SHAP analysis with the highest impact on model performance were age, preoperative opioid use, preoperative pain scores, and body mass index.

Conclusions: The balanced random forest classifier was found to be the most effective model for identifying persistent opioid use after spine surgery.

PubMed Disclaimer

Conflict of interest statement

Conflicts of Interest: See Disclosures at the end of the article.

Figures

Figure 1.
Figure 1.
Analysis pipeline workflow. AUC indicates area under the receiver operating characteristic curve; EHR, electronic health record; LOS, length of stay; SHAP, SHapley Additive exPlanations; SMOTE, Synthetic Minority Oversampling Technique.
Figure 2.
Figure 2.
Performance––based on AUC––of each machine-learning model when tested on the test set (20% of dataset held out of training) when (A) not using SMOTE or (B) using SMOTE. AUC indicates area under the receiver operating characteristics curve; SMOTE, Synthetic Minority Oversampling Technique.
Figure 3.
Figure 3.
A calibration plot visualizing the fit of the best model on the test set. The predicted risk was plotted against the observed risk for each of the risk percentiles created from the data set.
Figure 4.
Figure 4.
Beeswarm plot illustrating SHAP values for feature importance based on the random forest classifier. NRS indicates numeric rating scale; SHAP, SHapley Additive exPlanations.

References

    1. Seth P SL, Rudd RA, Bacon S. Overdose deaths involving opioids, cocaine, and psychostimulants: United States, 2015–2016. MMWR Morb Mortal Wkly Rep 2021. 2018:349–358. - PMC - PubMed
    1. CDC. U.S. opioid dispensing rate maps. Updated November 10, 2023. Accessed August 10, 2023. https://www.cdc.gov/drugoverdose/rxrate-maps/index.html.
    1. Lyden J, Binswanger IA. The United States opioid epidemic. Semin Perinatol. 2019;43:123–131. - PMC - PubMed
    1. Guy GP, Jr, Zhang K, Schieber LZ, Young R, Dowell D. County-level opioid prescribing in the United States, 2015 and 2017. JAMA Intern Med. 2019;179:574–576. - PMC - PubMed
    1. Brummett CM, Waljee JF, Goesling J, et al. New persistent opioid use after minor and major surgical procedures in US adults. JAMA Surg. 2017;152:e170504–e170504. - PMC - PubMed

MeSH terms

Substances