Method and system for predicting pregnancy loss risk of recurrent abortion patient based on Internet hospital
By acquiring and cleaning data on the Internet hospital platform, the pregnancy loss risk prediction model for patients with recurrent miscarriage is constructed using LASSO regression and cross-validation methods, which solves the problem of low prediction accuracy in the existing technology, and achieves more accurate risk prediction and more efficient medical services.
Patent Information
- Application Number
- CN202411717733.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
In the prior art, the pregnancy loss risk prediction model of patients with recurrent miscarriage is not accurate and cannot effectively simulate the complex, multidimensional and nonlinear relationship in biological systems.
Using an Internet hospital-based method, by acquiring and cleaning risk prediction data, selecting feature variables using LASSO regression, calculating correlation coefficient matrix, and deleting feature variables with high correlation, building multiple algorithm models and performing 10-fold cross-validation to obtain the optimal parameter model for prediction.
A more accurate prediction of the risk of pregnancy loss in patients with recurrent miscarriage has been achieved, the efficiency of medical services has been improved, and high-risk groups can be better identified and appropriate diagnosis and treatment strategies can be formulated.
Smart Images

Figure CN119650061A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical prediction, and in particular to a method and system for predicting pregnancy loss risk of patients with recurrent miscarriage based on an Internet hospital. Background Art
[0002] Due to the complex and diverse etiology of recurrent spontaneous abortion (RSA) and the lack of standardized diagnostic and treatment methods, the clinical management of RSA faces great difficulties and challenges. Accurately predicting the risk of pregnancy loss in RSA is conducive to identifying high-risk populations, so as to make more accurate judgments on the pregnancy outcomes of patients and develop more suitable diagnosis and treatment strategies for patients with risk factors. In the past, the prediction of RSA pregnancy outcomes was mostly based on logistic regression models. The traditional logistic regression model is mainly based on linear assumptions and evaluates the importance of variable features by the size of the coefficient of the feature. Although the logistic regression model parameters are highly interpretable, they are too simple and may not be able to simulate the complex, multidimensional and nonlinear relationships between different variables that may exist in biological systems, so the predictive efficiency has great limitations.
[0003] Due to the evolution of the definition of RSA in recent years, differences in demographic characteristics and new findings in etiology research, simple logistic regression models cannot simulate the actual situation of RSA patients well. Therefore, it is necessary to develop a more accurate new prediction model for RSA pregnancy loss risk that can handle the association between potential nonlinear variables. Summary of the invention
[0004] The main purpose of the present invention is to solve the technical problem that the prediction model in the prior art is not accurate enough. A method for predicting the risk of pregnancy loss in patients with recurrent miscarriage based on an Internet hospital comprises the following steps:
[0005] Based on the Internet hospital, risk prediction data is obtained and divided into a test set and a training set.
[0006] Perform data cleaning on risk prediction data;
[0007] Using LASSO regression, select variables with non-zero LASSO regression coefficients as feature variables, calculate the feature variable correlation coefficient matrix, and delete feature variables with high correlation;
[0008] According to the selected characteristic variables, multiple algorithm models are constructed, the algorithm models are trained, and the model performance is evaluated by 10-fold cross validation to obtain the optimal parameter model;
[0009] The optimal parameter model was used to predict the risk of pregnancy loss in patients with recurrent spontaneous abortion.
[0010] The second aspect of the present invention provides a pregnancy loss risk prediction system for recurrent miscarriage patients based on an Internet hospital, comprising:
[0011] An acquisition module is used to acquire risk prediction data based on Internet hospitals and divide the risk prediction data into a test set and a training set;
[0012] Cleaning module, used to clean risk prediction data;
[0013] The feature variable selection module is used to adopt LASSO regression, select variables with non-zero LASSO regression coefficients as feature variables, calculate the feature variable correlation coefficient matrix, and delete feature variables with high correlation;
[0014] The model training module is used to construct multiple algorithm models according to the selected feature variables, train the algorithm models, evaluate the model performance by using 10-fold cross validation, and obtain the optimal parameter model;
[0015] The model prediction module is used to predict the risk of pregnancy loss for patients with recurrent spontaneous abortion using the optimal parameter model.
[0016] A third aspect of the present invention provides an electronic device, comprising: a memory and at least one processor, wherein instructions are stored in the memory, and the memory and the at least one processor are interconnected via lines; the at least one processor calls the instructions in the memory so that the electronic device executes the above-mentioned method for predicting pregnancy loss risk in patients with recurrent miscarriage based on an Internet hospital.
[0017] A fourth aspect of the present invention provides a computer-readable storage medium, which stores instructions that, when executed on a computer, enable the computer to execute the above-mentioned method for predicting pregnancy loss risk for recurrent miscarriage patients based on an Internet hospital.
[0018] The present invention has the following beneficial effects:
[0019] The present invention utilizes the real and comprehensive medical data of RSA patients and adopts 10 ML algorithms to establish a prediction model for predicting the pregnancy outcomes of RSA patients. At the same time, the prediction performance of different models is compared to screen out the optimal prediction model.
[0020] The Internet hospital platform of the present invention realizes remote collection and real-time transmission of data. Doctors can quickly obtain risk prediction reports of patients through the platform, formulate and adjust treatment plans in a timely manner, and improve the efficiency of medical services.
[0021] The present invention utilizes the Internet hospital platform, combined with the hospital information system (HIS) and the electronic medical record system (EMR), to automatically capture key information such as the patient's past medical history, treatment records, examination results, etc., and seamlessly integrates it with real-time monitoring data for more accurate risk assessment. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A flow chart of a method for predicting pregnancy loss risk for patients with recurrent miscarriage based on an Internet hospital provided in an embodiment;
[0023] Figure 2 The standardized box plots for the characteristic variables of the training set and the test set, where A is the training set; B is the test set; the upper edge of each variable box represents the upper quartile of the data, and the lower edge represents the lower quartile of the data; the red line in the middle of the box represents the median of the data; the length of the box represents the interquartile range of the data; the points outside the box represent outliers in the data; the blue solid line is the overall 10 times standard deviation line, and the points outside the two blue lines are outliers;
[0024] Figure 3 The following is a graph showing the variation of the LASSO regression variable coefficient with the penalty intensity of the training set; the horizontal axis is the penalty coefficient (alpha), and the vertical axis is the variable coefficient. Each feature variable corresponds to a colored curve. As the penalty intensity (alpha) increases, the variable coefficient gradually tends to become sparse (becomes zero).
[0025] Figure 4 It is the LASSO regression cross-validation graph of the training set; the dotted lines represent the mean square error (MSE) path under different alpha values for each fold, the black solid line is the average of 10 folds, and the black dotted line perpendicular to the X-axis is the best alpha value estimated by cross-validation;
[0026] Figure 5 This is the ROC curve of the 10-fold cross validation of the 10 models in the training set;
[0027] Figure 6-8 It is a line graph of the evaluation indicators of the ten models of the training set, which are cross-validated 10 times for 6 times; the upper figure in the figure is a line graph of the mean of the five rating indicators of the ten models, which are cross-validated 10 times for 6 times; the lower figure is a line graph of the variance of the five rating indicators of the ten models, which are cross-validated 10 times for 6 times;
[0028] Fig. 9 This is the ROC curve of the random forest model on the test set after parameter tuning. DETAILED DESCRIPTION
[0029] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 In the embodiment of the present invention, the embodiment of the method for predicting the risk of pregnancy loss in patients with recurrent spontaneous abortion based on an Internet hospital includes:
[0030] Data Collection
[0031] Medical history was collected at the initial visit, laboratory indicators and uterine local hemodynamic ultrasound examination results were queried and collected through the outpatient medical record system, and regular outpatient follow-up was performed after pregnancy until 32 weeks of pregnancy. This study only collected the first pregnancy outcome after the initial visit. If the patient had a pregnancy outcome event, the follow-up was terminated and included in the study; if the patient had no pregnancy outcome event by the end of the follow-up (i.e., August 31, 2023), he / she was not included in this study. Biochemical pregnancy, spontaneous abortion, stillbirth, etc. that occurred before 28 weeks of pregnancy were considered pregnancy loss. Follow-up to 32 weeks of pregnancy continued pregnancy or delivery between 28 and 32 weeks of pregnancy but the fetus survived was considered a successful pregnancy. EpiData software was used to enter data. The specific research variables are divided into the following 5 parts.
[0032] Basic clinical features
[0033] The data included age, body mass index (BMI), number of previous pregnancy losses, RSA type (including primary and secondary), number of normal embryos in previous miscarriages, chromosome karyotype analysis of the couple, previous medical history (including hyperthyroidism, hypothyroidism, Hashimoto's thyroiditis, diabetes, hypertension, anemia, chronic liver and kidney disease, hepatitis B, polycystic ovary syndrome, luteal insufficiency, insulin resistance, etc.), history of autoimmune diseases (including antiphospholipid syndrome (APS), systemic lupus erythematosus (SLE), undifferentiated connective tissue disease (UCTD), Sjogren's syndrome (SS), rheumatoid arthritis (RA) and systemic sclerosis ( The patients may have a history of cervical insufficiency, such as uterine sclerosis, systemic sclerosis, etc.), a history of thrombotic diseases (including thrombophilia, history of deep vein thrombosis, history of cerebral infarction, etc.), a history of congenital anatomical abnormalities (including uterine septate uterus, arcuate uterus, unicornuate uterus, congenital cervical insufficiency, etc.), an acquired anatomical abnormalities (including uterine adhesions, cervical insufficiency, uterine fibroids, adenomyosis, endometrial polyps, endometriosis and endometriotic cysts, etc.), and a family history of diabetes / hypertension.
[0034] Autoantibodies
[0035] It includes antiphospholipid antibody spectrum (aPLs), antinuclear antibodies (ANA) and thyroid autoantibodies. Among them, aPLs include standard and non-standard aPLs. Standard aPLs include lupus anticoagulant (LA), IgM and IgG anticardiolipin antibodies (aCL), IgM and IgG anti-β2glycoprotein-1 antibodies (aβ2GP1), and non-standard aPLs include aCL IgA, IgM and IgG anti-phosphatidylserine / prothrombin complex antibodies (aPS / PT). ANA includes the qualitative results of ANA total antibody, fluorescent karyotype and titer, extractable nuclear antigen antibodies (ENA) (including anti-Sm antibody, anti-U1RNP antibody, anti-Ro52 antibody, anti-Ro60 antibody, anti-SSB antibody, anti-Jo-1 antibody, anti-PM-Scl antibody, anti-mitochondrial-M2 type antibody, anti-ribosomal P-protein antibody, anti-histone antibody, anti-proliferating cell nuclear antigen antibody, anti-centromere protein B antibody, anti-Scl-70 antibody), and anti-double-stranded deoxyribonucleic acid antibody (anti-dsDNA). Thyroid autoantibodies include thyroid peroxidase antibodies (TPOAb), thyroglobulin antibodies (TGAb), and thyrotropin receptor autoantibodies (TRAb). All autoantibodies were tested at least 23 times before pregnancy (with an interval of 46 weeks). If at least 2 test results were positive, the autoantibody was considered positive and dynamic monitoring was performed during pregnancy.
[0036] Peripheral blood cytokines
[0037] Including interleukin-2 (IL-2), interleukin-4 (IL-4), interleukin-6 (IL-6), interleukin-10 (IL-10), interleukin-17α (IL-17α), tumor necrosis factor-α (TNF-α), and interferon-γ (INF-γ).
[0038] Coagulation function index
[0039] Including thrombin time (TT), prothrombin time (PT), activated partial thromboplastin time (APTT), international normalized ratio (INR), fibrinogen degradation products (FDP), arachidonic acid-induced platelet aggregation (AA-PAgT), adenosinediphosphate-induced platelet aggregation (ADP-PAgT), D-dimer (DD), protein C (PC), protein S (PS), antithrombin III (ATIII) and coagulation factor V (coagulation factor V, FⅤ) activity, homocysteine (HCY), and thromboelastogram (TEG) should be routinely tested at least once before pregnancy and in early pregnancy, and dynamically monitored during pregnancy.
[0040] Endocrine indicators
[0041] It includes six luteal peak hormone indicators (follicle-stimulating hormone (FSH), luteinizing hormone (LH), estradiol (E2), progesterone (P), testosterone (T) and prolactin (PRL)), thyroid function indicators and fasting GLU. Luteal peak hormones are tested 5 to 9 days after ovulation. Thyroid function includes free triiodothyronine (FT3), free thyroxine (FT4) and thyroid-stimulating hormone (TSH).
[0042] Determination of local hemodynamic parameters of uterus
[0043] Including mid-luteal phase endometrial thickness (Emthickness), endometrial artery pulsatility index (Em PI), endometrial artery resistance index (Em RI), endometrial artery systolic / diastolic ratio (EmS / D), the sum of bilateral uterine artery pulsatility index (PI), the sum of bilateral uterine artery resistance indexes (RI), and the sum of bilateral uterine artery systolic / diastolic ratios (S / D).
[0044] Data set partitioning and data cleaning
[0045] The research subjects were stratified sampled according to pregnancy outcomes and the data set was divided into training set and test set in a ratio of 8:2. Ten-fold cross-validation was performed within the training set. More data was used to train the model, which helped the model to better learn the patterns and features of the data. The test set was used to finally evaluate the model performance and ensure the model's generalization ability on unseen data while avoiding problems such as data leakage and overfitting.
[0046] Delete the training set ID number variable, keep the test set ID number, and submit the ID number and prediction result accordingly when predicting. In data analysis, categorical variables need to be converted into numerical variables for modeling and analysis. Categorical variables are encoded independently (One-Hot Encoding) to generate dummy variables, converting a categorical variable with k different values into k binary numerical variables. For each sample, if the classification value of the sample is equal to a certain value, the corresponding binary variable takes the value of 1, otherwise it is 0. This encoding method can help ML models better understand and process categorical variables. The remaining variables are numerical variables and can be analyzed directly. Pregnancy outcome is a response variable and needs to be taken out separately as y. Since y is a categorical variable, we are solving a classification problem. Delete rows with all null values and then process the columns. If there is a column with all the same values, that is, the feature variable with a unique value is also deleted, because the variable is the same in each sample, it is considered that the variable has no effect on the model. Check the amount of missing data and delete the variables with a missing amount of 30%. We use heterogeneity ratio to measure the dispersion of data, and delete feature variables with heterogeneity ratio < 0.1. Heterogeneity ratio is the ratio of the overall variance of all samples to the overall mean. The lower the heterogeneity ratio, the smaller the difference, that is, the higher the homogeneity between samples. ML requires features to have a certain degree of dispersion, so that they can be more distinguished in features and better classified, so variables with very concentrated data distribution can be deleted. The features filtered by the training set are applied to the test set. Then the random forest method is used to fill missing values in the training set and the test set respectively.
[0047] Feature Engineering
[0048] Outlier handling
[0049] Outliers in the data will affect the learning and generalization capabilities of the model, so outliers need to be processed. Since the units of each feature variable in the data are different, for the convenience of comparison, all data are standardized, subtracted from the mean and divided by the standard deviation, and converted into a standard normal distribution. A box plot is used to view the distribution of data in each variable. If a sample data is larger than 10 times the overall standard deviation, it will be deleted.
[0050] Feature Selection
[0051] The LASSO regression model is used for feature selection. LASSO regression is a linear regression model that uses L1 regularization. Regularization introduces a penalty term in the loss function of the model to limit the size of the model parameters, thereby curbing the tendency of the model to overfit the training data. In regularization, a regularization term is usually added to the loss function. This term can be L1 regularization or L2 regularization. L1 regularization makes some weights in the model parameters sparse, that is, some parameters are made zero, so as to achieve the purpose of streamlining the model, avoid collinearity and overfitting, and achieve the effect of feature selection [9]. An important parameter of LASSO regression is the penalty coefficient alpha, which controls the strength of regularization. By adjusting the value of alpha, the degree of feature selection of the model can be controlled. We use K-fold cross validation to search for the optimal penalty coefficient, fit the model on the training set and output the results of feature selection, and apply the selected features to the training set and test set respectively.
[0052] Descriptive statistics of characteristic variables
[0053] Calculate the basic statistics of all feature variables, including mean, variance, minimum value, and quantile, and use box plots to visualize the data distribution of feature variables. In order to further compare whether the distribution of feature variables in the training set and the test set is the same, we use the kernel density plots of the two for comparison. In the kernel density plot, the horizontal axis represents the value range of the variable, and the vertical axis represents the probability density estimate at the corresponding value. The kernel density plot is usually a smooth curve that reflects the density distribution of the data at different values. The peak of the kernel density plot represents the high-density area of the data, while the valley represents the low-density area of the data. The area under the curve represents the sum of the probabilities of the entire data distribution, which is equal to 1. In data analysis and statistics, the kernel density plot is a commonly used visualization tool that helps to intuitively understand the distribution characteristics of the data and discover patterns and trends in the data.
[0054] Since the response variable is a text variable, the model cannot be directly operated and needs to be mapped. We factorized the two categories of the response variable "successful pregnancy" and "pregnancy loss" and mapped them to 0 and 1 respectively, that is, successful pregnancy is "0" and pregnancy loss is "1".
[0055] Model Training
[0056] This study selected 10 classification models, including logistic regression (Logistic), linear discriminant analysis (LDA), K nearest neighbor (KNN), decision tree (DT), random forest (RF), gradient boosting machine (GBM), extreme gradient boosting (XGB), lightweight gradient boosting machine (LGBM), support vector machine (SVM) and neural network algorithm (NNET) for model training.
[0057] Model Evaluation
[0058] Jupyter Notebook 6.5.2 was used based on Python 3 (https: / / www.python.org / ) programming language for data segmentation and cleaning, feature engineering, model training, and evaluation. Categorical variables were expressed as frequency (N) and frequency (%), and the baseline characteristics of the training set and the test set were compared using the chi-square test or Fisher's exact test. The normality of the measurement data was tested using the Shapiro–Wilk test. Measurement data that conformed to the normal distribution were described as mean ± standard deviation (Mean ± SD) and compared using the two-sample t test; numerical variables that did not conform to the normal distribution were described as median and interquartile range (Medium [IQR]) and compared using the Wilcoxon rank sum test. Two-sided p < 0.05 was considered statistically significant.
[0059] The present invention defines a function of repeated K-fold cross validation, performs 10-fold cross validation for 6 times for 10 models respectively, and calculates the accuracy, precision, recall, F1 score and AUC for each time, and draws the confusion matrix and its evaluation index. Finally, the mean and variance of the five indicators of each K-fold cross validation of the 10 models are calculated to comprehensively compare their prediction performance. The optimal model is selected to further perform hyperparameter search 200 times, find the hyperparameter combination that performs best on the training set, and train the model on the entire training set. The trained model is applied to the test set, and the performance indicators of the model on the test set are calculated, including accuracy, precision, recall, F1 score and AUC.
[0060] In Jupyter Notebook 6.5.2, the parameters of the function for repeated K-fold cross validation are as follows:
[0061] model: The machine learning model to be evaluated.
[0062] X: Feature dataset.
[0063] Y: Label dataset.
[0064] K: The number of cross-validation folds.
[0065] repeated: The number of times the cross validation is repeated.
[0066] show_confusion_matrix: Whether to display the confusion matrix.
[0067] Initialize the DataFrame:
[0068] df_mean and df_std are used to store the mean and standard deviation of each repeated cross-validation.
[0069] Repeated cross validation:
[0070] Through the loop, the function repeats the K-fold cross validation for the specified number of times.
[0071] Each time the experiment is repeated, KFold is used to split the dataset and a random number seed is set to ensure the reproducibility of the results.
[0072] Model training and evaluation:
[0073] On each fold, the training set is used to train the model, and the validation set is used to evaluate the model.
[0074] Evaluation metrics include accuracy, precision, recall, F1 score, and AUC.
[0075] Use the roc_curve and auc functions to calculate the ROC curve and AUC value.
[0076] Display the confusion matrix:
[0077] If the show_confusion_matrix parameter is True, the confusion matrix and its performance metrics for each fold are displayed.
[0078] Calculate and display overall performance indicators:
[0079] After each repetition, the mean and standard deviation of the overall performance index are calculated and displayed.
[0080] Use plt.plot to plot the average ROC curve.
[0081] Storing results:
[0082] Store the mean and standard deviation of the overall performance metric for each replicate in the df_mean and df_std DataFrames, respectively.
[0083] Return value:
[0084] The function returns two DataFrames: df_mean and df_std, containing the mean and standard deviation of the overall performance metric for each replicate, respectively.
[0085] Experimental Results
[0086] Characteristics of the study subjects
[0087] This study included women of childbearing age who visited the Reproductive Immunology Clinic of Renji Hospital Affiliated to Shanghai Jiao Tong University School of Medicine from January 1, 2020 to December 31, 2022. Patients who were already pregnant at the first visit were excluded from the study, and the subjects were followed up until August 31, 2023. This study was approved by the Ethics Committee of Renji Hospital Affiliated to Shanghai Jiao Tong University School of Medicine (Ethics Approval No.: LY2023-282-B). All participants were given informed consent for data collection.
[0088] A total of 1153 RSA patients were included in the study. The original data were divided into training and test sets according to pregnancy outcomes. The training set data (N=922, accounting for 80%) were used to establish the model, and the test set data (N=231, accounting for 20%) were used to further validate the model. In the comparison of demographic and clinical characteristics between the training set and the test set, except for the history of thrombotic disease (p=0.039) and aβ2GP1 IgG (p=0.034), there were no significant statistical differences in other variables and pregnancy outcomes between the two groups (p>0.05), indicating that the training set and test set data had good consistency.
[0089] In the data cleaning, the outlier ratios of RSA type, abnormal and unknown karyotype of husband and wife, history of previous diseases, history of autoimmune diseases, history of thrombotic diseases, congenital and acquired anatomical abnormalities, and family disease history were less than 0.1 and were eliminated. The missing value ratios of the remaining variables were all less than 30%, and the random forest method was used to interpolate the missing values. The outliers in the training data will affect the learning representation and generalization ability of the model. After the data is standardized, the outliers in the training set and test set are checked (such as Figure 2 As shown in Figure 2.1, we screened out sample data with standard deviations greater than 10 times the overall standard deviation. After data cleaning, there were 875 cases remaining in the training set and 214 cases remaining in the test set.
[0090] Feature variable selection
[0091] We use LASSO regression to select feature variables. The coefficients of LASSO regression variables in the training set change with the penalty intensity. Figure 3 As shown. The optimal penalty coefficient is searched through K-fold cross validation, as Figure 4As shown. The cross-validation diagram shows the mean squared error (MSE) path under different alpha values, and marks the best alpha value estimated by cross-validation, reflecting the performance of the model under different penalty strengths. Usually, an alpha value that minimizes the MSE is selected as the final model parameter. The optimal coefficient of the training set data is 0.01253424265461402 after searching. Under the optimal coefficient, the variable with a non-zero LASSO regression coefficient is selected as the characteristic variable. Finally, a total of 21 variables were used as characteristic variables in this study, including age, number of previous pregnancy losses, aβ2GP1 IgG, aβ2GP1 IgM, aCL IgA, aPS / PT IgG, aPS / PT IgM, anti-dsDNA, IL-17α, AA-PAgT, PT, FDP, ATIII, FV, LH, fasting GLU, the sum of the bilateral uterine artery PI, the sum of the bilateral uterine artery S / D ratio, LA positivity, ANA positivity, and anti-ENA antibody positivity.
[0092] After selecting the feature variables, we plotted the distribution of the variables in the training set and the test set. The kernel density plots of the training set and the test set are very similar in overall shape and peak position, indicating that the data distribution of the training set and the test set is basically the same, and the features learned by the model on the training set can be well generalized to the test set. Even though LASSO regression has performed feature selection, if there is a high correlation between the selected features, it may lead to poor model interpretation. Further analyzing the correlation between features and removing some highly correlated variables can help reduce multicollinearity problems and improve the stability and interpretability of the model. In addition, by further removing highly correlated variables, the model can be simplified and made easier to understand and interpret. The correlation coefficient matrix of the feature variables of the training set and the test set indicates that the correlation coefficients between FDP and ATIII are 0.5 and 0.58 in the training set and the test set, respectively. The correlation coefficient between 0.5 and 0.7 is considered to be a moderate degree of correlation. After removing the variable FDP, which has a higher overall correlation with other variables, the correlation coefficients between the remaining feature variables are less than 0.5.
[0093] Model training and evaluation
[0094] We selected 10 classification algorithms in supervised learning for comparison, including Logistic, LDA, KNN, DT, RF, GBM, XGB, LGBM, SVM and NNET models. First, the 10-fold cross-validation method was used to train and evaluate the model in the training set. The evaluation indicators of the model are shown in Table 1. At the same time, the 10-fold cross-validation ROC curves of the 10 models were plotted (see Table 1). Figure 5As shown). Among the 10 models, the DT model has the lowest accuracy and AUC, and performs the worst; while the average prediction accuracy of the other nine models is above 80%, among which LDA has the highest accuracy. In terms of AUC, Logistic, LDA, RF, GBM, XGB, LGBM and SVM all reach above 0.75, among which RF's AUC reaches 0.801, indicating that the DT-based integrated learning algorithm RF algorithm can improve the prediction efficiency of the model better than the simple DT model.
[0095] Table 1 Evaluation indicators of ten-fold cross validation of 10 models in the training set
[0096] Model Accuracy Precision Recall F1_score AUC Logistic 0.811±0.044 0.545±0.245 0.256±0.126 0.338±0.157 0.785±0.058 LDA 0.817±0.045 0.579±0.196 0.295±0.118 0.380±0.133 0.788±0.053 KNN 0.808±0.041 0.350±0.450 0.035±0.045 0.063±0.082 0.628±0.066 DT 0.713±0.039 0.313±0.132 0.317±0.112 0.293±0.059 0.567±0.046 RF 0.810±0.041 0.511±0.298 0.136±0.107 0.202±0.147 0.801±0.043 GBM 0.807±0.027 0.548±0.193 0.242±0.095 0.319±0.091 0.776±0.058 XGB 0.802±0.046 0.501±0.221 0.313±0.185 0.361±0.164 0.764±0.071 LGB 0.808±0.036 0.545±0.184 0.264±0.129 0.336±0.124 0.767±0.072 SVM 0.815±0.045 0.643±0.293 0.146±0.109 0.223±0.151 0.775±0.053 NNET 0.803±0.047 0.313±0.338 0.082±0.097 0.129±0.150 0.674±0.045
[0097] To further evaluate the predictive performance of the model, we defined a repeated K-fold cross-validation function, performed 6 10-fold cross-validations on each of the 10 models, and calculated the accuracy, precision, recall, F1 score, and AUC for each time. We calculated the mean and variance of the five evaluation indicators for each 10-fold cross-validation of the 10 models, and drew a line graph to comprehensively compare their predictive performance. Figure 6-8 As shown in the figure, the four indicators of DT are lower than those of other models. From the perspective of AUC, RF is higher than other models in each 10-fold cross validation.
[0098] To this end, we chose RF to further tune the parameters and used the random search method to search 200 times. The optimal parameters are as follows: 'n_estimators': 100, 'min_samples_split': 5, 'min_samples_leaf': 2, 'max_features': 'sqrt', 'max_depth': 20. Retraining on the training set with the optimal parameters can achieve a prediction accuracy of 98.29%. The trained model was then applied to the test set, and the performance indicators of the model on the test set were calculated. The model's prediction accuracy on the test set was 81.8%, the precision was 0.667, the recall was 0.213, the F1 score was 0.323, and the AUC was 0.70 (as shown in Figure 2). Fig. 9 shown).
[0099] The above describes the method for predicting the risk of pregnancy loss in patients with recurrent miscarriage based on an Internet hospital in an embodiment of the present invention. The following describes the device for predicting the risk of pregnancy loss in patients with recurrent miscarriage based on an Internet hospital in an embodiment of the present invention. The system for predicting the risk of pregnancy loss in patients with recurrent miscarriage based on an Internet hospital in an embodiment of the present invention includes:
[0100] An acquisition module is used to acquire risk prediction data based on Internet hospitals and divide the risk prediction data into a test set and a training set;
[0101] Cleaning module, used to clean risk prediction data;
[0102] The feature variable selection module is used to adopt LASSO regression, select variables with non-zero LASSO regression coefficients as feature variables, calculate the feature variable correlation coefficient matrix, and delete feature variables with high correlation;
[0103] The model training module is used to construct multiple algorithm models according to the selected feature variables, train the algorithm models, evaluate the model performance by using 10-fold cross validation, and obtain the optimal parameter model;
[0104] The model prediction module is used to predict the risk of pregnancy loss for patients with recurrent spontaneous abortion using the optimal parameter model.
[0105] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for predicting pregnancy loss risk in patients with recurrent spontaneous abortion based on an Internet hospital, characterized in that: The following steps are involved: Based on the Internet hospital, risk prediction data is obtained and divided into a test set and a training set. Perform data cleaning on risk prediction data; Using LASSO regression, select variables with non-zero LASSO regression coefficients as feature variables, calculate the feature variable correlation coefficient matrix, and delete feature variables with high correlation; According to the selected characteristic variables, multiple algorithm models are constructed, the algorithm models are trained, and the model performance is evaluated by 10-fold cross validation to obtain the optimal parameter model; The optimal parameter model was used to predict the risk of pregnancy loss in patients with recurrent spontaneous abortion.
2. According to claim 1, a method for predicting pregnancy loss risk in patients with recurrent spontaneous abortion based on an Internet hospital, characterized in that: The data cleaning of the risk prediction data specifically includes: Eliminate data with an outlier ratio of less than 0.1; For missing data on variables, the random forest method was used to interpolate missing values; After elimination and interpolation, sample data with a standard deviation greater than 10 times the overall standard deviation are screened out to complete data cleaning.
3. According to claim 1, a method for predicting pregnancy loss risk in patients with recurrent spontaneous abortion based on an Internet hospital, characterized in that: The step of evaluating the model performance and obtaining the optimal parameter model includes: The multiple models were subjected to multiple 10-fold cross validations, and the evaluation indicators for each validation were calculated, including accuracy, precision, recall, F1 score, and AUC. Calculate the mean and variance of the evaluation indicators of each model for each 10-fold cross validation Selecting an optimal model based on the mean and variance; The random search method is used to search and obtain the optimal parameters of the model.
4. According to claim 1, a method for predicting pregnancy loss risk in patients with recurrent spontaneous abortion based on an Internet hospital, characterized in that: The data included age, number of previous pregnancy losses, aβ2GP1IgG, aβ2GP1 IgM, aCL IgA, aPS / PT IgG, aPS / PT IgM, anti-dsDNA, IL-17α, AA-PAgT, PT, FDP, ATIII, FV, LH, fasting GLU, sum of bilateral uterine artery PI, sum of bilateral uterine artery S / D ratio, LA positivity, ANA positivity and anti-ENA antibody positivity.
5. According to claim 1, a method for predicting pregnancy loss risk in patients with recurrent spontaneous abortion based on an Internet hospital, characterized in that: The optimal parameter model is the random forest model, and the random forest algorithm is implemented using the RandomForestClassifier function in the scikit-learn library. The optimal parameters are: the number of trees in the forest 'n_estimators': 100, the minimum number of samples required to split the internal nodes 'min_samples_split': 5, minimum number of samples required for a leaf node 'min_samples_leaf': 2, number of features to consider when finding the best split 'max_features': 'sqrt', maximum depth of the tree 'max_depth':
20.
6. A pregnancy loss risk prediction system for patients with recurrent miscarriage based on an Internet hospital, characterized in that: The system comprises: An acquisition module is used to acquire risk prediction data and divide the risk prediction data into a test set and a training set; Cleaning module, used to clean risk prediction data; The feature variable selection module is used to adopt LASSO regression, select variables with non-zero LASSO regression coefficients as feature variables, calculate the feature variable correlation coefficient matrix, and delete feature variables with high correlation; The model training module is used to construct multiple algorithm models according to the selected feature variables, train the algorithm models, evaluate the model performance by using 10-fold cross validation, and obtain the optimal parameter model; The model prediction module is used to predict the risk of pregnancy loss for patients with recurrent spontaneous abortion using the optimal parameter model.
7. An electronic device, comprising a memory and at least one processor, wherein instructions are stored in the memory; The at least one processor calls the instructions in the memory so that the electronic device executes the various steps of the method for predicting pregnancy loss risk for recurrent miscarriage patients based on an Internet hospital as described in any one of claims 1-5.
8. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions are executed by the processor, the various steps of the method for predicting the risk of pregnancy loss in patients with recurrent miscarriage based on an Internet hospital are implemented as described in any one of claims 1 to 5.