BackgroundEarly identification of frail patients and early interventional treatment can minimize the frailty-related medical burden. This study investigated the use of machine learning (ML) to detect frailty in hospitalized older adults with acute illnesses.MethodsWe enrolled inpatients of the geriatric medicine ward at Taichung veterans general hospital between 2012 and 2022. We compared four ML models including logistic regression, random forest (RF), extreme gradient boosting, and support vector machine (SVM) for the prediction of frailty. The feature window as well as the prediction window was set as half a year before admission. Furthermore, Shapley additive explanation plots and partial dependence plots were used to identify Fried’s frailty phenotype for interpreting the model across various levels including domain, feature, and individual aspects.ResultsWe enrolled 3367 patients. Of these, 2843 were frail. We used 21 features to train the prediction model. Of the 4 tested algorithms, SVM yielded the highest AUROC, precision and F1-score (78.05%, 94.53% and 82.10%). Of the 21 features, age, gender, multimorbidity frailty index, triage, hemoglobin, neutrophil ratio, estimated glomerular filtration rate, blood urea nitrogen, and potassium were identified as more impactful due to their absolute values.ConclusionsOur results demonstrated that some easily accessed parameters from the hospital clinical data system can be used to predict frailty in older hospitalized patients using supervised ML methods.