OBJECTIVETo describe the results of the application of a Machine Learning (ML) model to predict in-hospital cardiac arrests (ICA) 24 hours in advance in the hospital wards.DESIGNRetrospective observational cohort study.SETTINGHospital Wards.PATIENTSData were extracted from the hospital's Electronic Health Record (EHR). The resulting database contained a total of 750 records corresponding to 620 different patients (370 patients with ICA and 250 control), between may 2009 and december 2021.INTERVENTIONSNo.MAIN VARIABLES OF INTERESTAs predictors of ICA, a set of 28 variables including personal history, vital signs and laboratory data was employed.MODELSFor the early prediction of ICA, predictive models based on the following ML algorithms and using the mentioned variables, were developed and compared: K Nearest Neighbours, Support Vector Machine, Multilayer Perceptron, Random Forest, Gradient Boosting and Custom Ensemble of Gradient Boosting estimators (CEGB).EXPERIMENTSModel training and evaluation was carried out using cross validation. Among metrics of performance, accuracy, specificity, sensitivity and AUC were estimated.RESULTSThe best performance was provided by the CEGB model, which obtained an AUC = 0.90, a specificity = 0.84 and a sensitivity = 0.81. The main variables with influence to predict ICA were level of consciousness, haemoglobin, glucose, urea, blood pressure, heart rate, creatinine, age and hypertension, among others.CONCLUSIONSThe use of ML models could be of great support in the early detection of ICA, as the case of the CEGB model endorsed, which enabled good predictions of ICA.