Background: Preterm neonates with respiratory distress syndrome (RDS) who fail continuous positive airway pressure (CPAP) ventilation have higher risks for increased morbidity and mortality. Objective: To assess if machine learning, on multicenter data, may predict CPAP failure in preterm infants with RDS and allow proactive intervention to minimize CPAP failure burden and improve clinical outcomes. Methods: This study was conducted using the Oracle EHR Real-World Data (OERWD) database including preterm NICU admits between 2002-2023. CPAP failure was defined as the need for invasive mechanical ventilation within 72 hours of life. Demographics, admit vital signs, and laboratory values were retrieved to develop an explainable machine learning model using extreme gradient boosting (XGBoost). Results: 24,127 neonates from 27 NICUs qualified for the study with CPAP failure rate of 64.1%. FiO2 was the strongest predictor of CPAP failure followed by systolic blood pressure, temperature, birthweight, PaO2, oxygen saturation, heart rate, and gestational age followed in importance. Resulting XGBoost model attained an area under the receiver operator characteristic curve of 0.91 (95% CI: 0.90, 0.92) and an F-1 score of 0.87. Conclusions: CPAP failure can be predicted with high accuracy at admission to the NICU creating opportunities for early intervention and prevention of RDS related complications.