Gestational diabetes risk prediction method and device based on integrated machine learning model
By constructing a multi-hospital sample set, screening features, and conducting three rounds of validation, an ensemble machine learning model was developed, which solved the problem of insufficient generalization ability of gestational diabetes risk prediction models and achieved stable application and simplified risk classification in different hospitals and regions.
Patent Information
- Application Number
- CN202511052581.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-29
- Publication Date
- 2025-11-14
AI Technical Summary
Existing machine learning models have insufficient generalization ability in predicting the risk of gestational diabetes and are highly dependent on training data, making it difficult to stably promote them in different hospitals and regional populations. Furthermore, they require complex prenatal examination indicators, resulting in high data collection costs and limiting the clinical applicability of the models.
A sample set was constructed, including samples from general hospitals, specialized hospitals, and other hospitals located in geographically distant areas. A correlation algorithm was used to screen features, and the Garson algorithm was used to calculate the importance weights of the ensemble machine learning model. The optimal feature subset was determined through cross-validation, and three rounds of validation were performed to improve the generalization ability of the model.
It improves the generalization ability of the gestational diabetes risk prediction model, simplifies data requirements, reduces data collection costs, makes the model more stable in different hospitals and regions, and provides a fast and simple risk classification method.
Smart Images

Figure CN120954705A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of gestational diabetes risk prediction technology, and in particular to a method and apparatus for gestational diabetes risk prediction based on an integrated machine learning model. Background Technology
[0002] Gestational diabetes mellitus (GDM) is a critical condition affecting maternal and infant health, not only increasing the risk of pregnancy complications but also having a profound impact on the long-term health of both mother and child. With the application of machine learning technology in the medical field, machine learning models can improve prediction accuracy and are increasingly being used for GDM risk prediction.
[0003] However, current machine learning methods are highly dependent on training data, and their predictive performance drops significantly when the data is distributed across different hospitals, geographical regions, or populations. This stems from the model's overfitting to the training data and its failure to adequately consider the diversity of clinical data, resulting in poor adaptability to new samples and difficulty in stable clinical application. Furthermore, existing predictive models often require a large number of complex and unconventional prenatal examination indicators. Such data is difficult to obtain comprehensively in primary healthcare institutions or routine prenatal checkups, increasing data collection costs and limiting the model's clinical applicability.
[0004] Clinicians typically need to provide early intervention for high- and intermediate-risk individuals with GDM to prevent adverse pregnancy outcomes. Current predictive models lack rapid, simple, and definitive risk classification, failing to provide specific methods for categorizing high, intermediate, and low risk. However, a clear understanding of this classification is urgently needed in clinical practice to determine the necessity of early intervention. Summary of the Invention
[0005] Therefore, it is necessary to provide a method and device for predicting the risk of gestational diabetes mellitus based on an integrated machine learning model, which can solve the problems of insufficient generalization ability and high data requirements of current machine learning models for predicting gestational diabetes mellitus, as well as a gestational diabetes mellitus risk classification scheme based on this model, in order to address the above-mentioned technical problems.
[0006] A method for predicting the risk of gestational diabetes based on an ensemble machine learning model, the method comprising:
[0007] A sample set is constructed; the samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at a distance from each other; the sample data of the samples are prenatal registration data and blood sample data from early pregnancy;
[0008] The correlation algorithm is used to perform correlation analysis between the sample data, thereby filtering the sample data;
[0009] The Garson algorithm is used to calculate the importance weight of each individual model in the ensemble machine learning model for the selected sample data. The importance weights of each model are then weighted to obtain the overall importance of the sample data.
[0010] Based on the overall importance, a feature subset of the sample data is determined, and recursive elimination based on cross-validation is used to determine the optimal feature subset.
[0011] The ensemble machine learning model is trained using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples. The validation process of the ensemble machine learning model includes: performing a first round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples and the specialized hospital samples; performing a second round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples, the specialized hospital samples, and other hospital samples; and performing a third round of validation on the trained ensemble machine learning model using validation samples from other hospital samples.
[0012] Once the preset training completion conditions are met, an integrated machine learning model that can predict the risk of gestational diabetes is output.
[0013] In one embodiment, the blood sample data includes: complete blood count data, liver function data, and kidney function data.
[0014] In one embodiment, the prenatal registration data includes: age, weight, height, parity, pre-pregnancy hypertension, polycystic ovary syndrome, history of gestational diabetes, and family history of diabetes.
[0015] In one embodiment, the blood sample data includes: white blood cell count, neutrophil percentage, hemoglobin, platelet count, mean platelet volume, alanine aminotransferase, aspartate aminotransferase, gamma-glutamyl transferase, alkaline phosphatase, blood urea nitrogen, and fasting blood glucose level.
[0016] In one embodiment, the method further includes: standardizing the sample data using a standard deviation formula; wherein the standard deviation formula is:
[0017] Z=(X-μ) / σ
[0018] Where Z represents the value of the standardized sample data, X is the value of the original sample data, μ is the mean of the sample data, and σ is the standard deviation of the sample data; μ = (1 / n)*Σ(X i (i = 1 to n), n represents the number of samples, X i This represents the value of the i-th sample data.
[0019] In one embodiment, the single model includes: an elastic network, a random forest network, a neural network, a gradient boosting machine, and extreme gradient boosting; it also includes: using the Garson algorithm to calculate the evaluation formula for the importance weight of the elastic network in the ensemble machine learning model for the selected sample data, as follows:
[0020] VI(X i )=|β i |
[0021] Where, β i The elastic network is the variable X i Estimated coefficients;
[0022] The evaluation formula for calculating the importance weight of the random forest network in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows:
[0023] VI(X i )=∑(by X i (Reduction in impurity due to splitting) / (Number of trees)
[0024] Each of them uses variable X i For nodes undergoing splitting, calculate the reduction in impurity;
[0025] The evaluation formula for calculating the importance weights of neural networks in an ensemble machine learning model for the selected sample data using the Garson algorithm is as follows:
[0026] VI(X i )=∑|W ij |
[0027] Among them, W ij Indicates connecting input variable X i The weights of neuron j in the first hidden layer;
[0028] The evaluation formula for calculating the importance weights of the gradient boosting machine in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows:
[0029]
[0030] For each split t in the lifting process: I t 2 The squared improvement in the loss function caused by splitting is represented by 1(v t =X i ) is an indicator function, if variable X i If used to split t, it equals 1; otherwise, it equals 0.
[0031] In one embodiment, the method further includes: weighting the importance weights of each model as follows:
[0032]
[0033] in, Represents variable X i Importance in model m; w m This represents the weights assigned to model m by the ensemble machine learning model, where m is one of the following: elastic network, random forest network, neural network, gradient boosting machine, and extreme gradient boosting.
[0034] The evaluation formula for calculating the importance weights of extreme gradient boosting for the selected sample data in the ensemble machine learning model using the Garson algorithm is as follows:
[0035]
[0036] Where t is the split node in all trees, ΔL t Let represent the improvement in the objective loss function resulting from the t-th split. This indicates an indicator function, which is 1 if variable j was used in the t-th split, and 0 otherwise. T represents the total number of split nodes in the tree. t This represents the variable used in the t-th split.
[0037] A device for predicting the risk of gestational diabetes based on an ensemble machine learning model, the device comprising:
[0038] A sample set construction module is used to construct a sample set; the samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at a distance from each other; the sample data of the samples are prenatal registration data and blood sample data from early pregnancy;
[0039] The data processing module is used to perform correlation analysis on the sample data using a correlation algorithm, thereby filtering the sample data; and to calculate the importance weight of each individual model in the ensemble machine learning model for the filtered sample data using the Garson algorithm, and to weight the importance weight of each model to obtain the overall importance of the sample data.
[0040] The optimal feature subset determination module is used to determine the feature subset of the sample data based on the overall importance, and to determine the optimal feature subset by recursive elimination based on cross-validation.
[0041] The training and validation module is used to train the ensemble machine learning model using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples. The validation process of the ensemble machine learning model includes: performing a first round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples and the specialized hospital samples; performing a second round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples, the specialized hospital samples, and other hospital samples; and performing a third round of validation on the trained ensemble machine learning model using validation samples from other hospital samples.
[0042] The prediction module is used to output an integrated machine learning model that can predict the risk of gestational diabetes once the preset training completion conditions are met.
[0043] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:
[0044] A sample set is constructed; the samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at a distance from each other; the sample data of the samples are prenatal registration data and blood sample data from early pregnancy;
[0045] The correlation algorithm is used to perform correlation analysis between the sample data, thereby filtering the sample data;
[0046] The Garson algorithm is used to calculate the importance weight of each individual model in the ensemble machine learning model for the selected sample data. The importance weights of each model are then weighted to obtain the overall importance of the sample data.
[0047] Based on the overall importance, a feature subset of the sample data is determined, and recursive elimination based on cross-validation is used to determine the optimal feature subset.
[0048] The ensemble machine learning model is trained using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples. The validation process of the ensemble machine learning model includes: performing a first round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples and the specialized hospital samples; performing a second round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples, the specialized hospital samples, and other hospital samples; and performing a third round of validation on the trained ensemble machine learning model using validation samples from other hospital samples.
[0049] Once the preset training completion conditions are met, an integrated machine learning model that can predict the risk of gestational diabetes is output.
[0050] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:
[0051] A sample set is constructed; the samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at a distance from each other; the sample data of the samples are prenatal registration data and blood sample data from early pregnancy;
[0052] The correlation algorithm is used to perform correlation analysis between the sample data, thereby filtering the sample data;
[0053] The Garson algorithm is used to calculate the importance weight of each individual model in the ensemble machine learning model for the selected sample data. The importance weights of each model are then weighted to obtain the overall importance of the sample data.
[0054] Based on the overall importance, a feature subset of the sample data is determined, and recursive elimination based on cross-validation is used to determine the optimal feature subset.
[0055] The ensemble machine learning model is trained using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples. The validation process of the ensemble machine learning model includes: performing a first round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples and the specialized hospital samples; performing a second round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples, the specialized hospital samples, and other hospital samples; and performing a third round of validation on the trained ensemble machine learning model using validation samples from other hospital samples.
[0056] Once the preset training completion conditions are met, an integrated machine learning model that can predict the risk of gestational diabetes is output.
[0057] The aforementioned method and device for predicting the risk of gestational diabetes based on an ensemble machine learning model first selects hospital samples from different types and regions to construct the sample set. For the specific sample feature selection, only prenatal registration data and blood sample data from early pregnancy are chosen. These data are readily available and require no additional testing; they can be obtained through routine prenatal examinations. For this data, the correlation between features is first screened, then the importance to individual models is screened, and finally, the optimal feature subset is determined through cross-validation in the ensemble machine learning model. To improve the model's generalization ability, training is conducted using data from comprehensive and specialized hospitals, which have the most complex datasets. During validation, three rounds of validation are performed, ultimately improving the model's generalization ability. Attached Figure Description
[0058] Figure 1 This is a flowchart illustrating a method for predicting the risk of gestational diabetes based on an integrated machine learning model in one embodiment.
[0059] Figure 2 This is a schematic diagram of a decision tree tool in one embodiment;
[0060] Figure 3 This is a structural block diagram of a gestational diabetes risk prediction device based on an integrated machine learning model in one embodiment.
[0061] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0062] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0063] In one embodiment, such as Figure 1 As shown, a method for predicting the risk of gestational diabetes based on an ensemble machine learning model is provided, including the following steps:
[0064] Step 102: Construct the sample set.
[0065] The samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at geographical distances; the sample data are prenatal registration data and blood sample data from early pregnancy.
[0066] Taking China's geographical distribution as an example, data from at least three hospitals in the north, central, and south can be selected as samples. Different regions have significant differences in lifestyle and physical conditions, and patients in different types of hospitals have varying health conditions. Therefore, data from different hospitals are incorporated into the training process. Although the sample feature selection is the same, it effectively introduces samples from different clinical scenarios. Explicit features include prenatal registration data and blood sample data, while implicit features include hospital type and geographical distribution. Through the combination of explicit and implicit features, the model can learn the association between different feature combinations and the risk of gestational diabetes during training. When applying this model to different regions and different types of hospitals, it can accurately predict gestational diabetes, improving the model's generalization ability. Regarding sample data selection, early pregnancy refers to weeks 0-12, prenatal registration data refers to the data filled out during registration, and blood sample data refers to the data from necessary blood tests performed during registration.
[0067] Specifically, regarding sample selection, taking Beijing as an example, general hospitals could be Peking Union Medical College Hospital, specialized hospitals could be Chaoyang Maternal and Child Health Hospital, and other hospital samples could be, for example, the Second Hospital of Hebei Medical University, Dong'e Hospital, and Guangzhou Women and Children's Medical Center. The above are examples and are not the final solution; you can choose according to your actual needs.
[0068] The sample set construction includes training samples and validation samples. The training samples can be general hospitals and specialized hospitals, while the validation samples are a three-level validation sample composed of hospital samples, specialized hospitals, and other hospitals. In terms of time, the training samples are earlier than the validation samples, and they can be selected within the same seasonal range to control the influence of other environmental parameters.
[0069] Step 104: Use a correlation algorithm to perform correlation analysis on the sample data, thereby filtering the sample data.
[0070] In this embodiment, for variables with high correlation between features, a correlation algorithm is used to select one of them, avoiding the model learning redundant information and improving the model's generalization ability.
[0071] Specifically, the correlation is checked using a pairwise Spearman test with a correlation threshold of 0.6. If the correlation between two or more features is greater than 0.6, then one of the features is selected.
[0072] Step 106: Use the Garson algorithm to calculate the importance weight of each individual model in the ensemble machine learning model for the selected sample data, and weight the importance weight of each model to obtain the overall importance of the sample data.
[0073] Step 108: Determine the feature subset of the sample data based on overall importance, and use recursive elimination based on cross-validation to determine the optimal feature subset.
[0074] Specifically, the process first trains the ensemble learner using the complete set of all latent features from the training dataset. Then, a 10-fold cross-validation process is performed to obtain the AUC value based on the training dataset. Next, the least important features are removed one by one according to their importance ranking, and this step is repeated. The AUC value of each subset based on the training dataset is recorded. Then, the cross-validation AUC values of the ensemble learner and the five base learners are plotted against the number of features. Finally, the optimal feature subset is determined by identifying the inflection point. The AUC value represents the area under the ROC curve (horizontal axis: false positive rate (FPR), vertical axis: true positive rate (TPR)).
[0075] Step 110: Train an ensemble machine learning model using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples.
[0076] The validation process of the ensemble machine learning model includes: a first round of validation using validation samples from general hospitals and specialized hospitals; a second round of validation using validation samples from general hospitals, specialized hospitals, and other hospitals; and a third round of validation using validation samples from other hospitals.
[0077] Step 112: Once the preset training completion conditions are met, an integrated machine learning model that can predict the risk of gestational diabetes is output.
[0078] In the above-mentioned method for predicting the risk of gestational diabetes based on an ensemble machine learning model, the sample set is constructed by first selecting hospital samples from different types and regions. For the specific sample feature selection, only prenatal registration data and blood sample data from early pregnancy are chosen. These data are readily available and require no additional testing; they can be obtained through routine prenatal checkups. For this data, the correlation between features is first screened, then the importance to individual models is screened, and finally, in the ensemble machine learning model, the optimal feature subset is determined through cross-validation. To improve the model's generalization ability, training is conducted using data from comprehensive and specialized hospitals, which have the most complex datasets. During validation, three rounds of validation are performed, ultimately improving the model's generalization ability.
[0079] In one embodiment, the blood sample data includes: complete blood count data, liver function data, and kidney function data.
[0080] In one embodiment, prenatal registration data includes: age, weight, height, parity, pre-pregnancy hypertension, polycystic ovary syndrome, history of gestational diabetes, and family history of diabetes.
[0081] In one embodiment, the blood sample data includes: white blood cell count, neutrophil percentage, hemoglobin, platelet count, mean platelet volume, alanine aminotransferase, aspartate aminotransferase, gamma-glutamyl transferase, alkaline phosphatase, blood urea nitrogen, and fasting blood glucose level.
[0082] The above embodiments do not include lipid metabolism, gene detection, and other metabolomics data, so that the training data of this method is concentrated on data commonly obtained by various hospitals, without increasing the data collection burden of hospitals and patients, thereby enabling this method to be used nationwide.
[0083] In one embodiment, the Spearman correlation coefficient (ρ) is calculated using the following formula:
[0084] ρ=1-(6×Σd 2) / (n×(n 2 -1))
[0085] Where ρ is the Spearman correlation coefficient, d is the rank difference between the two variables, and n is the range of the correlation coefficient based on the sample size.
[0086] In one embodiment, the continuous data is standardized (mean = 0, standard deviation = 1) before model fitting. This rescaling aims to standardize the continuous variables, ensuring all features are considered equally. This, in turn, helps improve the model's performance, stability, and interpretability. The sample data is standardized using the standard deviation formula; where the standard deviation formula is:
[0087] Z=(X-μ) / σ
[0088] Where Z represents the value of the standardized sample data, X is the value of the original sample data, μ is the mean of the sample data, and σ is the standard deviation of the sample data; μ = (1 / n)*Σ(X i (i = 1 to n), n represents the number of samples, X i This represents the value of the i-th sample data.
[0089] After data preprocessing, for training and validating ensemble machine learning models using samples, the ensemble model generates measures of variable importance. These measures summarize the contribution of each feature to the model's predictions. The importance of a feature is determined by how much the model depends on that variable to make accurate predictions. The more the model depends on a variable in its predictions, the more important that variable is to the model. Variable importance enhances interpretability and provides insight into the features that contribute most to the predictions. Furthermore, importance measures can aid in feature selection in high-dimensional data. Each base learner calculates the importance of each variable, which is then further estimated by the ensemble learner.
[0090] In a further embodiment, the individual models include: elastic networks, random forest networks, neural networks, gradient boosting machines, and extreme gradient boosting; that is, these five types of models constitute the above-mentioned ensemble machine learning model. For the feature selection step, the existing individual models complete the evaluation of importance, and then the ensemble model performs a comprehensive evaluation, and finally determines the feature subset based on the ranking.
[0091] Specifically, the Garson algorithm is used to calculate the importance weights of individual models in the ensemble machine learning model for the selected sample data, including:
[0092] The evaluation formula for calculating the importance weights of the resilient network in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows:
[0093] VI(X i )=|β i |
[0094] Where, β i The elastic network is the variable X i Estimated coefficients.
[0095] The evaluation formula for calculating the importance weight of the random forest network in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows:
[0096] VI(X i )=∑(by X i (Reduction in impurity due to splitting) / (Number of trees)
[0097] Each of them uses variable X i For nodes undergoing splitting, calculate the reduction in impurity.
[0098] The evaluation formula for calculating the importance weights of neural networks in an ensemble machine learning model for the selected sample data using the Garson algorithm is as follows:
[0099] VI(X i )=∑|W ij |
[0100] Among them, W ij Indicates connecting input variable X i The weights of neuron j in the first hidden layer.
[0101] The evaluation formula for calculating the importance weights of the gradient boosting machine in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows:
[0102] VI(X i )=∑(I t 2 ×1(v t =X i ))
[0103] For each split t in the lifting process: The squared improvement in the loss function caused by splitting is represented by 1(v t =X i ) is an indicator function, if variable X i If used to split t, it equals 1; otherwise, it equals 0.
[0104] The evaluation formula for calculating the importance weights of extreme gradient boosting for the selected sample data in the ensemble machine learning model using the Garson algorithm is as follows:
[0105]
[0106] Where t is the split node in all trees, ΔL t Let represent the improvement in the objective loss function resulting from the t-th split. This indicates an indicator function, which is 1 if variable j was used in the t-th split, and 0 otherwise. T represents the total number of split nodes in the tree. t This represents the variable used in the t-th split.
[0107] For ensemble machine learning models, the importance weights of each model are weighted as follows:
[0108]
[0109] in, Represents variable X i Importance in model m; w m This represents the weights assigned to model m by the ensemble machine learning model, where m is one of the following: elastic network, random forest network, neural network, gradient boosting machine, and extreme gradient boosting.
[0110] at last, In the sorted list, all The values are sorted in descending order, and a rank is assigned based on their position in this sorted list. The most important variable gets rank 1, the second most important gets rank 2, and so on. If there are ties, the rank() function usually assigns an average rank to the tied values. This is how the optimal feature subset is obtained.
[0111] In one embodiment, an ensemble machine learning model was used, integrating five different machine learning methods. The advantage of this ensemble learning strategy lies in improved accuracy and resilience, as well as the ability to utilize more features than any single base learner can handle. When creating the ensemble machine learning model, five base learners were selected, each with unique properties and features, enabling them to manage different types of data and detect complex patterns within the data. These five base learners are Resilient Regression Network (GLMNET), Random Forest (RF), Gradient Boosting Machine (GBM), Neural Network (NNET), and Extreme Gradient Boosting (XGBoost). These learners can handle continuous, binary, and categorical predictor variables and can cope with challenges such as linearity, nonlinearity, and multicollinearity. The ensemble model was retrained using a selected optimal subset of features, combining the five machine learning base learners (Resilient Regression Network, Random Forest, Gradient Boosting Machine, Neural Network, and Extreme Gradient Boosting).
[0112] Specifically, integrating machine learning models:
[0113] P(Y=1|X)=σ(∑(w i ×logit(P i (Y=1|X))))
[0114] Where P i w is the predicted probability of the i-th base model. i That is the corresponding weight.
[0115] In all these models, X represents the complete set of predictor variables (history of gestational diabetes, fasting blood glucose level, age, white blood cell count, gamma-glutamyl transferase, platelet count, body mass index, family history of diabetes). Each model handles these variables in a different way. The ensemble model will make better predictions than any single base learner because it leverages the strengths of all the base learners.
[0116] In the final validation phase, the first phase of validation was conducted using maternal data from general hospitals and specialized hospitals over the past year to assess the predictive efficacy issues arising from potential concept drift. The second phase of validation added maternal data from other hospitals to the first phase of validation to evaluate the integrated predictive efficacy of the model across different hospitals nationwide. The third phase of validation used only maternal data from three other hospitals to assess its actual generalization ability.
[0117] In one embodiment, such as Figure 2 As shown, when using the aforementioned ensemble machine learning model for gestational diabetes risk prediction, considering that clinicians often prefer intuitive and rapid risk classification methods, and the potential delays in implementing algorithms in hospital systems, a simple and easily accessible decision tree tool is developed to avoid reliance on immediate computer access. This tool includes the following steps:
[0118] 1. Calculate the probability of being diagnosed with gestational diabetes using an ensemble machine learning model on the training set. Divide these probabilities into three groups based on the tertiary values of the probabilities, and classify the participants in the training set into low-risk, medium-risk, and high-risk groups.
[0119] Specifically, thresholds are determined based on the 33rd and 66th percentiles of the probability distribution in the training set, and the samples are divided into:
[0120] Low risk: Predicted probability ≤ 33% quantile;
[0121] Medium risk: 33rd percentile < predicted probability < 66th percentile;
[0122] High risk: Predicted probability ≥ 66th percentile.
[0123] The triadic classification allows for early intervention in high- and intermediate-risk populations to prevent adverse pregnancy outcomes, while avoiding over-intervention in low-risk populations.
[0124] 2. Decision trees were constructed using the training set and combined with the input features of an ensemble machine learning model to predict the risk of participants being diagnosed with gestational diabetes.
[0125] In this step, the feature space is recursively divided, and the cut-off value of each node is automatically optimized to achieve a direct mapping between input features and risk categories, ensuring the consistency of feature logic between the decision tree and the ensemble model.
[0126] 3. The decision tree is optimized through 10-fold cross-validation, and finally a visualized decision tree is generated.
[0127] To verify the performance of the decision tree, external validation was performed using validation sets from the second and third rounds of validation. This external validation implicitly considered time-based and location-based validation. Specifically, the validation set used samples from different time cohorts, for example, the training set used data from 2020–2022, and the validation set used data from 2023–2024, to simulate the generalization ability over time in clinical settings. The second and third rounds of validation included samples from different medical centers and regions to accommodate population heterogeneity.
[0128] Finally, a multi-class version of the AUC for each risk category is calculated using a one-vs-rest approach, and the average AUC is calculated based on the value for each risk category to evaluate the overall model performance.
[0129] It should be understood that, although Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0130] In one embodiment, such as Figure 3 As shown, a gestational diabetes risk prediction device based on an integrated machine learning model is provided, comprising: a sample set construction module 302, a data processing module 304, an optimal feature subset determination module 306, a training and validation module 308, and a prediction module 310, wherein:
[0131] The sample set construction module 302 is used to construct a sample set; the samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at a distance from each other; the sample data of the samples are prenatal registration data and blood sample data from early pregnancy;
[0132] The data processing module 304 is used to perform correlation analysis on the sample data using a correlation algorithm to filter the sample data; the Garson algorithm is used to calculate the importance weight of each model in the ensemble machine learning model for the filtered sample data, and the importance weight of each model is weighted to obtain the overall importance of the sample data;
[0133] The optimal feature subset determination module 306 is used to determine the feature subset of the sample data based on the overall importance, and to determine the optimal feature subset by using cross-validation.
[0134] The training and validation module 308 is used to train the ensemble machine learning model using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples. The validation process of the ensemble machine learning model includes: performing a first round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples and the specialized hospital samples; performing a second round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples, the specialized hospital samples, and other hospital samples; and performing a third round of validation on the trained ensemble machine learning model using validation samples from other hospital samples.
[0135] The prediction module 310 is used to output an integrated machine learning model that can predict the risk of gestational diabetes after the preset training completion conditions are met.
[0136] Specific limitations regarding the gestational diabetes risk prediction device based on ensemble machine learning models can be found in the above description of the limitations of the gestational diabetes risk prediction method based on ensemble machine learning models, and will not be repeated here. Each module in the aforementioned gestational diabetes risk prediction device based on ensemble machine learning models can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module.
[0137] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The database stores sample data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a method for predicting the risk of gestational diabetes based on an integrated machine learning model.
[0138] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0139] In one embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps of the method described above.
[0140] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0141] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0142] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0143] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for predicting the risk of gestational diabetes based on an ensemble machine learning model, characterized in that, The method includes: A sample set is constructed; the samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at a distance from each other; the sample data of the samples are prenatal registration data and blood sample data from early pregnancy; The correlation algorithm is used to perform correlation analysis between the sample data, thereby filtering the sample data; The Garson algorithm is used to calculate the importance weight of each individual model in the ensemble machine learning model for the selected sample data. The importance weights of each model are then weighted to obtain the overall importance of the sample data. Based on the overall importance, a feature subset of the sample data is determined, and recursive elimination based on cross-validation is used to determine the optimal feature subset. The ensemble machine learning model is trained using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples. The validation process of the ensemble machine learning model includes: performing a first round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples and the specialized hospital samples; performing a second round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples, the specialized hospital samples, and other hospital samples; and performing a third round of validation on the trained ensemble machine learning model using validation samples from other hospital samples. Once the preset training completion conditions are met, an integrated machine learning model that can predict the risk of gestational diabetes is output.
2. The method according to claim 1, characterized in that, The blood sample data includes: complete blood count data, liver function data, and kidney function data.
3. The method according to claim 1, characterized in that, The prenatal registration data includes: age, weight, height, parity, pre-pregnancy hypertension, polycystic ovary syndrome, history of gestational diabetes, and family history of diabetes.
4. The method according to claim 2, characterized in that, The blood sample data includes: white blood cell count, neutrophil percentage, hemoglobin, platelet count, mean platelet volume, alanine aminotransferase, aspartate aminotransferase, gamma-glutamyl transferase, alkaline phosphatase, blood urea nitrogen, and fasting blood glucose level.
5. The method according to any one of claims 1 to 4, characterized in that, After performing correlation analysis on the sample data using a correlation algorithm, the method further includes: The sample data are standardized using the standard deviation formula; whereby the standard deviation formula is: Z=(X-μ) / σ Where Z represents the value of the standardized sample data, X is the value of the original sample data, μ is the mean of the sample data, and σ is the standard deviation of the sample data; μ = (1 / n)*Σ(X i (i = 1 to n), n represents the number of samples, X i This represents the value of the i-th sample data.
6. The method according to any one of claims 1 to 4, characterized in that, The individual models include: elastic networks, random forest networks, neural networks, gradient boosting machines, and extreme gradient boosting; The Garson algorithm is used to calculate the importance weights of individual models in the ensemble machine learning model for the selected sample data, including: The evaluation formula for calculating the importance weights of the resilient network in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows: You(X i )=|β i | Where, β i The elastic network is the variable X i Estimated coefficients; The evaluation formula for calculating the importance weight of the random forest network in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows: VI(X i )=∑(by X i (Reduction in impurity due to splitting) / (Number of trees) Each of them uses variable X i For nodes undergoing splitting, calculate the reduction in impurity; The evaluation formula for calculating the importance weights of neural networks in an ensemble machine learning model for the selected sample data using the Garson algorithm is as follows: You(X i )=∑|W ij | Among them, W ij Indicates connecting input variable X i The weights of neuron j in the first hidden layer; The evaluation formula for calculating the importance weights of the gradient boosting machine in the ensemble machine learning model for the selected sample data using the Garson algorithm is as follows: For each split t in the lifting process: The squared improvement in the loss function caused by splitting is represented by 1(v t =X i ) is an indicator function, if variable X i If used to split t, then it equals 1; otherwise, it equals 0. The evaluation formula for calculating the importance weights of extreme gradient boosting for the selected sample data in the ensemble machine learning model using the Garson algorithm is as follows: Where t is the split node in all trees, ΔL t Let represent the improvement in the objective loss function resulting from the t-th split. This indicates an indicator function, which is 1 if variable j was used in the t-th split, and 0 otherwise. T represents the total number of split nodes in the tree. t This represents the variable used in the t-th split.
7. The method according to claim 6, characterized in that, The importance weights of each model are weighted to obtain the overall importance of the sample data, including: The importance weights for each model are weighted as follows: in, Represents variable X i Importance in model m; w m This represents the weights assigned to model m by the ensemble machine learning model, where m is one of the following: elastic network, random forest network, neural network gradient boosting machine, and extreme gradient boosting.
8. A device for predicting the risk of gestational diabetes based on an ensemble machine learning model, characterized in that, The device includes: A sample set construction module is used to construct a sample set; the samples in the sample set include: samples from general hospitals, samples from specialized hospitals, and samples from other hospitals located at a distance from each other; the sample data of the samples are prenatal registration data and blood sample data from early pregnancy; The data processing module is used to perform correlation analysis on the sample data using a correlation algorithm, thereby filtering the sample data; and to calculate the importance weight of each individual model in the ensemble machine learning model for the filtered sample data using the Garson algorithm, and to weight the importance weight of each model to obtain the overall importance of the sample data. The optimal feature subset determination module is used to determine the feature subset of the sample data based on the overall importance, and to determine the optimal feature subset by recursive elimination based on cross-validation. The training and validation module is used to train the ensemble machine learning model using the optimal feature subsets corresponding to the general hospital samples and the specialized hospital samples. The validation process of the ensemble machine learning model includes: performing a first round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples and the specialized hospital samples; performing a second round of validation on the trained ensemble machine learning model using validation samples from the general hospital samples, the specialized hospital samples, and other hospital samples; and performing a third round of validation on the trained ensemble machine learning model using validation samples from other hospital samples. The prediction module is used to output an integrated machine learning model that can predict the risk of gestational diabetes once the preset training completion conditions are met.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.