Use of random forest machine learning algorithm to predict short term outcomes following posterior cervical decompression with instrumented fusion

Published:November 11, 2022DOI:


      • Machine learning is being increasingly integrated into the medical field.
      • Random forest, a machine learning algorithm, can be used in predictive analytics.
      • Random forest models can provide insight into identifying operative risk factors.
      • Random forest models can accurately predict post-operative outcomes.
      • Machine learning models may help mitigate adverse outcomes following spine surgery.


      Random Forest (RF) is a widely used machine learning algorithm that can be utilized for identification of patient characteristics important for outcome prediction. Posterior cervical decompression with instrumented fusion (PCDF) is a procedure for the management of cervical spondylosis, cervical spinal stenosis, and degenerative disorders that can cause cervical myelopathy or radiculopathy. An RF algorithm was employed to predict and describe length of stay (LOS), readmission, reoperation, transfusion, and infection rates following elective PCDF using The American College of Surgeons National Quality Improvement Program (ACS-NSQIP) database 2008 through 2018. The RF algorithm was tasked with determining the importance of independent clinical variables in predicting our outcomes of interest and importance of each variable based on the reduction in the Gini index. Application of an RF algorithm to the ACS-NSQIP database yielded a highly predictive set of patient characteristics and perioperative events for five outcomes of interest related to elective PCDF. These variables included postoperative infection, increased age, BMI, operative time, and LOS, and decreased preoperative hematocrit and white blood cell count. Risk factors that were predictive for rate of reoperation, readmission, hospital length of stay, transfusion requirement, and post-operative infection were identified with AUC values of 0.781, 0.791, 0.781, 0.902, and 0.724 respectively. Utilization of these findings may assist in risk analysis during the perioperative period and may influence clinical or surgical decision-making.


      To read this article in full you will need to make a payment

      Purchase one-time access:

      Academic & Personal: 24 hour online accessCorporate R&D Professionals: 24 hour online access
      One-time access price info
      • For academic or personal research use, select 'Academic and Personal'
      • For corporate R&D use, select 'Corporate R&D Professionals'


      Subscribe to Journal of Clinical Neuroscience
      Already a print subscriber? Claim online access
      Already an online subscriber? Sign in
      Institutional Access: Sign in to ScienceDirect


        • Weng S.F.
        • Reps J.
        • Kai J.
        • Garibaldi J.M.
        • Qureshi N.
        Can machine-learning improve cardiovascular risk prediction using routine clinical data?.
        PLoS ONE. 2017; 12: e0174944
        • Nemati S.
        • Holder A.
        • Razmi F.
        • Stanley M.D.
        • Clifford G.D.
        • Buchman T.G.
        An Interpretable Machine Learning Model for Accurate Prediction of Sepsis in the ICU.
        Crit Care Med. 2018; 46: 547-553
        • Yang L.
        • Wu H.
        • Jin X.
        • Zheng P.
        • Hu S.
        • Xu X.
        • et al.
        Study of cardiovascular disease prediction model based on random forest in eastern China.
        Sci Rep. 2020; 10: 5245
        • Hanko M.
        • Grendár M.
        • Snopko P.
        • Opšenák R.
        • Šutovský J.
        • Benčo M.
        • et al.
        Random Forest-Based Prediction of Outcome and Mortality in Patients with Traumatic Brain Injury Undergoing Primary Decompressive Craniectomy.
        World Neurosurg. 2021; 148: e450-e458
        • Alam Z.
        • Saifur R.M.
        • Sohel R.M.
        A Random Forest Based Predictor for Medical Data Classification Using Feature Ranking.
        Inf Med Unlocked. 2019; : 15
        • Wolfe F.
        • Clauw D.J.
        • Fitzcharles M.A.
        • Goldberg D.L.
        • Katz R.S.
        • Mease P.
        • et al.
        The American College of Rheumatology preliminary diagnostic criteria for fibromyalgia and measurement of symptom severity.
        Arthritis Care Res. 2010; 62: 600-610
        • Breiman L.
        Random forests.
        Mach Learn. 2001; 45: 5-32
        • Cutler A.
        • Cutler D.R.
        • Stevens J.R.
        Random forests.
        in: Zhang C. Ma Y. Ensemble Machine Learning. Springer Publishing Company, New York2012: 157-175
        • Menze B.H.
        • Kelm B.M.
        • Masuch R.
        • Himmelreich U.
        • Bachert P.
        • Petrich W.
        • et al.
        A comparison of random forest and its Gini importance with standard chemometric methods for the feature selection and classification of spectral data.
        BMC Bioinform. 2009; 10: 213
        • Inose H.
        • Yoshii T.
        • Kimura A.
        • Takeshita K.
        • Inoue H.
        • Maekawa A.
        • et al.
        Comparison of Clinical and Radiographic Outcomes of Laminoplasty, Anterior Decompression With Fusion, and Posterior Decompression With Fusion for Degenerative Cervical Myelopathy: A Prospective Multicenter Study.
        Spine (Phila Pa 1976). 2020; 45: E1342-E1348
        • Liu C.Y.
        • Zygourakis C.C.
        • Yoon S.
        • Kliot T.
        • Moriates C.
        • Ratliff J.
        • et al.
        Trends in Utilization and Cost of Cervical Spine Surgery Using the National Inpatient Sample Database, 2001 to 2013.
        Spine (Phila Pa 1976). 2017; 42: E906-E913
        • Vonck C.E.
        • Tanenbaum J.E.
        • Smith G.A.
        • Benzel E.
        • Mroz T.E.
        • Steinmetz M.P.
        National Trends in Demographics and Outcomes Following Cervical Fusion for Cervical Spondylotic Myelopathy.
        Global Spine J. 2018; 8: 244-253
        • Cole T.
        • Veeravagu A.
        • Zhang M.
        • Azad T.D.
        • Desai A.
        • Ratliff J.K.
        Anterior Versus Posterior Approach for Multilevel Degenerative Cervical Disease: A Retrospective Propensity Score-Matched Study of the MarketScan Database.
        Spine (Phila Pa 1976). 2015; 40: 1033-1038
        • Thirumala P.
        • Zhou J.
        • Natarajan P.
        • Dixon E.
        • Okonkwo D.
        • Hamilton D.K.
        • et al.
        Perioperative neurologic complications during spinal fusion surgery: incidence and trends.
        Spine J. 2017; 17: 1611-1624
        • Veeravagu A.
        • Cole T.
        • Jiang B.
        • Ratliff J.K.
        Revision rates and complication incidence in single- and multilevel anterior cervical discectomy and fusion procedures: an administrative database study.
        Spine J. 2014; 14: 1125-1131
        • Boniello A.
        • Petrucelli P.
        • Kerbel Y.
        • Horn S.
        • Bortz C.A.
        • Brown A.E.
        • et al.
        Short-term Outcomes Following Cervical Laminoplasty and Decompression and Fusion With Instrumentation.
        Spine (Phila Pa 1976). 2019; 44: e1018-e1023
        • Neifert S.
        • Lamb C.
        • Gal J.
        • Martini M.
        • Nistal M.
        • Rothrock R.
        • et al.
        Later Surgical Start Time is Associated with Longer Length of Stay and Higher Cost in Cervical Spine Surgery.
        Spine J. 2020; 45: 1171-1177
        • Pedregosa F.
        • Varoquaux G.
        • Gramfort A.
        • Michel V.
        • Thirion B.
        • Grisel O.
        • et al.
        Scikit-learn: Machine Learning in Python.
        J Mach Learn Res. 2011; 12: 2825-2830
        • Hunter J.D.
        Matplotlib: A 2D graphics environment.
        Comput Sci Eng. 2007; 9: 90-95
        • Zahangir M.D.
        • Rahman M.S.
        • Rahman M.S.
        A Random Forest based predictor for medical data classification using feature ranking.
        Inf Med Unlocked. 2019; 15100180
        • Ling C.X.
        • Huang J.
        • Zhang H.
        AUC: a better measure than accuracy in comparing learning algorithms.
        in: Yang X. Brahim C. Advances in Artificial Intelligence. Springer Publishing Company-Berlin, Heidelberg2003: 329-341
        • Parra-Frutos I.
        Testing homogeneity of variances with unequal sample sizes.
        Comput Stat. 2013; 28: 1269-1297
        • Vetter T.R.
        Fundamentals of Research Data and Variables: The Devil Is in the Details.
        Anesth Analg. 2017 Oct; 125: 1375-1380
        • Badiee R.
        • Mayer R.
        • Pennicooke B.
        • Chou D.
        • Mummaneni P.
        • Tan L.
        Complications Following Posterior Cervical Decompression and Fusion: A Review of Incidence, Risk Factors and Prevention Strategies.
        J Spine Surg. 2020; 6: 323-333
        • Parvizi J.
        • Tan T.L.
        • Goswami K.
        • Higeura C.
        • Della Valle C.
        • Chan A.F.
        • et al.
        The 2018 Definition of Periprosthetic Hip and Knee Infection: An Evidence-Based and Validated Criteria.
        J Arthroplasty. 2018; 33: 1309-1314
        • Wolfe F.
        • Clauw D.J.
        • Fitzcharles M.A.
        • Goldenberg D.L.
        • Katz R.S.
        • Mease P.
        • et al.
        The American College of Rheumatology preliminary diagnostic criteria for fibromyalgia and measurement of symptom severity.
        Arthritis Care Res. 2010; 62: 600-610
        • Khan O.
        • Badhiwala J.H.
        • Akbar M.A.
        • Fehlings M.
        Prediction of Worse Functional Status After Surgery for Degenerative Cervical Myelopathy: A Machine Learning Approach.
        Neurosurgery. 2021; 88: 584-591
        • Merali Z.G.
        • Witiw C.D.
        • Badhiwala J.H.
        • Wilson J.R.
        • Fehlings M.
        Using a machine learning approach to predict outcome after surgery for degenerative cervical myelopathy.
        PLoS ONE. 2019; 14: e0215133
        • Fatima N.
        • Massaad E.
        • Alvarez-Breckenridge C.
        • Berry Candelario J.E.
        • Hadzipasic M.
        • Shankar G.M.
        • et al.
        Does Obesity Correlate with Postoperative Complication After Elective Posterior Cervical Spine Fusion?.
        World Neurosurg. 2020; 141: e231-e238
        • Katz A.
        • Job A.
        • Morris M.
        • Perfetti D.C.
        • Goldstein J.A.
        • Verma R.B.
        • et al.
        Can posterior cervical decompression and fusion be safely performed in the outpatient settings?.
        Spine J. 2021; 21: 109-110
        • Memstoudis S.
        • Hughes A.
        • Ma Y.
        • Ya Lin C.
        • Sama A.A.
        • Girardi F.P.
        Increased In-Hospital Complications After Primary Posterior versus Primary Anterior Cervical Fusion.
        Clin Orthop Relat Res. 2010; 469: 649-657
        • Talari K.
        • Goyal M.
        Retrospective Studies – Utilities and Caveats.
        J R Coll Physicians Edinb. 2022; 50: 389-402