# Machine Learning-Based Prediction Model of Preterm Birth Using Electronic Health Record

Authors: Qi Sun; Xiaoxuan Zou; Yousheng Yan; Hongguang Zhang; Shuo Wang; Yongmei Gao; Haiyan Liu; Shuyu Liu; Jianbo Lu; Ying Yang; Xu Ma
Journal: Journal of Healthcare Engineering
 (2022)

---

## Abstract

Objective. Preterm birth (PTB) was one of the leading causes of neonatal death. Predicting PTB in the first trimester and second trimester will help improve pregnancy outcomes. The aim of this study is to propose a prediction model based on machine learning algorithms for PTB. Method. Data for this study were reviewed from 2008 to 2018, and all the participants included were selected from a hospital in China. Six algorisms, including Naive Bayesian (NBM), support vector machine (SVM), random forest tree (RF), artificial neural networks (ANN), K-means, and logistic regression, were used to predict PTB. The receiver operating characteristic curve (ROC), accuracy, sensitivity, and specificity were used to assess the performance of the model. Results. A total of 9550 pregnant women were included in the study, of which 4775 women had PTB. A total of 4775 people were randomly selected as controls. Based on 27 weeks of gestation, the area under the curve (AUC) and the accuracy of the RF model were the highest compared with other algorithms (accuracy: 0.816; AUC = 0.885, 95% confidence interval (CI): 0.873–0.897). Meanwhile, there was positive association between the accuracy and AUC of the RF model and gestational age. Age, magnesium, fundal height, serum inorganic phosphorus, mean platelet volume, waist size, total cholesterol, triglycerides, globulins, and total bilirubin were the main influence factors of PTB. Conclusion. The results indicated that the prediction model based on the RF algorithm had a potential value to predict preterm birth in the early stage of pregnancy. The important analysis of the RF model suggested that intervention for main factors of PTB in the early stages of pregnancy would reduce the risk of PTB.


---

## Body

## 1. Introduction

Preterm birth (PTB) is defined as births before 37 completed weeks of gestation [1]. The PTB studied in this study was for 28–37 weeks of gestational age. Based on gestational age at delivery, PTB can be subdivided into very early preterm (<28 weeks), early preterm (28–31 weeks), moderate preterm (31–33 weeks), and late preterm (33–37 weeks) [2]. The global estimated prevalence of PTB was 11.1% (95% confidence interval [CI]: 9.1%–13.4%) [3]. The majority of PTB occurred in low- and middle-income countries [2], and the incidence of PTB in China was 6.9% in 2014 [4]. Although the incidence of premature birth was relatively low in China, PTB had a considerable impact on the health of pregnant women and children. Evidence shows that PTB was the most common cause of neonatal death and the second most frequent cause of death in children aged <5 years [5]. Further studies found that gestational age at delivery was inversely associated with the risk of neonatal morbidity and mortality [6], and about 35.00% of deaths among newborns were caused by complications of PTB [7]. Preterm neonates who survived were vulnerable to diseases, including pulmonary hypertension [8], retinopathy [9], visual and hearing impairments [10], and mental health problem [11]. Moreover, PTB not only caused death and diseases in the newborn, but also caused anxiety and depression in postpartum women [12]. Previous study showed that early screening of preterm birth pregnant women could reduce the incidence of preterm birth [13]. Therefore, a prediction model was needed to predict PTB.Currently, numerous studies have attempted to predict preterm birth in pregnant women. Several studies supported that sonographic measurement of cervical length (CL) could be used for the prediction of PTB in the first trimester of pregnancy [14, 15], but other studies did not demonstrate the capability of CL in the screening of PTB [16, 17]. Fetal fibronectin had extensively used to predict PTB, but the sensitivity and positive predictive value of fetal fibronectin were low [18, 19]. In recent years, machine learning algorithms have been widely used in medicine with a better performance [20]. Compared with the logistic regression algorithm, the advantages of the machine learning were the ability to process higher-dimensional data and self-learn capacity [21]. Studies have shown that the use of machine learning algorithms improved the predictive accuracy of the prediction model for PTB [22, 23]. There are also some prediction models based on machine learning algorithms that have poor prediction accuracy. Weber et al. established a machine learning prediction model for preterm birth using demographic, maternal, and residency characteristics, but the predictive performance of the model was poor [24], which may be caused by inaccurate geographic information.Inconsistent predictive power of machine learning in preterm birth. In this study, we try to use a new method to preprocess predictors. At the same time, we compared the predictive power of 6 machine learning algorithms in PTB.


## 2. Materials and Methods

### 2.1. Participants

Data for this study were reviewed from 2008 to 2018. All the participants included in this study were collected from Haidian Maternal & Child Health Hospital. The inclusion criteria of the PTB group were as follows: (1) signed informed consent; (2) gestational age between 28 and 37 weeks; and (3) maternal age older than 18 years. The exclusion criteria of the PTB group are as follows: (1) missing maternal age; (2) missing gestational age; and (3) chronic diseases such as diabetes, hypertension, and heart disease. Controls were selected from hospitals in the same period in a 1 : 1 ratio. The inclusion criteria of controls were as follows: (1) signed informed consent; (2) gestational age ≥37 weeks; and (3) maternal age ≥18 years. Exclusion criteria are as follows: (1) missing maternal age; (2) missing gestational age; (3) and chronic diseases such as diabetes, hypertension, and heart disease. The flowchart of the study is shown in Figure1.Figure 1
Workflow of this study.


### 2.2. Feature Processing

Demographic factors (i.e., age), physical examination, blood test (red blood cells (RBC), white blood cell count (WBC), and plateletcrit (PCT)), urine test strip (urine pH, urine WBC, and glycosuria), and gynecological examination (bacterial vaginosis (BV), cleaning degree of vagina (CDV), and vaginal yeast infection (VYI)) were collected in our study. All participants had at least five antenatal check-ups before 27 weeks of gestation. For avoiding the overfitting of the model, variables that were measured multiple times were represented using the mean and mode, depending on the type of variable. With the increase in the gestational age, variables were more influence on the outcome. Therefore, we gave more weight to the later data. The equation is defined as(1)varmean20=averagevarweek1,varweek2,…,varweek20,(2)varmeani=averagevarmeani−2,varweeki−1,varweeki,i=22,24,26,27weeks of gestation.As shown in Figure2, the variable processing process at each time point is determined by the values of the previous time point and the current time point. The dataset was divided into five datasets (20 weeks, 22 weeks, 24 weeks, 26 weeks, and 27 weeks of gestation dataset), according to the time of prenatal examination.Figure 2
Preprocessing of variables.varweeki is the measurement result of the variable in week i; varmean20 is the composite indicator representing the variable 20 weeks ago.


### 2.3. Machine Learning Algorithms

In this study, six algorisms, including Naive Bayesian (NBM), support vector machine (SVM), random forest tree (RF), artificial neural networks (ANN), K-means, and logistic regression, were used to predict PTB (Figure3).Figure 3
Classifiers used in this study. (1) Naive Bayesian (NBM): Naive Bayes calculates the posterior probabilityPB|A from PA, PB and PB|A; PB|A is the posterior probability of class B and PA is the prior probability of predictor A and PB is the prior probability of class, and PB|A is the probability of the predictor for the particular class. (2) Support Vector Machine (SVM); SVM outputs a hyperplane wTx+b=0 that best separates the classes and has the largest separation of geometrical separations. (3) Logistic regression: The principle of logistic regression is to use a logistic function to map the results of linear regression between 0 and 1; X is the input features, and β is the weight of the features. PY=1 is the predicted probability of class 1. (4) Artificial Neural Networks (ANN): An artificial neural network consists of an input layer, a hidden layer, and an output layer, and its core component is an artificial neuron. Each neuron is summed by several other neurons multiplied by weights; xi is the input features. (5) K-means: The K-Means algorithm minimizes the squared error for cluster Ci; x is the unclassified sample, and Ci is the clusters, and ui is the mean vector of clusters Ci. (6) Random Forest Tree (RF): Random forest is an algorithm that integrates multiple decision trees through the Bagging idea of ensemble learning. The principle of random forest bagging is to vote the classification results of several weak classifiers to form a strong classifier.


### 2.4. Outcome Measure

In this study, 4 metrics were used to measure the predictive performance of the model: accuracy, area under the receiver operating characteristic curve (AUC), sensitivity, and specificity. The accuracy is the proportion of correct predictions among the total number of cases examined (1). Sensitivity refers to the test’s ability to correctly detect true positive (2). Specificity relates to the test’s ability to correctly detect true negative (4). AUC is a comprehensive measure of the sensitivity and specificity of the model:(3)accuracy=TP+TNTP+TN+FP+FN,(4)sensitivity=TPTP+FN,(5)specificity=TNTN+FP.TP = true positive; FP = false positive; TN = true negative; FN = false negative.


### 2.5. Statistical Analysis

The Kolmogorov–Smirnov test was used to test the normality of continuous variable. If the variable satisfies normal distribution, the mean ± standard deviation was used to describe the continuous variable. Categorical variables were shown as numbers and percentages. Because our data were collected from electronic medical records, there were missing values in the dataset. Therefore, we excluded cases and variables that were missing more than 10%. For categorical variables, mode was used to fill, and for continuous variables, mean was used to fill. Comparison between the outcome groups was made by the chi-square test or Fisher’s exact test for categorical variables and by thet-test or Wilcoxon test for continuous variables.The dataset was randomly divided into a training set (70%) and a test set (30%). The training set was used to train the model, and the test set was used to evaluate the model. Four indicators, the area under the curve (AUC), accuracy, sensitivity, and specificity, were used to measure the performance of the model. The importance of a variable was assessed by the decreased accuracy of the model after removing the variable. The higher the decreased accuracy of the model, the more important the variable. All statistical analyses were performed in R software (version 3.5.1) using the “e1071” (Naive Bayesian algorithm and support vector machine), “randomForest” (random forest tree), and “kknn” (K-means) packages. For all analyses, if the two-tailedP value <0.05, the result was considered statistically significant.


### 2.6. Statement of Ethics

Ethics approval of this research was approved by the Institutional Research Review Board at National Research Institute for Family Planning and performed in accordance with the ethical standards laid down in the 1964 Declaration of Helsinki and its later amendments.


## 2.1. Participants

Data for this study were reviewed from 2008 to 2018. All the participants included in this study were collected from Haidian Maternal & Child Health Hospital. The inclusion criteria of the PTB group were as follows: (1) signed informed consent; (2) gestational age between 28 and 37 weeks; and (3) maternal age older than 18 years. The exclusion criteria of the PTB group are as follows: (1) missing maternal age; (2) missing gestational age; and (3) chronic diseases such as diabetes, hypertension, and heart disease. Controls were selected from hospitals in the same period in a 1 : 1 ratio. The inclusion criteria of controls were as follows: (1) signed informed consent; (2) gestational age ≥37 weeks; and (3) maternal age ≥18 years. Exclusion criteria are as follows: (1) missing maternal age; (2) missing gestational age; (3) and chronic diseases such as diabetes, hypertension, and heart disease. The flowchart of the study is shown in Figure1.Figure 1
Workflow of this study.


## 2.2. Feature Processing

Demographic factors (i.e., age), physical examination, blood test (red blood cells (RBC), white blood cell count (WBC), and plateletcrit (PCT)), urine test strip (urine pH, urine WBC, and glycosuria), and gynecological examination (bacterial vaginosis (BV), cleaning degree of vagina (CDV), and vaginal yeast infection (VYI)) were collected in our study. All participants had at least five antenatal check-ups before 27 weeks of gestation. For avoiding the overfitting of the model, variables that were measured multiple times were represented using the mean and mode, depending on the type of variable. With the increase in the gestational age, variables were more influence on the outcome. Therefore, we gave more weight to the later data. The equation is defined as(1)varmean20=averagevarweek1,varweek2,…,varweek20,(2)varmeani=averagevarmeani−2,varweeki−1,varweeki,i=22,24,26,27weeks of gestation.As shown in Figure2, the variable processing process at each time point is determined by the values of the previous time point and the current time point. The dataset was divided into five datasets (20 weeks, 22 weeks, 24 weeks, 26 weeks, and 27 weeks of gestation dataset), according to the time of prenatal examination.Figure 2
Preprocessing of variables.varweeki is the measurement result of the variable in week i; varmean20 is the composite indicator representing the variable 20 weeks ago.


## 2.3. Machine Learning Algorithms

In this study, six algorisms, including Naive Bayesian (NBM), support vector machine (SVM), random forest tree (RF), artificial neural networks (ANN), K-means, and logistic regression, were used to predict PTB (Figure3).Figure 3
Classifiers used in this study. (1) Naive Bayesian (NBM): Naive Bayes calculates the posterior probabilityPB|A from PA, PB and PB|A; PB|A is the posterior probability of class B and PA is the prior probability of predictor A and PB is the prior probability of class, and PB|A is the probability of the predictor for the particular class. (2) Support Vector Machine (SVM); SVM outputs a hyperplane wTx+b=0 that best separates the classes and has the largest separation of geometrical separations. (3) Logistic regression: The principle of logistic regression is to use a logistic function to map the results of linear regression between 0 and 1; X is the input features, and β is the weight of the features. PY=1 is the predicted probability of class 1. (4) Artificial Neural Networks (ANN): An artificial neural network consists of an input layer, a hidden layer, and an output layer, and its core component is an artificial neuron. Each neuron is summed by several other neurons multiplied by weights; xi is the input features. (5) K-means: The K-Means algorithm minimizes the squared error for cluster Ci; x is the unclassified sample, and Ci is the clusters, and ui is the mean vector of clusters Ci. (6) Random Forest Tree (RF): Random forest is an algorithm that integrates multiple decision trees through the Bagging idea of ensemble learning. The principle of random forest bagging is to vote the classification results of several weak classifiers to form a strong classifier.


## 2.4. Outcome Measure

In this study, 4 metrics were used to measure the predictive performance of the model: accuracy, area under the receiver operating characteristic curve (AUC), sensitivity, and specificity. The accuracy is the proportion of correct predictions among the total number of cases examined (1). Sensitivity refers to the test’s ability to correctly detect true positive (2). Specificity relates to the test’s ability to correctly detect true negative (4). AUC is a comprehensive measure of the sensitivity and specificity of the model:(3)accuracy=TP+TNTP+TN+FP+FN,(4)sensitivity=TPTP+FN,(5)specificity=TNTN+FP.TP = true positive; FP = false positive; TN = true negative; FN = false negative.


## 2.5. Statistical Analysis

The Kolmogorov–Smirnov test was used to test the normality of continuous variable. If the variable satisfies normal distribution, the mean ± standard deviation was used to describe the continuous variable. Categorical variables were shown as numbers and percentages. Because our data were collected from electronic medical records, there were missing values in the dataset. Therefore, we excluded cases and variables that were missing more than 10%. For categorical variables, mode was used to fill, and for continuous variables, mean was used to fill. Comparison between the outcome groups was made by the chi-square test or Fisher’s exact test for categorical variables and by thet-test or Wilcoxon test for continuous variables.The dataset was randomly divided into a training set (70%) and a test set (30%). The training set was used to train the model, and the test set was used to evaluate the model. Four indicators, the area under the curve (AUC), accuracy, sensitivity, and specificity, were used to measure the performance of the model. The importance of a variable was assessed by the decreased accuracy of the model after removing the variable. The higher the decreased accuracy of the model, the more important the variable. All statistical analyses were performed in R software (version 3.5.1) using the “e1071” (Naive Bayesian algorithm and support vector machine), “randomForest” (random forest tree), and “kknn” (K-means) packages. For all analyses, if the two-tailedP value <0.05, the result was considered statistically significant.


## 2.6. Statement of Ethics

Ethics approval of this research was approved by the Institutional Research Review Board at National Research Institute for Family Planning and performed in accordance with the ethical standards laid down in the 1964 Declaration of Helsinki and its later amendments.


## 3. Results

### 3.1. Characteristics of Pregnant Women and Newborns

A total 9550 of pregnant women (PTB: 4775, control: 4775) were included in our study. The mean ages of the PTB group were lower than those of the control group (PTB: 29.94 ± 5.39), control: 30.72 ± 4.00,P<0.001). The gestation of pregnant women was 251.19 ± 11.51 days in the case group and 274.66 ± 7.15 days in the control group P<0.001. The gravidity and parity of pregnant women in the PTB group were lower than those in the control group (all P<0.001). The weight and height of newborns in the control group were higher than those in the PTB group (all P<0.001). The Apgar scores (1, 5, and 10 minutes) of newborns in the control group were higher than those in the case group (all P<0.001). The characteristics of pregnant women and newborns were summarized in Table 1.Table 1
Characteristics of mother and newborn between PTB and control group.
VariablesControl (4775)Case (4775)t/chiPAge, years30.72 ± 4.0029.94 ± 5.398.00<0.001Gestation, days274.66 ± 7.15251.19 ± 11.51119.70<0.001Gravidity13437 (0.72)3644 (0.76)25.08<0.0012–31240 (0.26)1063 (0.22)25.08<0.001>398 (0.02)68 (0.01)25.08<0.001Parity14006 (0.84)4176 (0.87)24.37<0.001>2769 (0.16)599 (0.13)24.37<0.001Multiple birthNo4763 (1.00)4284 (0.90)479.50<0.001Yes12 (0.00)491 (0.10)479.50<0.001Birth genderMale2464 (0.52)2659 (0.56)15.85<0.001Female2311 (0.48)2116 (0.44)15.85<0.001Birth weight, g3410.68 ± 402.052691.13 ± 544.9073.43<0.001Birth height, cm50.38 ± 1.2547.85 ± 2.8256.81<0.001Apgar scores (1 min)9.95 ± 0.719.70 ± 1.3711.19<0.001Apgar scores (5 min)10.00 ± 0.669.82 ± 1.208.97<0.001Apgar scores (10 min)9.95 ± 0.549.77 ± 1.328.68<0.001PTB: preterm birth.


### 3.2. Prenatal Testing of Pregnant Women before 27 Weeks of Gestation

In the biochemical analysis, albumin, aspartate transaminase (AST), total serum iron (TSI), magnesium (Mg), and triglycerides (TG) levels were higher in the PTB group than those in the control group (allP<0.05). Meanwhile, the plasma glucose (fasting) is lower in the PTB group than that in the control group (all P<0.05). Total biliary acid (TBA) and urea levels were higher in the PTB group than those in the control group (all P<0.05). Platelet, intermediate cell, lymphocyte (LY), monocytes (MO), neutrophil granulocytes (NE), red blood cell distribution width-SD (RDW-SD), and WBC levels were higher in the PTB group than those in the control group. Mean cell hemoglobin (MCH), mean corpuscular hemoglobin concentration (MCHC), and platelet distribution width (PDW) were lower in the PTB group than those in the control group. Waist size, fundal height, SBP, and DBP were higher in the PTB group than those in the control group. Fetal heart rate (FHR) in the PTB group was slower than that in the control group. Urine PH was higher in the PTB group than those in the control group. Pregnant women with blood type B were found to be more common in the case group than in the control group (Table 2). The results of prenatal testing at several other time points (20, 22, 24, and 26 weeks of gestation) were described in Supplementary Tables S1–S4.Table 2
Prenatal testing of pregnant women before 27 weeks of gestation between PTB and control group.
VariablesControl (4775)Case (4775)t/chiPPhysical examinationWaist size, cm82.68 ± 14.1983.30 ± 13.74−2.170.030Fundal height, cm20.57 ± 3.6220.90 ± 3.84−4.33<0.001SBP, mmHg112.09 ± 10.26113.34 ± 10.44−5.86<0.001DBP, mmHg69.47 ± 7.7270.71 ± 16.09−4.82<0.001FHR, times/min145.50 ± 3.05146.46 ± 17.27−3.78<0.001Weight, kg63.16 ± 9.1563.04 ± 9.390.600.549EdemaNo4759 (1.00)4747 (0.99)2.760.096Yes16 (0.00)28 (0.01)Blood testBGA1238 (0.26)1063 (0.22)128.27<0.001B1571 (0.33)2106 (0.44)AB484 (0.10)417 (0.09)O1482 (0.31)1189 (0.25)Blood RHNe24 (0.01)15 (0.00)1.650.199Po4751 (0.99)4760 (1.00)ALB, g/L41.24 ± 3.4641.45 ± 2.75−3.200.001ALT, U/L20.65 ± 14.0521.02 ± 13.69−1.280.199AST, U/L20.91 ± 7.8122.14 ± 7.72−7.74<0.001Glu, mmol/L4.57 [4.25, 4.93]4.56 [4.23, 4.72]<0.001Ca, mmol/L2.30 ± 0.142.31 ± 0.12−1.360.174Cr, umol/L50.86 ± 7.6151.17 ± 8.25−1.920.055DB, umol/L1.72 [1.10, 2.30]1.74 [1.43, 1.90]0.594TSI, umol/L17.44 ± 3.3317.60 ± 2.63−2.610.009GLOB, g/L27.28 ± 3.3227.24 ± 2.430.730.466Mg, mmol/L0.87 ± 0.130.88 ± 0.09−4.43<0.001IP, mmol/L1.25 ± 0.151.25 ± 0.12−1.610.108TBA, umol/L3.83 [2.90, 5.10]4.90 [3.32, 5.01]<0.001TB, umol/L11.28 ± 3.5311.18 ± 2.641.670.095CHOL, mmol/L4.78 ± 0.734.80 ± 0.38−1.660.096TP, g/L68.76 ± 4.8468.78 ± 3.55−0.220.829TG, mmol/L1.52 ± 0.541.58 ± 0.41−6.57<0.001Urea, mmol/L2.80 [2.38, 3.28]2.84 [2.40, 3.10]0.002UA, umol/L199.75 ± 40.26198.22 ± 39.371.880.060BA, 10e9/L0.01 ± 0.030.01 ± 0.05−1.010.314Plt, 10e9/L220.31 ± 48.25224.52 ± 48.60−4.25<0.001EOS, 10e9/L0.09 ± 0.090.09 ± 0.070.430.665Hb, g/L117.98 ± 8.56117.69 ± 8.591.620.105MID, 10e9/L0.55 ± 0.100.56 ± 0.12−4.51<0.001LY, 10e9/L1.72 ± 0.401.75 ± 0.41−2.920.004MCH, pg31.49 ± 1.9131.33 ± 1.854.15<0.001MCHC, g/L344.87 ± 10.25343.39 ± 10.526.95<0.001MCV, fL91.31 ± 4.7291.24 ± 4.500.760.445MO, 10e9/L0.53 ± 0.140.54 ± 0.14−4.33<0.001MPV, fL8.58 ± 1.108.60 ± 1.09−1.070.283NE, 10e9/L7.23 ± 1.697.36 ± 1.72−3.60<0.001P-LCR, %0.23 ± 0.050.23 ± 0.055.83<0.001HCT, %0.34 ± 0.020.35 ± 0.25−1.180.238PCT, %0.19 ± 0.040.19 ± 0.03−0.230.819PDW, %15.16 ± 2.2514.83 ± 2.516.75<0.001RDW-CV, %0.16 ± 0.510.16 ± 0.350.810.416RDW-SD, fL42.84 ± 2.4643.45 ± 2.12−13.07<0.001RBC, 10e12L3.76 ± 0.313.77 ± 0.32−1.510.131WBC, 10e9/L9.58 ± 1.939.74 ± 1.97−3.93<0.001Urine test stripUrine pH6.67 ± 0.466.73 ± 0.46−6.77<0.001USG1.02 ± 0.011.02 ± 0.014.96<0.001BILNe4737 (0.99)4749 (0.99)1.900.168Po38 (0.01)26 (0.01)GlycosuriaNe3780 (0.79)3820 (0.80)0.980.322Po995 (0.21)955 (0.20)KETNe4593 (0.96)4589 (0.96)0.030.873Po182 (0.04)186 (0.04)NitrituriaNe4728 (0.99)4740 (0.99)1.490.222Po47 (0.01)35 (0.01)BloodNe4322 (0.91)4397 (0.92)7.220.007Po453 (0.09)378 (0.08)ProteinuriaNe4729 (0.99)4698 (0.98)7.410.006Po46 (0.01)77 (0.02)BilirubinuriaNe4758 (1.00)4755 (1.00)0.110.742Po17 (0.00)20 (0.00)Urine WBCNe3490 (0.73)3475 (0.73)0.100.747Po1285 (0.27)1300 (0.27)Gynecological examinationBVNe4678 (0.98)4719 (0.99)10.630.001Po97 (0.02)56 (0.01)CDV1854 (0.18)975 (0.20)60.20<0.00122904 (0.61)3066 (0.64)3845 (0.18)590 (0.12)4172 (0.04)144 (0.03)VYINe4499 (0.94)4549 (0.95)5.050.025Po276 (0.06)226 (0.05)ALB: serum albumin; ALT: alanine transaminase; AST: aspartate transaminase; BA: basophil granulocytes; BG: blood group; BIL: urine bilirubin; Blood RH: blood RH; BV: bacterial vaginosis; Ca: total calcium; CDV: cleaning degree of vagina, The higher the value, the worse the cleanliness; CHOL: total cholesterol; Cr: creatinine; DB: direct bilirubin; DBP: diastolic blood pressure; EOS: eosinophil granulocytes; FHR: fetal heart rate; GLOB: globulins; Glu: plasma glucose (fasting); Hb: hemoglobin; HCT: hematocrit; IP: serum inorganic phosphorus; KET: urine ketone bodies; LY: lymphocytes; MCH: mean cell hemoglobin; MCHC: mean corpuscular hemoglobin concentration; MCV: mean cell volume; Mg: magnesium; MID: intermediate cell; MO: monocytes; MPV: mean platelet volume; NE: neutrophil granulocytes; PCT: plateletcrit; PDW: platelet distribution width; P-LCR: mean platelet volume; Plt: platelet count; RBC: red blood cells; RDW-CV: red blood cell distribution width-CV; RDW-SD: red blood cell distribution width-CV; SBP: systolic blood pressure; TB: total bilirubin; TBA: total biliary acid; TG: triglycerides; TP: total protein; TSI: total serum iron; UA: uric acid; Urea: urea; Urine WBC: urine white blood cell; USG: urine specific gravity; VYI: vaginal yeast infection; WBC: white blood cell count; PTB: preterm birth. Variables that are not normally distributed were expressed as p50 [p25, p75].


### 3.3. Performance of Prediction Models

Six algorithms (NBM, SVM, RF, ANN, K-means, and logistic regression) were used to build the model based on five datasets (20, 22, 24, 26, and 27 weeks of gestation).Table3 depicts the performance of the six types of models. The results showed that the AUC and the accuracy of the RF model based on 27 weeks of gestation were the highest compared with other algorithms (accuracy: 0.816; AUC = 0.885, 95% (confidence interval) CI: 0.873–0.897). The sensitivity and specificity of the RF model based on 27 weeks of gestation were 0.751 and 0.882. Meanwhile, there was positive association between the accuracy and AUC of the RF model and gestational age (Figure 4). The sensitivity of the NBM model based on 24 weeks of gestation was 0.837, but the specificity was only 0.515. The specificity of the NBM model based on 26 weeks of gestation was 0.946, but the sensitivity was only 0.328. The receiver operating characteristic (ROC) curve of the models is shown in Figure 5.Table 3
The performance of models in the test set.
ModelsAccuracyAUC (95% CI)SensitivitySpecificityDataset 1SVM0.7200.791 (0.771–0.811)0.7100.731RF0.7770.861 (0.841–0.871)0.7200.840NBM0.6770.741 (0.721–0.761)0.7050.646ANN0.6340.691 (0.671–0.711)0.6870.576K-means0.6110.681 (0.661–0.701)0.7940.412Log0.6100.701 (0.681–0.721)0.3780.861Dataset 2SVM0.7210.791 (0.781–0.811)0.7220.721RF0.7940.871 (0.851–0.881)0.7560.832NBM0.6820.771 (0.751–0.791)0.7850.581ANN0.6660.731 (0.711–0.751)0.5950.738K-means0.6020.681 (0.671–0.701)0.8110.393Log0.6060.701 (0.681–0.721)0.3640.847Dataset 3SVM0.7190.801 (0.781–0.811)0.6950.743RF0.8060.881 (0.871–0.901)0.7650.846NBM0.6740.791 (0.771–0.811)0.8370.515ANN0.7330.801 (0.791–0.821)0.7410.726K-means0.6120.711 (0.691–0.731)0.8240.405Log0.6330.701 (0.681–0.721)0.4210.839Dataset 4SVM0.7190.791 (0.781–0.811)0.6780.763RF0.8070.881 (0.871–0.891)0.7430.875NBM0.6260.741 (0.721–0.761)0.3280.946ANN0.7320.811 (0.801–0.831)0.7300.734K-means0.6260.721 (0.701–0.741)0.8010.436Log0.6110.701 (0.691–0.721)0.3610.880Dataset 5SVM0.7290.801 (0.781–0.811)0.6850.773RF0.8160.891 (0.871–0.901)0.7510.882NBM0.6220.741 (0.721–0.761)0.3150.937ANN0.7470.811 (0.801–0.831)0.7300.763K-means0.6090.701 (0.681–0.721)0.7800.434Log0.6230.691 (0.671–0.711)0.3910.861NBM: Naive Bayesian; SVM: Support Vector Machine; RF: Random Forest Tree; ANN: Artificial Neural Networks; Log: Logistic regression; Dataset 1: 20 weeks gestation; Dataset 2: 22 weeks gestation; Dataset 3: 24 weeks gestation; Dataset 4: 26 weeks gestation; Dataset 5: 27 weeks gestation. AUC: the area under the curve; CI: confidence interval.Figure 4
AUC (a) and accuracy (b) of models in different gestation times. (NBM: Naive Bayesian; SVM: Support Vector Machine; RF: Random Forest Tree; ANN: Artificial Neural Networks; Log: logistic regression; AUC: the area under the curve).
(a)(b)Figure 5
The ROC curve of the models. (a) Based on 20 weeks of gestation. (b) Based on 22 weeks of gestation. (c) Based on 24 weeks of gestation. (d) Based on 26 weeks of gestation. (e) Based on 27 weeks of gestation.
(a)(b)(c)(d)(e)The importance analysis of the RF model found that the top 10 most important variables were age, magnesium, fundal height, serum inorganic phosphorus, mean platelet volume, waist size, total cholesterol (TC), TG, globulins, and total bilirubin (TB) (Table4). According to the importance of variables, we gradually increase the number of predictors, and the results show that the AUC of the model also increases gradually. The AUC of the model is stable when the number of predictors increases to 15 (Figure 6).Table 4
The top 20 importance variables of RF model.
VariablesDecreased accuracyAge (physical examination)0.0251Magnesium (blood test)0.0098Fundal height (physical examination)0.0077Serum inorganic phosphorus (blood test)0.0038Mean platelet volume (blood test)0.0038Waist size (physical examination)0.0038Total cholesterol (blood test)0.0035Triglycerides (blood test)0.0031Globulins (blood test)0.0024Total bilirubin (blood test)0.0024Neutrophil granulocytes (blood test)0.0024Red blood cell distribution width-SD (blood test)0.0024Bacterial vaginosis (gynecological examination)0.0021Urine bilirubin (urine test strip)0.0021Urine white blood cell (urine test strip)0.0021Diastolic blood pressure (physical examination)0.0014Blood group (blood test)0.0014Parity (physical examination)0.0014Eosinophil granulocytes (blood test)0.0010White blood cell count (blood test)0.0010RF: Random Forest tree.Figure 6
The AUC of the model increases with the number of predictors. (NBM: Naive Bayesian; SVM: Support Vector Machine; RF: Random Forest Tree; ANN: Artificial Neural Networks; Log: logistic regression; AUC: the area under the curve).


## 3.1. Characteristics of Pregnant Women and Newborns

A total 9550 of pregnant women (PTB: 4775, control: 4775) were included in our study. The mean ages of the PTB group were lower than those of the control group (PTB: 29.94 ± 5.39), control: 30.72 ± 4.00,P<0.001). The gestation of pregnant women was 251.19 ± 11.51 days in the case group and 274.66 ± 7.15 days in the control group P<0.001. The gravidity and parity of pregnant women in the PTB group were lower than those in the control group (all P<0.001). The weight and height of newborns in the control group were higher than those in the PTB group (all P<0.001). The Apgar scores (1, 5, and 10 minutes) of newborns in the control group were higher than those in the case group (all P<0.001). The characteristics of pregnant women and newborns were summarized in Table 1.Table 1
Characteristics of mother and newborn between PTB and control group.
VariablesControl (4775)Case (4775)t/chiPAge, years30.72 ± 4.0029.94 ± 5.398.00<0.001Gestation, days274.66 ± 7.15251.19 ± 11.51119.70<0.001Gravidity13437 (0.72)3644 (0.76)25.08<0.0012–31240 (0.26)1063 (0.22)25.08<0.001>398 (0.02)68 (0.01)25.08<0.001Parity14006 (0.84)4176 (0.87)24.37<0.001>2769 (0.16)599 (0.13)24.37<0.001Multiple birthNo4763 (1.00)4284 (0.90)479.50<0.001Yes12 (0.00)491 (0.10)479.50<0.001Birth genderMale2464 (0.52)2659 (0.56)15.85<0.001Female2311 (0.48)2116 (0.44)15.85<0.001Birth weight, g3410.68 ± 402.052691.13 ± 544.9073.43<0.001Birth height, cm50.38 ± 1.2547.85 ± 2.8256.81<0.001Apgar scores (1 min)9.95 ± 0.719.70 ± 1.3711.19<0.001Apgar scores (5 min)10.00 ± 0.669.82 ± 1.208.97<0.001Apgar scores (10 min)9.95 ± 0.549.77 ± 1.328.68<0.001PTB: preterm birth.


## 3.2. Prenatal Testing of Pregnant Women before 27 Weeks of Gestation

In the biochemical analysis, albumin, aspartate transaminase (AST), total serum iron (TSI), magnesium (Mg), and triglycerides (TG) levels were higher in the PTB group than those in the control group (allP<0.05). Meanwhile, the plasma glucose (fasting) is lower in the PTB group than that in the control group (all P<0.05). Total biliary acid (TBA) and urea levels were higher in the PTB group than those in the control group (all P<0.05). Platelet, intermediate cell, lymphocyte (LY), monocytes (MO), neutrophil granulocytes (NE), red blood cell distribution width-SD (RDW-SD), and WBC levels were higher in the PTB group than those in the control group. Mean cell hemoglobin (MCH), mean corpuscular hemoglobin concentration (MCHC), and platelet distribution width (PDW) were lower in the PTB group than those in the control group. Waist size, fundal height, SBP, and DBP were higher in the PTB group than those in the control group. Fetal heart rate (FHR) in the PTB group was slower than that in the control group. Urine PH was higher in the PTB group than those in the control group. Pregnant women with blood type B were found to be more common in the case group than in the control group (Table 2). The results of prenatal testing at several other time points (20, 22, 24, and 26 weeks of gestation) were described in Supplementary Tables S1–S4.Table 2
Prenatal testing of pregnant women before 27 weeks of gestation between PTB and control group.
VariablesControl (4775)Case (4775)t/chiPPhysical examinationWaist size, cm82.68 ± 14.1983.30 ± 13.74−2.170.030Fundal height, cm20.57 ± 3.6220.90 ± 3.84−4.33<0.001SBP, mmHg112.09 ± 10.26113.34 ± 10.44−5.86<0.001DBP, mmHg69.47 ± 7.7270.71 ± 16.09−4.82<0.001FHR, times/min145.50 ± 3.05146.46 ± 17.27−3.78<0.001Weight, kg63.16 ± 9.1563.04 ± 9.390.600.549EdemaNo4759 (1.00)4747 (0.99)2.760.096Yes16 (0.00)28 (0.01)Blood testBGA1238 (0.26)1063 (0.22)128.27<0.001B1571 (0.33)2106 (0.44)AB484 (0.10)417 (0.09)O1482 (0.31)1189 (0.25)Blood RHNe24 (0.01)15 (0.00)1.650.199Po4751 (0.99)4760 (1.00)ALB, g/L41.24 ± 3.4641.45 ± 2.75−3.200.001ALT, U/L20.65 ± 14.0521.02 ± 13.69−1.280.199AST, U/L20.91 ± 7.8122.14 ± 7.72−7.74<0.001Glu, mmol/L4.57 [4.25, 4.93]4.56 [4.23, 4.72]<0.001Ca, mmol/L2.30 ± 0.142.31 ± 0.12−1.360.174Cr, umol/L50.86 ± 7.6151.17 ± 8.25−1.920.055DB, umol/L1.72 [1.10, 2.30]1.74 [1.43, 1.90]0.594TSI, umol/L17.44 ± 3.3317.60 ± 2.63−2.610.009GLOB, g/L27.28 ± 3.3227.24 ± 2.430.730.466Mg, mmol/L0.87 ± 0.130.88 ± 0.09−4.43<0.001IP, mmol/L1.25 ± 0.151.25 ± 0.12−1.610.108TBA, umol/L3.83 [2.90, 5.10]4.90 [3.32, 5.01]<0.001TB, umol/L11.28 ± 3.5311.18 ± 2.641.670.095CHOL, mmol/L4.78 ± 0.734.80 ± 0.38−1.660.096TP, g/L68.76 ± 4.8468.78 ± 3.55−0.220.829TG, mmol/L1.52 ± 0.541.58 ± 0.41−6.57<0.001Urea, mmol/L2.80 [2.38, 3.28]2.84 [2.40, 3.10]0.002UA, umol/L199.75 ± 40.26198.22 ± 39.371.880.060BA, 10e9/L0.01 ± 0.030.01 ± 0.05−1.010.314Plt, 10e9/L220.31 ± 48.25224.52 ± 48.60−4.25<0.001EOS, 10e9/L0.09 ± 0.090.09 ± 0.070.430.665Hb, g/L117.98 ± 8.56117.69 ± 8.591.620.105MID, 10e9/L0.55 ± 0.100.56 ± 0.12−4.51<0.001LY, 10e9/L1.72 ± 0.401.75 ± 0.41−2.920.004MCH, pg31.49 ± 1.9131.33 ± 1.854.15<0.001MCHC, g/L344.87 ± 10.25343.39 ± 10.526.95<0.001MCV, fL91.31 ± 4.7291.24 ± 4.500.760.445MO, 10e9/L0.53 ± 0.140.54 ± 0.14−4.33<0.001MPV, fL8.58 ± 1.108.60 ± 1.09−1.070.283NE, 10e9/L7.23 ± 1.697.36 ± 1.72−3.60<0.001P-LCR, %0.23 ± 0.050.23 ± 0.055.83<0.001HCT, %0.34 ± 0.020.35 ± 0.25−1.180.238PCT, %0.19 ± 0.040.19 ± 0.03−0.230.819PDW, %15.16 ± 2.2514.83 ± 2.516.75<0.001RDW-CV, %0.16 ± 0.510.16 ± 0.350.810.416RDW-SD, fL42.84 ± 2.4643.45 ± 2.12−13.07<0.001RBC, 10e12L3.76 ± 0.313.77 ± 0.32−1.510.131WBC, 10e9/L9.58 ± 1.939.74 ± 1.97−3.93<0.001Urine test stripUrine pH6.67 ± 0.466.73 ± 0.46−6.77<0.001USG1.02 ± 0.011.02 ± 0.014.96<0.001BILNe4737 (0.99)4749 (0.99)1.900.168Po38 (0.01)26 (0.01)GlycosuriaNe3780 (0.79)3820 (0.80)0.980.322Po995 (0.21)955 (0.20)KETNe4593 (0.96)4589 (0.96)0.030.873Po182 (0.04)186 (0.04)NitrituriaNe4728 (0.99)4740 (0.99)1.490.222Po47 (0.01)35 (0.01)BloodNe4322 (0.91)4397 (0.92)7.220.007Po453 (0.09)378 (0.08)ProteinuriaNe4729 (0.99)4698 (0.98)7.410.006Po46 (0.01)77 (0.02)BilirubinuriaNe4758 (1.00)4755 (1.00)0.110.742Po17 (0.00)20 (0.00)Urine WBCNe3490 (0.73)3475 (0.73)0.100.747Po1285 (0.27)1300 (0.27)Gynecological examinationBVNe4678 (0.98)4719 (0.99)10.630.001Po97 (0.02)56 (0.01)CDV1854 (0.18)975 (0.20)60.20<0.00122904 (0.61)3066 (0.64)3845 (0.18)590 (0.12)4172 (0.04)144 (0.03)VYINe4499 (0.94)4549 (0.95)5.050.025Po276 (0.06)226 (0.05)ALB: serum albumin; ALT: alanine transaminase; AST: aspartate transaminase; BA: basophil granulocytes; BG: blood group; BIL: urine bilirubin; Blood RH: blood RH; BV: bacterial vaginosis; Ca: total calcium; CDV: cleaning degree of vagina, The higher the value, the worse the cleanliness; CHOL: total cholesterol; Cr: creatinine; DB: direct bilirubin; DBP: diastolic blood pressure; EOS: eosinophil granulocytes; FHR: fetal heart rate; GLOB: globulins; Glu: plasma glucose (fasting); Hb: hemoglobin; HCT: hematocrit; IP: serum inorganic phosphorus; KET: urine ketone bodies; LY: lymphocytes; MCH: mean cell hemoglobin; MCHC: mean corpuscular hemoglobin concentration; MCV: mean cell volume; Mg: magnesium; MID: intermediate cell; MO: monocytes; MPV: mean platelet volume; NE: neutrophil granulocytes; PCT: plateletcrit; PDW: platelet distribution width; P-LCR: mean platelet volume; Plt: platelet count; RBC: red blood cells; RDW-CV: red blood cell distribution width-CV; RDW-SD: red blood cell distribution width-CV; SBP: systolic blood pressure; TB: total bilirubin; TBA: total biliary acid; TG: triglycerides; TP: total protein; TSI: total serum iron; UA: uric acid; Urea: urea; Urine WBC: urine white blood cell; USG: urine specific gravity; VYI: vaginal yeast infection; WBC: white blood cell count; PTB: preterm birth. Variables that are not normally distributed were expressed as p50 [p25, p75].


## 3.3. Performance of Prediction Models

Six algorithms (NBM, SVM, RF, ANN, K-means, and logistic regression) were used to build the model based on five datasets (20, 22, 24, 26, and 27 weeks of gestation).Table3 depicts the performance of the six types of models. The results showed that the AUC and the accuracy of the RF model based on 27 weeks of gestation were the highest compared with other algorithms (accuracy: 0.816; AUC = 0.885, 95% (confidence interval) CI: 0.873–0.897). The sensitivity and specificity of the RF model based on 27 weeks of gestation were 0.751 and 0.882. Meanwhile, there was positive association between the accuracy and AUC of the RF model and gestational age (Figure 4). The sensitivity of the NBM model based on 24 weeks of gestation was 0.837, but the specificity was only 0.515. The specificity of the NBM model based on 26 weeks of gestation was 0.946, but the sensitivity was only 0.328. The receiver operating characteristic (ROC) curve of the models is shown in Figure 5.Table 3
The performance of models in the test set.
ModelsAccuracyAUC (95% CI)SensitivitySpecificityDataset 1SVM0.7200.791 (0.771–0.811)0.7100.731RF0.7770.861 (0.841–0.871)0.7200.840NBM0.6770.741 (0.721–0.761)0.7050.646ANN0.6340.691 (0.671–0.711)0.6870.576K-means0.6110.681 (0.661–0.701)0.7940.412Log0.6100.701 (0.681–0.721)0.3780.861Dataset 2SVM0.7210.791 (0.781–0.811)0.7220.721RF0.7940.871 (0.851–0.881)0.7560.832NBM0.6820.771 (0.751–0.791)0.7850.581ANN0.6660.731 (0.711–0.751)0.5950.738K-means0.6020.681 (0.671–0.701)0.8110.393Log0.6060.701 (0.681–0.721)0.3640.847Dataset 3SVM0.7190.801 (0.781–0.811)0.6950.743RF0.8060.881 (0.871–0.901)0.7650.846NBM0.6740.791 (0.771–0.811)0.8370.515ANN0.7330.801 (0.791–0.821)0.7410.726K-means0.6120.711 (0.691–0.731)0.8240.405Log0.6330.701 (0.681–0.721)0.4210.839Dataset 4SVM0.7190.791 (0.781–0.811)0.6780.763RF0.8070.881 (0.871–0.891)0.7430.875NBM0.6260.741 (0.721–0.761)0.3280.946ANN0.7320.811 (0.801–0.831)0.7300.734K-means0.6260.721 (0.701–0.741)0.8010.436Log0.6110.701 (0.691–0.721)0.3610.880Dataset 5SVM0.7290.801 (0.781–0.811)0.6850.773RF0.8160.891 (0.871–0.901)0.7510.882NBM0.6220.741 (0.721–0.761)0.3150.937ANN0.7470.811 (0.801–0.831)0.7300.763K-means0.6090.701 (0.681–0.721)0.7800.434Log0.6230.691 (0.671–0.711)0.3910.861NBM: Naive Bayesian; SVM: Support Vector Machine; RF: Random Forest Tree; ANN: Artificial Neural Networks; Log: Logistic regression; Dataset 1: 20 weeks gestation; Dataset 2: 22 weeks gestation; Dataset 3: 24 weeks gestation; Dataset 4: 26 weeks gestation; Dataset 5: 27 weeks gestation. AUC: the area under the curve; CI: confidence interval.Figure 4
AUC (a) and accuracy (b) of models in different gestation times. (NBM: Naive Bayesian; SVM: Support Vector Machine; RF: Random Forest Tree; ANN: Artificial Neural Networks; Log: logistic regression; AUC: the area under the curve).
(a)(b)Figure 5
The ROC curve of the models. (a) Based on 20 weeks of gestation. (b) Based on 22 weeks of gestation. (c) Based on 24 weeks of gestation. (d) Based on 26 weeks of gestation. (e) Based on 27 weeks of gestation.
(a)(b)(c)(d)(e)The importance analysis of the RF model found that the top 10 most important variables were age, magnesium, fundal height, serum inorganic phosphorus, mean platelet volume, waist size, total cholesterol (TC), TG, globulins, and total bilirubin (TB) (Table4). According to the importance of variables, we gradually increase the number of predictors, and the results show that the AUC of the model also increases gradually. The AUC of the model is stable when the number of predictors increases to 15 (Figure 6).Table 4
The top 20 importance variables of RF model.
VariablesDecreased accuracyAge (physical examination)0.0251Magnesium (blood test)0.0098Fundal height (physical examination)0.0077Serum inorganic phosphorus (blood test)0.0038Mean platelet volume (blood test)0.0038Waist size (physical examination)0.0038Total cholesterol (blood test)0.0035Triglycerides (blood test)0.0031Globulins (blood test)0.0024Total bilirubin (blood test)0.0024Neutrophil granulocytes (blood test)0.0024Red blood cell distribution width-SD (blood test)0.0024Bacterial vaginosis (gynecological examination)0.0021Urine bilirubin (urine test strip)0.0021Urine white blood cell (urine test strip)0.0021Diastolic blood pressure (physical examination)0.0014Blood group (blood test)0.0014Parity (physical examination)0.0014Eosinophil granulocytes (blood test)0.0010White blood cell count (blood test)0.0010RF: Random Forest tree.Figure 6
The AUC of the model increases with the number of predictors. (NBM: Naive Bayesian; SVM: Support Vector Machine; RF: Random Forest Tree; ANN: Artificial Neural Networks; Log: logistic regression; AUC: the area under the curve).


## 4. Discussion

In this study, six algorithms were used to establish the prediction model of premature birth in the early stage of gestation. The overall prediction effect of the RF model was better than that of other models. We also found that the predictive power of the RF model increased with the increase of gestational age. Age, magnesium, fundal height, serum inorganic phosphorus, mean platelet volume, waist size, TC, TG, globulins, and TB were found to be the main influencing factors of preterm birth.In our study, we used the data from the production inspection to build the model based on the machine learning algorithm. The prediction performance of the model was relatively good, and the cost of the model was low. Ramkumar et al. using multivariate adaptive regression splines established a prediction model based on biomarkers (including IL-1RA, TNF-α, angiopoietin 2, TNFRI, IL-5, MIP1α, IL-1β, and TGF-α), resulting in a high AUC (train set: 0.82–0.98, test set: 0.66–0.86) [25]. Teresa et al. used cervical length at admission, gestational age, amniotic fluid glucose, and interleukin-6 to establish a prediction model, resulting in a high AUC (0.86, 95% CI: 0.77–0.95) [26]. Thuy et al. found that nine cell-free RNA could be used to predict gestational age and preterm delivery, and the AUCs of preterm delivery were 0.86 in the discovery cohort and 0.81 in the validation cohort [27]. In these studies, the prediction performance of the preterm birth model was better, but another clinical test was needed and expensive. Kamala et al. used a combination of neighborhood socioeconomic status and individual status to predict preterm birth, but the AUC (0.75) of the model was relatively low [28]. Liu et al. found that cervical elastography could be used as a predictive indicator, and the AUC of the model was 0.73 [29]. The above studies used a traditional biological algorithm, such as logistic regression, to build the model, but the predictive power of the model is relatively low.In this study, the results of the numerical experiments show that the AUC of SVM, RF, and ANN models were higher than logistic, NBM, and k-means. The possible reason for the low AUC of the NBM model is that the NBM model assumes that features are independent of each other, which is often not true in practice. For logistic regression and k-means algorithms, they were susceptible to outliers and noise that reduce prediction accuracy. For the other 3 machine algorithms, the AUC value of the RF model was the highest. The RF model is an ensemble learning method, which constructs a multitude of decision trees at training time and then sets up the trees to give the classification [30]. This ensemble strategy makes several weak classifiers form a strong classifier to improve the predictive ability of the model. In a recent study, the RF algorithm had also achieved a good predictive effect in fatty liver disease [31], suggesting that the RF algorithm had advantages in the processing of clinical electronic medical records. Moreover, we found that the prediction performance of RF was the best at 27 weeks of gestation. This may be due to alternation of biochemical indexes in pregnant women as delivery approached. The AUC of the model based on random forest in 20 weeks of gestation was 0.855 (95% CI: 0.841–0.869), suggesting that interventions could be performed before these biochemical indicators change.In the importance analysis of the RF model, we found that age was the greatest effect on preterm birth. A case-control study showed that premature delivery was associated with greater maternal age [32]. We also found that serum magnesium had a great influence on the results of the model. A double-blind study suggested that magnesium supplementation during pregnancy is associated with a reduction in preterm delivery [33]. Maternal fundal height was found to be a valuable predictor for PTB in our study. Previous study used maternal fundal height to predict fetal weight [34], suggesting that fundal height was a good predictor for PTB. The measurement of fundal height is susceptible to measurement personnel, which may limit its clinical use. Della Rosa et al. used 9 most informative predictors to build a preterm birth prediction model, and the AUC of the model reached 0.812 [35]. Our results show that using only 15 predictions can achieve better model predictions. Considering the cost effect, this result has important implications for guiding clinical practice.There were some limitations in our study. First, our dataset, collection from electronic medical records, and lack of some data such as smoking, drinking, family income, method of conception, medication, and fetal fibronectin. The absence of these factors may underperform our model. Second, previous studies found that the conception method has an important effect on preterm birth [36, 37], but it was not included in our model, which may affect the prediction accuracy of our model. Third, controls of the study were matched 1 : 1 from contemporaneous hospitals, which may overestimate the performance of the model and may limit the use of the model to a normal proportion of the population.


## 5. Conclusions

Our results indicated that the prediction model based on the RF algorithm had a potential value to predict preterm birth early stage of pregnancy. The RF model also found the main influence factors of PTB, suggesting that intervention in the early stages of pregnancy could decrease the risk of preterm birth.



---

*Source: 9635526-2022-04-13.xml*