BACKGROUND: Preterm birth, defined as delivery before 37 weeks of gestation, is a major cause of neonatal morbidity and mortality and places a substantial burden on healthcare systems. Many existing prediction tools depend on clinical measurements, imaging, or laboratory results that may be unavailable or inconsistently recorded early in pregnancy. Routinely collected administrative health records may offer a scalable alternative for early population-level risk prediction. OBJECTIVE: This study aimed to develop and evaluate machine learning models for predicting preterm birth at 26 weeks of gestation using routinely collected administrative health records. STUDY DESIGN: We conducted a retrospective population-based cohort study of 328,834 singleton live-birth pregnancies in Alberta, Canada, from 2009 through 2018. Maternal inpatient and outpatient records, physician claims, and prescription dispensations were linked to construct pregnancy-level features from 1 year before conception through 26 weeks of gestation. We developed and compared logistic regression, random forest, tabular neural network, gradient-boosted tree, and transformer-based models. Data were split chronologically into a training set from 2009 through 2016 (261,648 pregnancies) and an independent holdout set from 2017 through 2018 (67,186 pregnancies). Model performance was assessed on the holdout set using the area under the receiver operating characteristic curve, area under the precision-recall curve, calibration, Brier score, and threshold-based classification measures. RESULTS: The gradient-boosted tree model achieved the best overall performance, with an area under the receiver operating characteristic curve of 0.7704 (95% confidence interval, 0.7625-0.7778) and an area under the precision-recall curve of 0.4403, outperforming the other models. Transformer-based models also showed strong discrimination and performed better than several traditional approaches. Predicted risks showed good alignment with observed outcomes, and risk stratification identified clinically meaningful groups with progressively higher observed preterm birth rates across increasing predicted risk categories. CONCLUSION: Machine learning models trained on large-scale administrative health records can predict preterm birth with good discrimination by 26 weeks of gestation. These models support early, scalable, population-level risk stratification using routinely collected health system data and may help identify pregnancies that could benefit from closer follow-up and preventive planning. Such models are intended to complement, not replace, clinical assessment.
Paul et al. (Mon,) studied this question.