Background: Hospital-acquired complications (HACs) have an adverse impact on patient recovery by impeding their path to full recovery and increasing healthcare costs. Objective: The aim of this study was to create a HAC risk prediction machine learning (ML) framework using hospital administrative data collections within North Metropolitan Health Service (NMHS), Western Australia. Method: A retrospective cohort study was performed among 64,315 patients between July 2020 to June 2022 to develop an automated ML framework by inputting HAC and the healthcare site to obtain site-specific predictive algorithms for patients admitted to the hospital in NMHS. Univariate analysis was used for initial feature screening for 270 variables. Of these, 77 variables had significant relationship with any HAC. After excluding non-contemporaneous data, 37 variables were included in developing the ML framework based on logistic regression (LR), decision tree (DT) and random forest (RF) models to predict occurrence of four specific HACs: delirium, aspiration pneumonia, pneumonia and urinary tract infection. Results: All models exhibited similar performance with area under the curve scores around 0.90 for both training and testing datasets. For sensitivity, DT and RF exceeded LR performance while on average, false positives were lowest for LR-based models. Patient’s length of stay, Charlson Index, operation length and intensive care unit stay were common predictors. Conclusion: Integrating ML-based risk detection systems into clinical workflows can potentially enhance patient safety and optimise resource allocation. LR-based models exhibited best performance. Implications: We have successfully developed a “real-time” risk prediction model, where patient risk scores are calculated and reviewed daily.