Diagnosis of type 2 diabetes under environmental metal exposure based on machine learning
By building an XRL classifier on the NHANES data set, combining Random Forest and LightGBM classifiers, and considering the impact of metal exposure in urine and diet, the problem of ignoring the potential impact of metal exposure in the existing technology is solved and improved by 2 Prediction accuracy and classification accuracy of type 2 diabetes.
Patent Information
- Application Number
- CN202310344446.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-03
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2043-04-03
AI Technical Summary
The existing technology ignores the potential impact of metal exposure on type 2 diabetes and does not consider integrating machine learning models with optimal hyperparameters, resulting in a decrease in the prediction accuracy and classification accuracy of the classifier.
Using a method based on the NHANES data set, features were screened through the random forest algorithm, an XRL classifier was constructed by combining XGBoost, random forest, and LightGBM classifiers, and hyperparameters were optimized through a random search algorithm to consider the impact of metal exposure in urine and diet on type 2 Diagnostic analysis of the effects of diabetes.
It improves the prediction accuracy and classification accuracy of type 2 diabetes, promotes lifestyle and dietary intervention, and performs better than the Lasso classifier and the XRL classifier that does not consider metal exposure.
Smart Images

Figure CN116580831B
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of diabetes prediction, and specifically relates to a method for diagnosing type 2 diabetes under environmental metal exposure based on machine learning. Background Art
[0002] Diabetes is a chronic metabolic disease characterized by high blood sugar, which seriously affects the quality of life of patients. Type 2 diabetes is a common metabolic disease, accounting for about 90% of diabetic patients. With the influence of many factors such as living environment, lifestyle, diet structure and drug intervention, the diagnosis and treatment of type 2 diabetes faces extremely severe challenges.
[0003] So far, various machine learning models have become important tools for diagnosing diabetes, identifying hidden diabetes risk biomarkers, and predicting diabetes risk. Generally speaking, these learning models are mainly divided into three categories: (1) basic classifiers, including support vector machines, logistic regression, and lasso regression; (2) common ensemble classifiers, including random forests and extreme gradient boosting trees (XGBoost); (3) voting ensemble classifiers, including soft voting ensemble classifiers and hard voting ensemble classifiers. However, current studies generally use different machine learning models or the same model for feature selection and classification for disease-assisted diagnosis. By combining multiple basic classifiers, ensemble classifiers can reduce the bias and variance of basic classifiers to obtain more accurate prediction results and improve the generalization ability of classifiers. In order to detect the severity of idiopathic pulmonary fibrosis at an early stage, Hee Cheol Kim et al. applied XGBoost, gradient boosting algorithm, and soft voting ensemble model to predict the four stages of idiopathic pulmonary fibrosis exacerbation, respectively, among which the soft voting ensemble classifier performed best in the early prediction of patients with idiopathic pulmonary fibrosis. Xia Yankai et al. used random forest classifier and lasso regression algorithm to select features and establish the optimal model for predicting diabetes. An Dinh et al. used XGBoost to select features for diabetes and cardiovascular data sets and compared the accuracy of logistic regression, support vector machine, random forest and voting ensemble classifiers in detecting patients with diabetes or cardiovascular disease.
[0004] Since the combination of feature selection and machine learning-based ensemble classifiers is an emerging method in diabetes research, and the disease prediction method based on the combination of XGBoost, random forest and LightGBM classifiers with their own optimal hyperparameters into a voting ensemble classifier has not been studied, this patent proposes an ensemble classifier (XRL classifier) based on XGBoost, random forest and LightGBM for potential diagnosis of type 2 diabetes. At the same time, compared with traditional classifiers, the XRL classifier proposed in this patent additionally considers the potential impact of metal exposure in urine and diet on type 2 diabetes. Summary of the invention
[0005] The present application provides a method for diagnosing type 2 diabetes under environmental metal exposure based on machine learning to solve the technical problems in the prior art of ignoring the potential impact of metal exposure and not considering the integration of machine learning models with optimal hyperparameters, resulting in a decrease in the prediction accuracy and classification accuracy of the classifier.
[0006] To solve the above technical problems, a technical solution adopted in the present application is: a method for constructing a diagnostic model for type 2 diabetes under environmental metal exposure, comprising the following steps: based on the NHANES data set, performing data cleaning on the NHANES data set to obtain a first data set; based on the first data set, using a random forest algorithm to screen the features of the first data set to obtain a feature data set; based on the XGBoost classifier, a random forest classifier and a LightGBM classifier, constructing an XRL classifier; based on the XRL classifier and the feature data set, performing diagnostic analysis of type 2 diabetes.
[0007] Furthermore, based on the NHANES data set, a method for performing data cleaning on the NHANES data set to obtain a first data set includes the following steps:
[0008] Based on the NHANES data set, obtain x0 features and multiple samples;
[0009] Based on the sample, obtain the missing data ratio of the feature;
[0010] Based on the missing data ratio of all features, a second data set is obtained;
[0011] Based on the second data set and the valid data range of each feature, filter and obtain abnormal values in the second data set;
[0012] The outliers of the continuous variables are processed by using the mean, and the outliers of the categorical variables are processed by using the mode, to obtain the first data set; wherein the first data set contains x1 features and multiple samples.
[0013] Furthermore, based on the data missing ratio of all features, a method for obtaining a second data set includes: in response to a feature having a data missing ratio of not less than 50%, eliminating the feature; in response to a feature having a data missing ratio of less than 50%, filling the feature missing values of a continuous variable with the mean or filling the feature missing values of a categorical variable with the mode, to obtain the second data set.
[0014] Furthermore, based on the first data set, a method for obtaining a feature data set by screening features of the first data set using a random forest algorithm includes:
[0015] Based on the first data set and the random forest algorithm, obtain the importance scores of x1 features in the first data set and sort them;
[0016] Based on the importance scores of x1 features, retain the first x2 features with higher importance scores and remove other features;
[0017] Based on the random forest algorithm, the importance scores of x2 features are obtained again and sorted;
[0018] Based on the importance score ranking of x2 features, two feature data sets are obtained; one feature data set includes the first x3 features of metal-containing exposures with higher importance scores, and the other feature data set includes the first x3 features of non-metallic exposures; x0>x1>x2>x3.
[0019] Furthermore, based on the XGBoost classifier, the Random Forest classifier and the LightGBM classifier, a method for constructing an XRL classifier includes:
[0020] Based on the feature data set, the samples in the feature data set are divided into a test set and a training set according to a specific ratio;
[0021] Based on the training set, train the XGBoost classifier, random forest classifier, and LightGBM classifier;
[0022] Based on the test set, 5-fold cross validation was performed on the XGBoost classifier, random forest classifier, and LightGBM classifier respectively;
[0023] Based on the random search algorithm, obtain the optimal hyperparameters of XGBoost classifier, random forest classifier and LightGBM classifier;
[0024] Integrate XGBoost classifier, random forest classifier and LightGBM classifier with optimal hyperparameters to build an XRL classifier.
[0025] Furthermore, a method for diagnosing and analyzing type 2 diabetes based on the XRL classifier and the feature data set includes:
[0026] Based on the AUC values of XGBoost classifier, Random Forest classifier and LightGBM classifier with optimal hyperparameters, the weights of each classifier are calculated;
[0027] Based on the weights of each classifier, the weighted average predicted probabilities of having type 2 diabetes and not having type 2 diabetes were calculated respectively;
[0028] Based on the weighted average predicted probability, the weighted average predicted probabilities of those with type 2 diabetes and those without type 2 diabetes are sorted to obtain the sequence number with the highest weighted average predicted probability.
[0029] Further, the method of calculating the weights of various classifiers includes:
[0030] The weight is calculated according to formula (1), where formula (1) is:
[0031]
[0032] Among them, W m is the weight value of classifier m, AUC m is the true positive rate of type 2 diabetes under classifier m, m = 1, 2, 3, m = 1 represents XGBoost classifier, m = 2 represents random forest classifier, and m = 3 represents LightGBM classifier.
[0033] Furthermore, based on the weights of various classifiers, a method for calculating the weighted average predicted probabilities of having type 2 diabetes and not having type 2 diabetes includes:
[0034] The weighted average predicted probability is calculated according to formula (2), where formula (2) is:
[0035]
[0036] Among them, P n is the weighted average predicted probability under state n, p mn is the predicted probability of state n under classifier m, n=1 indicates that the patient suffers from type 2 diabetes, and n=0 indicates that the patient does not suffer from type 2 diabetes.
[0037] Furthermore, based on the weighted average predicted probability, the weighted average predicted probabilities of patients with type 2 diabetes and patients without type 2 diabetes are sorted to obtain the sequence number with the highest weighted average predicted probability, including:
[0038] According to formula (3), the sequence number with the highest weighted average prediction probability is calculated. Formula (3) is:
[0039]
[0040] Among them, k is the serial number with the highest weighted average predicted probability. If k=1, it means that the patient suffers from type 2 diabetes, and if k=0, it means that the patient does not suffer from type 2 diabetes.
[0041] The beneficial effects of the present application are as follows: the present application uses a random search algorithm and 5-fold cross validation to train three machine learning classifiers, namely XGBoost, Random Forest and LightGBM, and constructs the XGBoost, Random Forest and LightGBM classifiers with optimal hyperparameters as XRL classifiers according to the corresponding weights calculated from their AUC values, while additionally considering the potential effects of metal exposure in urine and diet on type 2 diabetes. Compared with the Lasso classifier and the XRL classifier that does not consider metal exposure, the XRL classifier that considers metal exposure proposed in the present application improves the prediction accuracy and classification accuracy of type 2 diabetes, thereby promoting lifestyle and dietary intervention in type 2 diabetes. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a flow chart of an embodiment of a method for constructing a type 2 diabetes diagnostic model under environmental metal exposure of the present application;
[0043] Figure 2 for Figure 1 A schematic flow chart of an embodiment of step S1 in FIG.
[0044] Figure 3 for Figure 2 A schematic flow chart of an embodiment of step S13 in FIG.
[0045] Figure 4 for Figure 1 A schematic flow chart of an embodiment of step S2 in FIG.
[0046] Figure 5 for Figure 1 A schematic flow chart of an embodiment of step S3 in FIG.
[0047] Figure 6 for Figure 1 A schematic flow chart of an embodiment of step S4 in FIG.
[0048] Figure 7 It is a ROC curve diagram of an XRL classifier containing metal exposure and an XRL classifier without metal exposure in an embodiment of the method for constructing a diagnostic model for type 2 diabetes under environmental metal exposure of the present application;
[0049] Figure 8 This is a ROC curve diagram of the XRL classifier and the Lasso classifier in an embodiment of the method for constructing a diagnostic model for type 2 diabetes under environmental metal exposure of the present application. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0051] See also Figure 1 , Figure 1 1 is a flow chart of an embodiment of a method for constructing a type 2 diabetes diagnostic model under environmental metal exposure of the present application. The method comprises the following steps:
[0052] Step S1. Based on the NHANES data set, data cleaning is performed on the NHANES data set to obtain a first data set.
[0053] For details, see Figure 2 , Figure 2 for Figure 1 A flow chart of an embodiment of step S1 in FIG. 1 . Step S1 includes:
[0054] Step S11. Based on the NHANES data set, obtain x0 features and multiple samples.
[0055] Specifically, this application obtains the NHANES dataset from 2005 to 2016 from the official website of the National Center for Health Statistics, which contains 3,900 features and 14,950 samples.
[0056] Step S12: Based on the sample, obtain the data missing ratio of the feature.
[0057] Specifically, the missing data ratio η of all features in each sample in the NHANES dataset is calculated i , i=1,2,…,3900.
[0058] Step S13: Based on the data missing ratio of all features, obtain a second data set.
[0059] Specifically, the second data set is a data set in which missing feature data has been completed.
[0060] Determine the missing data ratio η of each feature i Is it less than 50%.
[0061] See also Figure 3 , Figure 3 for Figure 2 FIG. 1 is a flow chart of an embodiment of step S13 in FIG. 1 .
[0062] Step S131: In response to the fact that the data missing ratio of a feature is not less than 50%, the feature is eliminated.
[0063] Specifically, if the data missing ratio η of the sample characteristics i If it is not less than 50%, the i-th feature item is directly eliminated.
[0064] Step S132: In response to the missing data ratio of the feature being less than 50%, the missing feature values of the continuous variable are filled with the mean or the missing feature values of the categorical variable are filled with the mode to obtain a second data set with a smaller missing data ratio.
[0065] Specifically, if η i If the missing value is less than 50%, the missing value of the continuous variable is filled with the mean value in the corresponding feature data, and the missing value of the categorical variable is filled with the mode value in the corresponding feature data.
[0066] Step S14: Based on the valid data range of each feature, filter and obtain abnormal values in the second data set.
[0067] Specifically, outliers of feature items are screened according to valid data ranges of each feature item in;
[0068] Step S15. Use the mean to process the outliers of the continuous variable, and use the mode to process the outliers of the categorical variable, to obtain a first data set; wherein the first data set contains x1 features and multiple samples.
[0069] Specifically, the outliers of continuous variables and categorical variables are processed using the mean and mode of the corresponding outliers, respectively. The first cleaned data set is obtained, which contains 102 features and 14,950 samples.
[0070] In this embodiment, the method of mean processing is to calculate the characteristic value of the continuous variable, calculate the average of the characteristic data corresponding to the item, and use the average as the missing value or abnormal value obtained by processing. For example, if the missing data of the patient is the patient's age data, the average age of all patients is used as the patient's age data.
[0071] When processing the characteristic value of a categorical variable by mode, the corresponding characteristic data with the highest frequency is selected as the processed value. For example, if the patient's education level is missing, the level with the highest frequency among all the patient's education levels is taken as the patient's education level.
[0072] Step S2: Based on the first data set, use the random forest algorithm to screen the features of the first data set to obtain a feature data set.
[0073] For details, see Figure 4 , Figure 4 for Figure 1 Schematic diagram of the process of step S2 in an embodiment. Step S2 includes:
[0074] S21. Based on the first data set and the random forest algorithm, obtain the importance scores of the x1 features in each and sort them.
[0075] Specifically, the importance scores w of the 102 features in the first data set after cleaning are calculated using the random forest algorithm. j And sort them, j=1,2,…,102.
[0076] S22. Based on the importance scores of the features, retain the first x2 features with higher importance scores and eliminate other features.
[0077] Specifically, the importance scores of all features are comprehensively compared, the first 51 features with higher importance scores are retained, and the remaining 51 feature items are eliminated.
[0078] S23. Based on the random forest algorithm, the importance scores of x2 features are obtained again and sorted.
[0079] Specifically, the random forest algorithm is used again to calculate the importance scores h of the remaining 51 features. k And sort, k = 1, 2, ..., 51.
[0080] S24. Based on the importance score ranking of x2 features, two feature data sets are obtained; wherein one feature data set includes the first x3 features of metal-containing exposures with higher importance scores, and the other feature data set includes the first x3 features of non-metal-containing exposures. Wherein, x0>x1>x2>x3.
[0081] Specifically, the 51 features were ranked according to their importance scores, and the top 15 features containing metal exposures and the top 15 features without metal exposures with higher importance scores were retained, and the remaining 36 feature items were eliminated.
[0082] Step S3. Construct an XRL classifier based on the XGBoost classifier, the Random Forest classifier and the LightGBM classifier.
[0083] For details, see Figure 5 , Figure 5 for Figure 1 Schematic diagram of the process of step S3 of an embodiment. Step S3 includes:
[0084] Step S31: Based on the feature data set, samples in the feature data set are divided into a test set and a training set according to a specific ratio.
[0085] Specifically, in this embodiment, samples in a data set containing 15 features are divided into a test set and a training set at a ratio of 2:8.
[0086] Step S32. Based on the training set, train the XGBoost classifier, the random forest classifier and the LightGBM classifier.
[0087] Specifically, the data in the training set is input into the XGBoost classifier, the random forest classifier, and the LightGBM classifier, and each classifier is trained.
[0088] Step S33. Based on the test set, perform 5-fold cross validation on the XGBoost classifier, random forest classifier, and LightGBM classifier respectively.
[0089] Specifically, the feature data in the test set is input into the trained XGBoost classifier, random forest classifier, and LightGBM classifier, and a 5-fold cross validation is performed.
[0090] Step S34. Based on the random search algorithm, obtain the optimal hyperparameters of the XGBoost classifier, the random forest classifier, and the LightGBM classifier.
[0091] Specifically, the random search algorithm is used to find the optimal hyperparameters of the above three machine learning classifiers respectively, and the XGBoost classifier, random forest classifier and LightGBM classifier with the optimal hyperparameters are obtained.
[0092] Step S35. Integrate the XGBoost classifier, random forest classifier and LightGBM classifier with optimal hyperparameters to construct an XRL classifier.
[0093] Specifically, an XGBoost classifier, a random forest classifier, and a LightGBM classifier with optimal hyperparameters are integrated and an XRL classifier is constructed.
[0094] Step S4: Perform type 2 diabetes diagnosis analysis based on the XRL classifier and feature data set.
[0095] For details, see Figure 6 , Figure 6 for Figure 1 The flowchart of step S4 in the embodiment of FIG. 3 includes:
[0096] Step S41. Based on the AUC values of the XGBoost classifier, random forest classifier, and LightGBM classifier with the optimal hyperparameters, the weights of each classifier are calculated.
[0097] Specifically, the weight of each classifier is calculated according to the AUC value of each machine learning classifier with the optimal hyperparameters.
[0098] The weight is calculated according to formula (1), where formula (1) is:
[0099]
[0100] Among them, W m is the weight value of classifier m, AUC m is the true positive rate of type 2 diabetes under classifier m, m = 1, 2, 3, m = 1 represents XGBoost classifier, m = 2 represents random forest classifier, and m = 3 represents LightGBM classifier.
[0101] Step S42: Based on the weights of various classifiers, the weighted average predicted probabilities of suffering from type 2 diabetes and not suffering from type 2 diabetes are calculated respectively.
[0102] Specifically, according to the calculated weights of each classifier, the weighted average predicted probability P of having type 2 diabetes and not having type 2 diabetes is calculated according to formula (2): n . Formula (2) is:
[0103]
[0104] Among them, P n is the weighted average predicted probability under state n, p mn is the predicted probability of state n under classifier m, n=1 indicates that the patient suffers from type 2 diabetes, and n=0 indicates that the patient does not suffer from type 2 diabetes.
[0105] Step S43: Based on the weighted average predicted probability, the weighted average predicted probabilities of patients with type 2 diabetes and patients without type 2 diabetes are sorted to obtain the sequence number with the highest weighted average predicted probability.
[0106] Specifically, the weighted average predicted probabilities of patients with type 2 diabetes and patients without type 2 diabetes are compared and ranked, and according to formula (3), the sequence number k with the highest weighted average predicted probability is obtained;
[0107]
[0108] Among them, k is the serial number with the highest weighted average predicted probability. If k=1, it means that the patient suffers from type 2 diabetes, and if k=0, it means that the patient does not suffer from type 2 diabetes.
[0109] This application uses a random search algorithm and 5-fold cross validation to train three machine learning classifiers, XGBoost, Random Forest, and LightGBM, and constructs the XGBoost, Random Forest, and LightGBM classifiers with optimal hyperparameters as XRL classifiers based on the corresponding weights calculated from their AUC values, while additionally considering the potential effects of metal exposure in urine and diet on type 2 diabetes. Compared with the Lasso classifier and the XRL classifier that does not consider metal exposure, the XRL classifier that considers metal exposure proposed in this application improves the prediction accuracy and classification accuracy of type 2 diabetes, thereby promoting lifestyle and dietary intervention in type 2 diabetes.
[0110] In order to verify the effect of this embodiment, MATLAB is used to perform numerical simulation verification.
[0111] The 15 features (including metal exposures) closely related to type 2 diabetes screened in this implementation are shown in Table 1:
[0112] Table 1 shows 15 characteristics (including metal exposures) that are closely related to type 2 diabetes.
[0113] Importance Ranking feature Importance Ranking feature Importance Ranking feature 1 Total sugar 6 Race / Ethnicity 11 Urine Mercury 2 weight 7 blood pressure 12 Creatinine 3 age 8 Alcohol 13 carbohydrate 4 waistline 9 α-Carotene 14 protein 5 Dietary Copper 10 Urine Cadmium 15 Sleep time
[0114] The 15 features closely related to type 2 diabetes screened in this implementation (excluding metal exposures) are shown in Table 2:
[0115] Table 2 shows 15 characteristics that are closely related to type 2 diabetes (excluding metal exposure).
[0116] Importance Ranking feature Importance Ranking feature Importance Ranking feature 1 Total sugar 6 Race / Ethnicity 11 Body Mass Index 2 weight 7 Alcohol 12 carbohydrate 3 age 8 α-Carotene 13 protein 4 waistline 9 Sleep time 14 Retinol 5 blood pressure 10 Creatinine 15 Education level
[0117] In this implementation, the evaluation results of the XGBoost classifier, random forest classifier, LightGBM classifier and XRL classifier considering metal exposure on the test set are shown in Table 3:
[0118] Table 2 shows the evaluation results of each classifier on the test set.
[0119] Classifier Accuracy Precision Recall F1-Score AUC XGBoost Classifier 0.8564 0.8721 0.8509 0.9218 0.811 Random Forest Classifier 0.8109 0.8756 0.9032 0.9223 0.803 LightGBM Classifier 0.8751 0.8807 0.9113 0.9228 0.816 XRL Classifier 0.8846 0.8823 0.9281 0.9232 0.832
[0120] Figure 7: This is the ROC curve of the XRL classifier that considers metal exposure and the XRL classifier that does not consider metal exposure in this embodiment. The AUC value of the XRL classifier that does not consider metal exposure is 0.772, while the AUC value of the XRL classifier that considers metal exposure is 0.832. The results show that the performance of the integrated classifier that considers metal exposure is better than that of the integrated classifier that does not consider metal exposure. It can be seen that the XRL classifier that considers metal exposure proposed in this embodiment makes an important contribution to the potential diagnosis of type 2 diabetes.
[0121] Figure 8 The figure is a ROC curve diagram of the XRL classifier and the Lasso classifier considering metal exposure in this embodiment. The AUC value of the Lasso classifier is 0.78, while the AUC value of the XRL classifier considering metal exposure is 0.844. The results show that the performance of the XRL integrated classifier considering metal exposure proposed in this embodiment is better than that of the Lasso classifier. It can be seen that the feature screening method designed in this embodiment and the XRL classifier considering metal exposure provide a new method for quantifying the potential impact of metal exposure on type 2 diabetes.
[0122] The above description is only an embodiment of the present application and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for constructing a diagnostic model for type 2 diabetes under environmental metal exposure, characterized in that: The following steps are involved: Based on the NHANES data set, performing data cleaning on the NHANES data set to obtain a first data set; Based on the first data set, the features of the first data set are screened using a random forest algorithm and a ranking of feature importance scores to obtain two feature data sets; wherein one of the feature data sets includes the top x3 features of metal-containing exposures with higher importance scores, and the other data set includes the top x3 features of metal-free exposures; Construct XRL classifier based on XGBoost classifier, random forest classifier and LightGBM classifier; Based on the XRL classifier and the feature data set, a type 2 diabetes diagnosis analysis is performed.
2. The method according to claim 1, characterized in that The method of performing data cleaning on the NHANES data set to obtain a first data set based on the NHANES data set comprises the following steps: Based on the NHANES data set, x0 features and multiple samples are obtained; Based on the sample, obtaining the data missing ratio of the feature; Based on the data missing ratios of all the features, obtaining a second data set; Based on the second data set and the valid data range of each feature, filter and obtain abnormal values in the second data set; The outliers of the continuous variables are processed using the mean, and the outliers of the categorical variables are processed using the mode, to obtain the first data set; wherein the first data set includes x1 features and multiple samples.
3. The method according to claim 2, characterized in that The method for obtaining the second data set based on the data missing ratio of all the features includes: In response to the missing data ratio of the feature being no less than 50%, removing the feature; In response to the missing data ratio of the feature being less than 50%, the missing feature values of the continuous variable are filled with the mean or the missing feature values of the categorical variable are filled with the mode, and a second data set is obtained.
4. The method according to claim 2, characterized in that: The method of obtaining two feature data sets by screening features of the first data set using a random forest algorithm and ranking of feature importance scores based on the first data set includes: Based on the first data set and the random forest algorithm, obtain importance scores of x1 features in the first data set and sort them; Based on the importance scores of the x1 features, retain the first x2 features with higher importance scores and eliminate other features; Based on the random forest algorithm, the importance scores of the x2 features are obtained again and sorted; Based on the importance score ranking of the x2 features, two feature data sets are obtained; wherein one feature data set includes the first x3 features of metal-containing exposures with higher importance scores, and the other data set includes the first x3 features of no metal exposures; x0>x1>x2>x3.
5. The method according to claim 4, characterized in that The method for constructing an XRL classifier based on the XGBoost classifier, the random forest classifier and the LightGBM classifier includes: Based on the feature data set, dividing the samples in the feature data set into a test set and a training set according to a specific ratio; Based on the training set, the XGBoost classifier, the random forest classifier and the LightGBM classifier are trained; Based on the test set, a 5-fold cross validation is performed on the XGBoost classifier, the random forest classifier, and the LightGBM classifier respectively; Based on a random search algorithm, the optimal hyperparameters of the XGBoost classifier, the random forest classifier, and the LightGBM classifier are obtained; The XGBoost classifier, the random forest classifier and the LightGBM classifier with optimal hyperparameters are integrated to construct the XRL classifier.
6. The method according to claim 5, characterized in that The method for performing type 2 diabetes diagnosis and analysis based on the XRL classifier and the feature data set comprises: Based on the AUC values of the XGBoost classifier, the random forest classifier, and the LightGBM classifier with optimal hyperparameters, the weights of each classifier are calculated; Based on the weights of each classifier, the weighted average predicted probabilities of having type 2 diabetes and not having type 2 diabetes were calculated respectively; Based on the weighted average predicted probability, the weighted average predicted probabilities of patients with type 2 diabetes and patients without type 2 diabetes are sorted to obtain a sequence number with the highest weighted average predicted probability.
7. The method according to claim 6, characterized in that The method for calculating the weights of various classifiers includes: The weight is calculated according to formula (1), where formula (1) is: Among them, W m is the weight value of classifier m, AUC m is the true positive rate of type 2 diabetes under classifier m, m = 1, 2, 3, m = 1 represents XGBoost classifier, m = 2 represents random forest classifier, and m = 3 represents LightGBM classifier.
8. The method according to claim 7, characterized in that The method for calculating the weighted average predicted probabilities of suffering from type 2 diabetes and not suffering from type 2 diabetes based on the weights of various classifiers, respectively, comprises: The weighted average predicted probability is calculated according to formula (2), where formula (2) is: Among them, P n is the weighted average predicted probability under state n, p mn is the predicted probability of state n under classifier m, n=1 indicates that the patient suffers from type 2 diabetes, and n=0 indicates that the patient does not suffer from type 2 diabetes.
9. The method according to claim 8, characterized in that The method of sorting the weighted average predicted probabilities of patients with type 2 diabetes and patients without type 2 diabetes based on the weighted average predicted probability to obtain the sequence number with the highest weighted average predicted probability includes: The number of the important feature with the highest weighted average prediction probability is calculated according to formula (3), which is: Among them, k is the serial number with the highest weighted average predicted probability. If k=1, it means that the patient suffers from type 2 diabetes, and if k=0, it means that the patient does not suffer from type 2 diabetes.
