Unplanned readmission after total hip arthroplasty (THA) has become an increasingly serious problem in the U.S., especially after the Centers for Medicare and Medicaid Services (CMS) carried out the penalty program for readmission in 2015. Thus, it is important to accurately identify high-risk patients and monitor the surgical outcomes of the medical team. In this study, we used modern machine learning algorithms to conduct patient risk stratification. We compared random forest with decision tree and the most commonly-used risk-adjustment method, logistic regression, using the THA patient-level data records from an academic medical center during 2011-2015. The results indicate that random forest outperforms logistic regression and decision tree in accurately identifying high-risk patients. Thus, this study provides new opportunities for medical decision support. Such informed medical decision making may help clinicians obtain insights into targeting medical interventions, providing patient-centered care, and reducing unplanned readmissions.