Chronic kidney disease occurrence risk prediction method based on random survival forest method
By combining the random survival forest method with Lasso regression and weighted log-rank statistics, a chronic kidney disease risk prediction model was constructed. This model addresses the problem of existing models neglecting the information of onset time, achieving high accuracy and interpretability in CKD risk prediction, and supporting early identification of high-risk groups and individualized intervention.
Patent Information
- Application Number
- CN202511310238.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-15
- Publication Date
- 2025-12-30
AI Technical Summary
Most existing chronic kidney disease (CKD) risk prediction models focus on predicting mid-to-late stage progression or are limited to cross-sectional analysis, ignoring information on the onset time, resulting in high false positive rates, poor accuracy, and difficulty in early identification of high-risk groups.
We adopted the random survival forest method combined with Lasso regression. By constructing a multi-source variable dataset, we used the weighted log-rank statistic to divide the nodes and build a random survival forest model. We combined the SHAP value to explain the contribution of variables, set the optimal cutoff value for risk stratification, and generated Kaplan-Meier curves for inter-group comparisons.
It achieves high accuracy and high interpretability in CKD risk prediction, enabling early identification of high-risk groups, providing individualized intervention strategies, and improving the model's calibration performance and risk stratification management capabilities.
Smart Images

Figure CN121237404A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of disease risk prediction technology, and in particular to a method for predicting the risk of chronic kidney disease based on the random survival forest method. Background Technology
[0003] Chronic kidney disease (CKD) often progresses insidiously in its early stages, lacking obvious symptoms and frequently only being discovered in its end-stage, requiring costly treatments such as dialysis or kidney transplantation. Current disease awareness and screening rates remain low, delaying timely intervention for high-risk groups. In recent years, machine learning (ML), as an important branch of artificial intelligence, has shown significant advantages in handling nonlinear relationships, multivariate interactions, and time-to-event data, and has been widely applied in chronic disease risk prediction research. While some researchers have used ML methods to build CKD-related models, most focus on predicting the progression of mid-to-late-stage CKD or are limited to cross-sectional analyses of intractable survival data, neglecting information about the timing of disease onset. Furthermore, most existing models determine CKD outcomes based on single test results, which can easily lead to false positives and affect model accuracy.
[0004] Patent application CN117542504A discloses a method for constructing a prediction model for chronic kidney disease, a prediction system, and its application. It uses cross-sectional data and traditional logistic regression to screen variables, and finally constructs a scoring model based on decision trees and generalized linear models. However, the model construction does not consider the onset time information or process time-dependent information, and is not suitable for survival data modeling.
[0005] Therefore, how to provide a method for predicting the risk of chronic kidney disease based on the random survival forest method is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a method for predicting the risk of chronic kidney disease based on the random survival forest method. This invention combines the random survival forest method in machine learning with real-world follow-up data to construct a model for predicting the risk of chronic kidney disease. It overcomes the limitations of traditional linear modeling, effectively captures nonlinear relationships and interactions between variables, and has the advantages of high accuracy, high interpretability, and good calibration performance. It can provide a scientific basis for early identification of high-risk groups and the development of individualized intervention strategies, and has important clinical promotion and public health application value.
[0007] The method for predicting the risk of chronic kidney disease based on the random survival forest method according to embodiments of the present invention includes the following steps:
[0008] Step 1: Obtain historical physical examination data of the target population, screen out individuals who do not meet the inclusion criteria, and obtain the research sample;
[0009] Step 2: Extract multi-source variable data related to individual health status from the research sample and construct a candidate variable set;
[0010] Step 3: Estimate the glomerular filtration rate based on two consecutive physical examinations, ensuring it is below 60 mL / min / 1.73 m³ / min. 2 Or, a positive urine protein test defines a chronic kidney disease event, and the follow-up time is calculated.
[0011] Step 4: Use the random forest imputation method to fill in the missing values of the candidate variable set to obtain the complete variable set, and divide it into training set and test set;
[0012] Step 5: Apply Lasso regression and random survival forest methods to the training set for feature selection, extract the intersection variables, and form the final modeling variables;
[0013] Step 6: Based on the follow-up time and the final modeling variables, use the weighted log-rank statistic to partition the nodes and construct a random survival forest model;
[0014] Step 7: Use the random survival forest model to predict the test set, evaluate the C-index, AUC and calibration performance, calculate the SHAP value of the final modeling variables, and explain the positive and negative contributions of each final modeling variable to the prediction results.
[0015] Step 8: Based on the individual risk scores output by the random survival forest model, set the optimal cutoff value, divide the research sample into high-risk and low-risk groups, and generate Kaplan-Meier curves for inter-group comparison.
[0016] Optionally, the target population refers to individuals who have completed at least three physical examinations within a specified preset time range and are no less than 45 years old, with the first physical examination serving as the baseline to construct a dynamic queue.
[0017] Optionally, the individuals who do not meet the inclusion criteria specifically include:
[0018] Individuals lacking baseline serum creatinine or urinary protein data;
[0019] Individuals for whom follow-up information is missing;
[0020] The baseline estimated glomerular filtration rate was less than 60 mL / min / 1.73 m³. 2 Or individuals with urine protein levels of 1+ or higher;
[0021] Individuals who report a history of malignant tumors or kidney disease at baseline, or whose kidney ultrasound examination indicates a history of kidney disease, including kidney stones, hydronephrosis, kidney tumors, kidney transplantation, or solitary kidney;
[0022] Individuals whose candidate variables are missing more than 20% (more than 9 out of 44 variables are missing).
[0023] Optionally, the multi-source variable data specifically includes demographic characteristics variables, physical measurement variables, laboratory test indicators, composite indicator variables, and imaging examination variables;
[0024] The demographic variables include sex, age, medical history, and smoking and drinking history;
[0025] The physical measurement variables include height, weight, waist circumference, systolic blood pressure and diastolic blood pressure, and the body mass index is calculated based on height and weight;
[0026] The laboratory test indicators include fasting blood glucose, total cholesterol, triglycerides, high-density lipoprotein cholesterol, low-density lipoprotein cholesterol, serum uric acid, serum creatinine, urea, white blood cells, neutrophil percentage, lymphocyte percentage, monocyte percentage, eosinophil percentage, basophil percentage, absolute neutrophil count, absolute lymphocyte count, absolute monocyte count, absolute eosinophil count, absolute basophil count, red blood cells, hemoglobin, hematocrit, mean corpuscular volume, mean corpuscular hemoglobin, platelets, alanine aminotransferase, aspartate aminotransferase, albumin, gamma-glutamyl transferase, and proteinuria.
[0027] The composite index variables include the triglyceride-glucose index and the systemic immune inflammation index;
[0028] The imaging variables include diagnostic information from renal ultrasound.
[0029] Optionally, the follow-up period is from the baseline physical examination date to the date of the first determination of a chronic kidney disease event. If no chronic kidney disease event occurs, the follow-up period ends on the date of the last physical examination.
[0030] Optionally, step four specifically involves:
[0031] Obtain a set of candidate variables, identify each variable with missing values as the current imputation target variable, and use all variables without missing values as input variables;
[0032] For each imputation target variable, extract samples with complete values from the imputation target variable to construct a training subset, and use the training subset as training data to perform modeling, including:
[0033] A training subset is formed by sampling a predetermined proportion of samples from the training subset with replacement, wherein the predetermined proportion is between 60% and 80% of the total sample size.
[0034] In each tree construction process, a preset number of variables are randomly selected from all input variables as candidate partitioning features, where the preset number is the square root of the number of input variables.
[0035] Based on the training subsample set and the candidate splitting features, a decision tree is constructed, and the variance minimization is used as the splitting criterion for splitting until the stopping condition is met. The stopping condition includes the tree depth reaching a set upper limit or the number of leaf node samples falling below a set threshold.
[0036] Construct several decision trees to form a forest model with a multi-decision-tree structure;
[0037] The constructed forest model is used to predict the training subsamples corresponding to the missing values of the imputation target variable. During the prediction process, each decision tree independently generates the prediction result, and the majority voting method or the mean method is used to integrate all the results to obtain the imputation value.
[0038] The interpolation rounds are repeated throughout the interpolation process until the average absolute change between the interpolation results of two consecutive interpolation rounds is less than the preset convergence threshold, at which point the final interpolation is completed.
[0039] The candidate variable set after final imputation is taken as the complete variable set, and the complete variable set is randomly divided into training set and test set in a ratio of 7:3.
[0040] Optionally, step five specifically includes:
[0041] In the training set, all variables in the complete variable set are used as independent variables to input Lasso regression. Under the condition of applying L1 norm constraints, regression coefficient compression is performed. A corresponding fitting function is constructed for each candidate penalty coefficient. The average prediction error under each penalty coefficient is evaluated by K-fold cross-validation. The penalty coefficient λ value corresponding to the smallest prediction error is selected. Variables with non-zero regression coefficients under the penalty coefficient λ value are extracted to obtain the Lasso regression screening variable set.
[0042] In the training set, sampling with replacement is used to randomly sample all variables multiple times to construct several subsets of variables, and a binary survival tree population is constructed in each subset of variables.
[0043] Each variable is perturbed individually, and the observed values of the variable are randomly shuffled in the out-of-bag samples while keeping other variables unchanged. The prediction is then performed again, and the difference in prediction error before and after the perturbation is calculated as the VIMP value of the variable.
[0044] All variables are sorted in descending order based on their VIMP values, and the top N variables by VIMP value are selected to form the set of variables for random survival forest selection.
[0045] The intersection of the Lasso regression selection variable set and the random survival forest selection variable set is taken, and the variables selected by both methods are retained as the final modeling variables.
[0046] Optionally, step six specifically includes:
[0047] Based on the final modeling variables, multiple subsets of samples are randomly generated using sampling with replacement.
[0048] In each subsample set, a decision tree structure is constructed using a binary splitting approach, taking into account the follow-up time and outcome status of each sample.
[0049] At each split node of each binary decision tree, several variables are randomly selected from the final modeling variables as candidate split variables;
[0050] For each candidate splitting variable, the samples within a node are divided into two subgroups based on the numerical range or value category.
[0051] For the partitioning results, a weighted log-rank statistic is calculated based on the corresponding follow-up time and outcome status. In the process of calculating the log-rank statistic, a weighting function is introduced to weight the risk set at each time point, so that the survival information at different time points contributes differently to the statistic.
[0052] Compare the weighted log-rank statistics of all candidate splitting variables, select the variable with the largest weighted log-rank statistics and the splitting point as the basis for splitting the current node, until the depth of the tree reaches the set maximum level limit, or the number of samples contained in the current leaf node is lower than the set minimum number of samples threshold, and complete the construction of the random survival forest model.
[0053] Optionally, step seven specifically includes:
[0054] In the test set, the predicted probability of each individual experiencing a chronic kidney disease event at a set time point was calculated based on the random survival forest model, and the risk ranking corresponding to the predicted probability was recorded.
[0055] The predicted probabilities were compared with the actual follow-up outcomes of individuals, and the C-index was used to evaluate the correct prediction rate among all paired comparisons, quantifying the degree of consistency between the prediction results and the actual time sequence.
[0056] Plot the receiver operating characteristic (ROC) curve and calculate the area under the ROC curve (AUC) using numerical integration to evaluate predictive performance.
[0057] Calculate the average predicted probability value and the actual incidence of chronic kidney disease events within each predicted probability segment, plot the mapping curve between the predicted value and the actual value, and form a calibration curve to reflect the difference between the predicted value and the observed value of the random survival forest model.
[0058] The final modeling variables are perturbed sequentially in the sample individuals, while keeping the values of the other variables unchanged. The changes in the predicted probability before and after the perturbation are recorded, and the Shapley additive interpretation method is used to obtain the SHAP value corresponding to each variable.
[0059] The SHAP values of all variables are averaged to extract the positive and negative contributions and magnitudes of each variable to the prediction of increased or decreased risk.
[0060] Optionally, step eight specifically includes:
[0061] In the test set, the risk probability of each individual developing chronic kidney disease within a set time point is obtained, and the optimal cutoff value is obtained by the maximum log-rank test. The maximum log-rank test is used in tumor research to analyze the relationship between the expression level of a certain gene and the survival time of patients. Specifically, the surv_cutpoint function in the survminer package of R language is used to specify the survival time and event variables and calculate the optimal cutoff value of continuous variables.
[0062] The study sample was divided into a high-risk group and a low-risk group based on the optimal cutoff value. The high-risk group consisted of individuals whose risk scores were greater than or equal to the optimal cutoff value, and the low-risk group consisted of individuals whose risk scores were less than the optimal cutoff value.
[0063] Kaplan-Meier survival curves were constructed for the high-risk group and the low-risk group respectively. Based on the follow-up time and event occurrence status of each group, the survival probability of each group was calculated at each time point. By comparing and analyzing the differences between the Kaplan-Meier survival curves of the two groups, the ability of the individual risk score output by the random survival forest model to distinguish the risk in the group risk stratification was reflected.
[0064] The beneficial effects of this invention are:
[0065] This invention constructs a final modeling variable set that integrates Lasso regression and random survival forest dual screening based on CKD events defined by two consecutive physical examinations and real-world healthy population cohort data. Addressing the problems of traditional models neglecting survival time information, variable selection being limited by linear assumptions, and poor model interpretability, this invention uses a weighted log-rank statistic to divide nodes. By constructing a random survival forest structure with nonlinear discriminative capabilities, multiple binary survival trees are built during the training phase using sampling with replacement. Joint variable perturbation generates the VIMP index to quantitatively assess the contribution of variables to predictive ability. Branch stability is improved by maximizing inter-group survival differences. During the prediction phase, the risk score function learned from the training set is used to assess the risk of the test set samples. The positive and negative contributions of the modeling variables are calculated using the SHAP value. AUC and calibration curves are introduced to jointly evaluate model performance. Thresholds are set based on the risk score to group samples into high- and low-risk groups. Kaplan-Meier curves are used to analyze inter-group risk differences, effectively achieving accurate identification and risk stratification management of high-risk CKD individuals. Attached Figure Description
[0066] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0067] Figure 1 This is an overall flowchart of the chronic kidney disease risk prediction method based on the random survival forest method proposed in this invention;
[0068] Figure 2 This is a plot showing the Lasso regression cross-validation adjusted penalty coefficient for the chronic kidney disease risk prediction method based on the random survival forest method proposed in this invention.
[0069] Figure 3 This is a SHAP bar chart showing the feature importance of the CKD prediction model based on the random survival forest method proposed in this invention.
[0070] Figure 4 This is a summary diagram of the SHAP global interpretation of the CKD prediction model based on the random survival forest method proposed in this invention.
[0071] Figure 5 The Kaplan-Meier curve of the predicted risk score of the RSF model, which is the training set of the chronic kidney disease risk prediction method based on the random survival forest method proposed in this invention;
[0072] Figure 6This is a Kaplan-Meier curve of the predicted risk score of the RSF model for the chronic kidney disease risk prediction method based on the random survival forest method proposed in this invention. Detailed Implementation
[0073] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0074] refer to Figure 1 A method for predicting the risk of chronic kidney disease based on the random survival forest method includes the following steps:
[0075] Step 1: Obtain historical physical examination data of the target population, screen out individuals who do not meet the inclusion criteria, and obtain the research sample;
[0076] Step 2: Extract multi-source variable data related to individual health status from the research sample and construct a candidate variable set;
[0077] Step 3: Estimate the glomerular filtration rate based on two consecutive physical examinations, ensuring it is below 60 mL / min / 1.73 m³ / min. 2 Or, a positive urine protein test defines a chronic kidney disease event, and the follow-up time is calculated.
[0078] Step 4: Use the random forest imputation method to fill in the missing values of the candidate variable set to obtain the complete variable set, and divide it into training set and test set;
[0079] Step 5: Apply Lasso regression and random survival forest methods to the training set for feature selection, extract the intersection variables, and form the final modeling variables;
[0080] Step 6: Based on the follow-up time and the final modeling variables, use the weighted log-rank statistic to partition the nodes and construct a random survival forest model;
[0081] Step 7: Use the random survival forest model to predict the test set, evaluate the C-index, AUC and calibration performance, calculate the SHAP value of the final modeling variables, and explain the positive and negative contributions of each final modeling variable to the prediction results.
[0082] Step 8: Based on the individual risk scores output by the random survival forest model, set the optimal cutoff value, divide the research sample into high-risk and low-risk groups, and generate Kaplan-Meier curves for inter-group comparison.
[0083] In this embodiment, the target population refers to individuals who have completed at least three physical examinations within a specified preset time range and are no less than 45 years old, with the first physical examination serving as the baseline to construct a dynamic queue.
[0084] In this embodiment, the individuals who do not meet the inclusion criteria specifically include:
[0085] Individuals lacking baseline serum creatinine or urinary protein data;
[0086] Individuals for whom follow-up information is missing;
[0087] The baseline estimated glomerular filtration rate was less than 60 mL / min / 1.73 m³. 2 Or individuals with urine protein levels of 1+ or higher;
[0088] Individuals who report a history of malignant tumors or kidney disease at baseline, or whose kidney ultrasound examination indicates a history of kidney disease, including kidney stones, hydronephrosis, kidney tumors, kidney transplantation, or solitary kidney;
[0089] Individuals whose candidate variables are missing more than 20% (more than 9 out of 44 variables are missing).
[0090] In this embodiment, the multi-source variable data specifically includes demographic characteristic variables, physical measurement variables, laboratory test indicators, composite indicator variables, and imaging examination variables;
[0091] The demographic variables include sex, age, medical history, and smoking and drinking history;
[0092] The physical measurement variables include height, weight, waist circumference, systolic blood pressure and diastolic blood pressure, and the body mass index is calculated based on height and weight;
[0093] Body Mass Index (BMI) = weight / height², unit: kg / m² 2 ;
[0094] The laboratory test indicators include fasting blood glucose, total cholesterol, triglycerides, high-density lipoprotein cholesterol, low-density lipoprotein cholesterol, serum uric acid, serum creatinine, urea, white blood cells, neutrophil percentage, lymphocyte percentage, monocyte percentage, eosinophil percentage, basophil percentage, absolute neutrophil count, absolute lymphocyte count, absolute monocyte count, absolute eosinophil count, absolute basophil count, red blood cells, hemoglobin, hematocrit, mean corpuscular volume, mean corpuscular hemoglobin, platelets, alanine aminotransferase, aspartate aminotransferase, albumin, gamma-glutamyl transferase, and proteinuria.
[0095] The composite index variables include the triglyceride-glucose index (TyG index) and the systemic immune inflammation index (SII);
[0096] TyG index = ln[triglycerides (mg / dL) × fasting blood glucose (mg / dL) / 2];
[0097] SII = (absolute neutrophil count × platelet count) / absolute lymphocyte count;
[0098] The imaging variables include diagnostic information from renal ultrasound.
[0099] CKD diagnostic criteria
[0100] This study used the 2009 CKD-EPI (Chicken Kidney Disease Epidemiology Collaborative Formula) to calculate eGFR (estimated glomerular filtration rate).
[0101] The formula for calculating serum creatinine levels in women ≤0.7 mg / dl (62 μmol / L) is as follows:
[0102] eGFR = 144 × (creatinine / 0.7)^(-0.329) × (0.993)^age;
[0103] The formula for calculating serum creatinine > 0.7 mg / dL in women is as follows:
[0104] eGFR = 144 × (creatinine / 0.7)^(-1.209) × (0.993)^age;
[0105] The formula for calculating serum creatinine ≤0.9 mg / dL in men is as follows:
[0106] eGFR = 141 × (creatinine / 0.9)^(-0.411) × (0.993)^age;
[0107] The formula for calculating serum creatinine > 0.9 mg / dL in men is as follows:
[0108] eGFR = 141 × (creatinine / 0.9)^(-1.209) × (0.993)^age;
[0109] According to the 2012 guidelines of the International Organization of Kidney Disease, "Kidney Disease: Improving Global Outcomes," CKD is defined as an eGFR <60 mL / min / 1.73 mcg in two consecutive physical examinations. 2 Or urine protein 1+ or above;
[0110] In this embodiment, the follow-up period is from the baseline physical examination date to the date of the first determination of a chronic kidney disease event. If no chronic kidney disease event occurs, the follow-up period ends on the date of the last physical examination.
[0111] In this embodiment, step four specifically includes:
[0112] Obtain a set of candidate variables, identify each variable with missing values as the current imputation target variable, and use all variables without missing values as input variables;
[0113] For each imputation target variable, extract samples with complete values from the imputation target variable to construct a training subset, and use the training subset as training data to perform modeling, including:
[0114] A training subset is formed by sampling a predetermined proportion of samples from the training subset with replacement, wherein the predetermined proportion is between 60% and 80% of the total sample size.
[0115] In each tree construction process, a preset number of variables are randomly selected from all input variables as candidate partitioning features, where the preset number is the square root of the number of input variables.
[0116] Based on the training subsample set and the candidate splitting features, a decision tree is constructed, and the variance minimization is used as the splitting criterion for splitting until the stopping condition is met. The stopping condition includes the tree depth reaching a set upper limit or the number of leaf node samples falling below a set threshold.
[0117] Construct several decision trees to form a forest model with a multi-decision-tree structure;
[0118] The constructed forest model is used to predict the training subsamples corresponding to the missing values of the imputation target variable. During the prediction process, each decision tree independently generates the prediction result, and the majority voting method or the mean method is used to integrate all the results to obtain the imputation value.
[0119] The majority voting method is used for imputation of missing values in categorical variables. That is, the target variable for imputation is the category, each decision tree predicts a category for the missing value, and finally selects the category that appears most frequently as the imputation value.
[0120] The mean method is used for imputation of missing values for continuous variables. Each decision tree predicts a value for the missing value, and the average of all predictions is taken as the imputed value.
[0121] The interpolation rounds are repeated throughout the interpolation process until the average absolute change between the interpolation results of two consecutive interpolation rounds is less than the preset convergence threshold, at which point the final interpolation is completed.
[0122] The candidate variable set after final imputation is taken as the complete variable set, and the complete variable set is randomly divided into training set and test set in a ratio of 7:3.
[0123] In this embodiment, step five specifically includes:
[0124] In the training set, all variables in the complete variable set are used as independent variables to input Lasso regression. Under the condition of applying L1 norm constraints, regression coefficient compression is performed. A corresponding fitting function is constructed for each candidate penalty coefficient. The average prediction error under each penalty coefficient is evaluated by K-fold cross-validation. The penalty coefficient λ value corresponding to the smallest prediction error is selected. Variables with non-zero regression coefficients under the penalty coefficient λ value are extracted to obtain the Lasso regression screening variable set.
[0125] In the training set, sampling with replacement is used to randomly sample all variables multiple times to construct several subsets of variables, and a binary survival tree population is constructed in each subset of variables.
[0126] Each variable is perturbed individually, and the observed values of the variable are randomly shuffled in the out-of-bag samples while keeping other variables unchanged. The prediction is then performed again, and the difference in prediction error before and after the perturbation is calculated as the VIMP value of the variable.
[0127] All variables are sorted in descending order based on their VIMP values, and the top N variables by VIMP value are selected to form the set of variables for random survival forest selection.
[0128] Take the intersection of the Lasso regression selection variable set and the random survival forest selection variable set, and retain the variables that are selected by both methods simultaneously as the final modeling variables.
[0129] When assessing variable importance, the Random Survival Forest method measures the importance of each variable based on the prediction error of out-of-bag samples. Specifically, the Random Survival Forest constructs multiple binary survival trees to predict the survival time or event risk of out-of-bag samples, obtaining the original prediction results. Then, for each variable, its values in the out-of-bag samples are shuffled, while keeping other variables unchanged, and the prediction is re-performed. The perturbed prediction results are compared with the original results, and the difference in prediction error before and after the perturbation is calculated. This difference is the VIMP value of the variable, reflecting its contribution to prediction accuracy when unperturbed. The larger the VIMP value, the more significant the variable's impact on the prediction results.
[0130] Lasso regression and random survival forest methods select variables based on different principles. The former eliminates redundant variables by penalizing regression coefficients, effectively addressing the problem of high-dimensional collinearity; the latter utilizes perturbation mechanisms and nonlinear splitting in ensemble learning to capture complex interactions between variables. Taking the intersection of the screening results from both methods combines their advantages of linear dimensionality reduction and nonlinear screening, eliminating variables that might be incorrectly selected or missed by a single method, thus improving the stability, interpretability, and generalization ability of the final variable set, thereby enhancing the robustness and clinical applicability of chronic kidney disease risk prediction methods.
[0131] In this embodiment, step six specifically includes:
[0132] Based on the final modeling variables, multiple subsets of samples are randomly generated using sampling with replacement.
[0133] In each subsample set, a decision tree structure is constructed using a binary splitting approach, taking into account the follow-up time and outcome status of each sample.
[0134] At each split node of each binary decision tree, several variables are randomly selected from the final modeling variables as candidate split variables;
[0135] For each candidate splitting variable, the samples within a node are divided into two subgroups based on the numerical range or value category.
[0136] For the partitioning results, a weighted log-rank statistic is calculated based on the corresponding follow-up time and outcome status. In the process of calculating the log-rank statistic, a weighting function is introduced to weight the risk set at each time point, so that the survival information at different time points contributes differently to the statistic.
[0137]
[0138] Where U represents the weighted log-rank statistic, J represents the total number of events, and t j Let d represent the time point of the j-th event. 1j d represents the number of samples in the first subgroup that occurred at the j-th event time point. j Y represents the total number of events in the two groups. 1j Y represents the size of the risk set of the first subgroup at the time of event j. j w(t) represents the size of the two sets of overall risk. j () represents the weighting function at the j-th event time point;
[0139]
[0140] in, Let ρ represent the survival rate at time point j estimated based on the Kaplan-Meier method, and μ represent the weighting coefficients.
[0141] In survival analysis, the risk set refers to the set of individuals still under observation at a given time point, before the endpoint event has occurred. Therefore, Y j Y represents the number of samples in the entire sample that have not yet experienced an event at the j-th event time point. 1jThis represents the number of samples in the first subgroup that have not yet experienced an event at the j-th event time point (i.e., the size of the risk set in this subgroup). This information comes from the follow-up time (also known as survival time) and outcome status (whether the endpoint event, such as CKD, has occurred).
[0142] Kaplan-Meier estimation is a classic nonparametric method used to estimate the probability that an individual will not experience an event before time t.
[0143] Initial value:
[0144] Each event time point t j calculate:
[0145]
[0146] Where, d j This represents the number of samples where the event occurs at the j-th event time point. This represents the survival rate estimated based on the Kaplan-Meier method at the (j-1)th event time point;
[0147] Compare the weighted log-rank statistics of all candidate splitting variables, select the variable with the largest weighted log-rank statistics and the splitting point as the basis for splitting the current node, until the depth of the tree reaches the upper limit of the set maximum number of layers, or the number of samples contained in the current leaf node is lower than the set minimum number of samples threshold, and complete the construction of the random survival forest model.
[0148] In this invention, the introduction of a weighted log-rank statistic as the node partitioning criterion effectively enhances the discriminative power and model stability during survival data modeling. Traditional log-rank statistics, when partitioning nodes, often assign equal weights to events across different time periods, failing to reflect the risk differences of events occurring at different stages of long-term follow-up. This is particularly problematic in long-term risk prediction for chronic diseases such as chronic kidney disease, potentially leading to insufficient information utilization. In contrast, the weighted log-rank statistic, by introducing a time-related weighting function, can amplify the differences in survival curves across specific time intervals, thereby more sensitively identifying the contribution of different variable combinations to event risk at key time nodes.
[0149] Furthermore, employing weighted log-rank statistics allows for a more accurate assessment of the relationship between candidate variables and survival time when constructing decision trees, enhancing the ability of splitting nodes to identify high-risk individuals. This results in improved classification accuracy while preserving data heterogeneity. Combined with the joint input of follow-up time in the training set and the final modeling variables, the model's ability to model the dynamic evolution of individual risk over time is effectively enhanced, facilitating early warning and intervention. This improves the practicality and accuracy of the method presented in actual chronic kidney disease risk prediction.
[0150] In this embodiment, step seven specifically includes:
[0151] In the test set, the predicted probability of each individual experiencing a chronic kidney disease event at a set time point was calculated based on the random survival forest model, and the risk ranking corresponding to the predicted probability was recorded.
[0152] The predicted probabilities were compared with the actual follow-up outcomes of individuals, and the C-index was used to evaluate the correct prediction rate among all paired comparisons, quantifying the degree of consistency between the prediction results and the actual time sequence.
[0153] Plot the receiver operating characteristic (ROC) curve and calculate the area under the ROC curve (AUC) using numerical integration to evaluate predictive performance.
[0154] Calculate the average predicted probability value and the actual incidence of chronic kidney disease events within each predicted probability segment, plot the mapping curve between the predicted value and the actual value, and form a calibration curve to reflect the difference between the predicted value and the observed value of the random survival forest model.
[0155] The final modeling variables are perturbed sequentially in the sample individuals, while keeping the values of the other variables unchanged. The changes in the predicted probability before and after the perturbation are recorded, and the Shapley additive interpretation method is used to obtain the SHAP value corresponding to each variable.
[0156] The SHAP values of all variables are averaged to extract the positive and negative contributions and magnitudes of each variable to the prediction of increased or decreased risk.
[0157] The model performance is evaluated based on both discrimination and calibration capabilities. The concordance index (C-index), which combines the C-index with the receiver operating characteristic (ROC) curve, is used to assess the model's discrimination ability. The area under the curve (AUC) is used to evaluate the predictive efficacy of the established predictive model at 3 and 5 years. Generally, the C-index and AUC values are considered to be between 0.5 and 1; values closer to 1 indicate better discrimination ability, values between 0.50 and 0.70 indicate weaker discrimination ability, values between 0.71 and 0.90 are considered moderate, and values greater than 0.90 indicate high discrimination ability. The calibration curve is used to assess the model's calibration accuracy. The closer the predicted calibration curve is to the actual calibration curve, the closer the model's predictions are to reality, and the better the model fit.
[0158] Model transparency is crucial for its real-world application. To enhance interpretability, this invention selects the model with the best overall performance and uses the Shapley Additive Explanation (SHAP) method to interpret the prediction model. SHAP is a method for interpreting various black-box machine learning models. It allows for focused feature engineering, maximizing the extraction of the most relevant and influential feature variables from the machine learning model. The SHAP value reflects the impact of that variable on the model.
[0159] In this invention, the SHAP value of each variable is calculated by selecting all test set data, and the importance of the variable in the model and its positive and negative effects are interpreted based on the SHAP value.
[0160] In this embodiment, step eight specifically includes:
[0161] In the test set, the risk probability of each individual developing chronic kidney disease within a set time point is obtained, and the optimal cutoff value is obtained by the maximum log-rank test. The maximum log-rank test is used in tumor research to analyze the relationship between the expression level of a certain gene and the survival time of patients. Specifically, the surv_cutpoint function in the survminer package of R language is used to specify the survival time and event variables and calculate the optimal cutoff value of continuous variables.
[0162] The study sample was divided into a high-risk group and a low-risk group based on the optimal cutoff value. The high-risk group consisted of individuals whose risk scores were greater than or equal to the optimal cutoff value, and the low-risk group consisted of individuals whose risk scores were less than the optimal cutoff value.
[0163] Kaplan-Meier survival curves were constructed for the high-risk group and the low-risk group respectively. Based on the follow-up time and event occurrence status of each group, the survival probability of each group was calculated at each time point. By comparing and analyzing the differences between the Kaplan-Meier survival curves of the two groups, the ability of the individual risk score output by the random survival forest model to distinguish the risk in the group risk stratification was reflected.
[0164] Example 1:
[0165] To verify the feasibility of this invention in practice, a total of 12,723 subjects were included, of whom 8,111 (63.75%) were male and 4,612 (36.25%) were female, with a median age of 52 years and a mean follow-up time of 4.25 years, totaling 54,084 person-years. During the follow-up period, 368 (2.89%) new cases of CKD were diagnosed, with an incidence rate of 6.80 / 1000 person-years. After randomization at a ratio of 7:3, the training set consisted of 8,906 subjects and the test set consisted of 3,817 subjects, with 255 (2.86%) and 113 (2.96%) patients diagnosed with CKD, respectively.
[0166] like Figure 2 As shown, Lasso regression was performed using 10-fold cross-validation. This study selected lambda.min, which minimizes the cross-validation error, as the optimal penalty coefficient λ (λ.min = 0.001). Twenty key variables for predicting CKD were initially screened, including systolic blood pressure, diastolic blood pressure, waist circumference, white blood cells, EOS#, BASO#, red blood cells, MCV, ALT, albumin, γ-GT, urea, fasting blood glucose, HDL-C, age, sex, smoking, hypertension, diabetes, and TyG index.
[0167] In the RSF model constructed from 44 variables, key variables for constructing the CKD model were evaluated using VIMP values. A VIMP value greater than 0 indicates that the variable has a positive effect on improving the model's effectiveness, while a VIMP value less than 0 indicates that the variable will decrease the model's effectiveness. The top 20 variables with the highest VIMP values (VIMP ≥ 0.005) were selected as potential predictors of CKD, namely age, fasting blood glucose, waist circumference, systolic blood pressure, LYM#, LYM%, urea, body mass index, sex, TyG index, diabetes, HDL-C, platelets, hemoglobin, triglycerides, NEU%, hypertension, red blood cells, smoking, and alcohol consumption.
[0168] Table 1. Variable selection table for Lasso regression and RSF.
[0169]
[0170] Table 1 above shows 20 variables selected by Lasso regression and RSF respectively. The 12 variables selected by both algorithms were chosen as the final variables for constructing the CKD prediction model, namely: systolic blood pressure, waist circumference, red blood cells, urea, fasting blood glucose, HDL-C, age, gender, smoking, hypertension, diabetes, and TyG index.
[0171] Calculate the SHAP values of the 12 variables and rank them by feature importance, such as... Figure 3 As shown, the importance of variables in the RSF model is ranked as follows: gender, fasting blood glucose, hypertension, systolic blood pressure, waist circumference, age, urea, diabetes, TyG index, HDL-C, red blood cells, and smoking.
[0172] Figure 4 The SHAP values for each sample under different features are composed of one point, with each point representing a sample. The closer the point is to the right, the greater the positive impact of the feature on the model; the further to the left, the greater the negative impact of the feature on the model. The color indicates the degree of contribution of the variable to the prediction model.
[0173] The variables for each research subject are input into a random survival forest model to assign a risk score. Risk stratification is then performed based on the optimal cutoff value of the individualized risk score (cutpoint = 2.88), dividing the research subjects in the training and test sets into low-risk and high-risk groups. Kaplan-Meier curves are then plotted between the two groups. Figure 5 and Figure 6 As shown, in both the training and test sets, the cumulative incidence of CKD in the high-risk group was significantly higher than that in the low-risk group (P<0.001).
[0174] This embodiment constructs and validates a chronic kidney disease (CKD) incidence risk prediction model based on the random survival forest (RSF) method, using real-world physical examination data. The study included 12,723 participants. Variables were screened using Lasso regression and RSF methods, ultimately selecting 12 intersection variables to construct the prediction model. The SHAP method was used to interpret variable importance, clarifying the positive and negative contributions of each variable to the prediction results. The model demonstrated good predictive performance on both the training and test sets, and Kaplan-Meier curves showed a significant difference in CKD incidence between high- and low-risk groups, validating the model's effectiveness and discriminative ability. This embodiment fully demonstrates the feasibility and practical value of the invention, proving that the proposed modeling process can efficiently and accurately identify high-risk CKD populations, providing a scientific basis for individualized intervention and early prevention.
[0175] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for predicting the risk of occurrence of chronic kidney disease based on the random survival forest method, characterized by, The method comprises the following steps: Step 1: Obtain the historical physical examination data of the target population, screen out individuals who do not meet the inclusion criteria, and obtain the research sample; Step 2: Extract multi-source variable data related to the health status of individuals from the research sample to construct a candidate variable set; Step 3: Chronic kidney disease event defined as estimated glomerular filtration rate < 60 mL / min / 1.73 m2 based on two consecutive visits 2 or urine protein positive, time on follow-up calculated; Step 4: Fill in the missing values of the candidate variable set using the random forest imputation method to obtain a complete variable set, and divide it into a training set and a test set; Step 5: Perform feature selection on the training set using Lasso regression and random survival forest methods respectively, extract the intersection variables, and form the final modeling variables; Step 6: Based on the follow-up time and the final modeling variables, use the weighted log-rank statistic to perform node division and construct a random survival forest model; Step 7: Use the random survival forest model to predict the test set, evaluate the C-index, AUC, and calibration performance, and calculate the SHAP value of the final modeling variable to explain the positive and negative contributions of each final modeling variable to the prediction result; Step 8: Set the optimal cutoff value according to the individual risk score output by the random survival forest model, divide the research sample into a high-risk group and a low-risk group, and generate a Kaplan-Meier curve for comparison between groups. 2.The chronic kidney disease onset risk prediction method based on the random survival forest method according to claim 1, characterized in that, The target population is an individual who has completed at least three physical examinations within a specified pre-set time range and is at least 45 years old. The first physical examination is used as the baseline to construct a dynamic cohort. 3.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The individuals who do not meet the inclusion criteria specifically include: Individuals who lack baseline serum creatinine or urine protein data; Individuals who lack follow-up information; Estimated glomerular filtration rate less than 60 mL / min / 1.73 m2 at baseline 2 or individuals with urine protein of 1+ and above; Individuals who have a history of malignant tumors, kidney diseases, or kidney ultrasound examination indicating a history of kidney diseases at baseline, including kidney stones, hydronephrosis, kidney tumors, kidney transplantation, or solitary kidney; Individuals whose variable set in the candidate variable set has more than 20% missing values. 4.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The multi-source variable data specifically includes demographic characteristics variables, physical measurement variables, laboratory test indicators, composite indicator variables, and imaging examination variables; The demographic characteristics variables include gender, age, medical history, and history of alcohol and tobacco use; The physical measurement variables include height, weight, waist circumference, systolic blood pressure, and diastolic blood pressure, and the body mass index is calculated based on height and weight; The laboratory test indicators include fasting blood glucose, total cholesterol, triglycerides, high-density lipoprotein cholesterol, low-density lipoprotein cholesterol, serum uric acid, serum creatinine, urea, white blood cells, neutrophil percentage, lymphocyte percentage, monocyte percentage, eosinophil percentage, basophil percentage, neutrophil absolute value, lymphocyte absolute value, monocyte absolute value, eosinophil absolute value, basophil absolute value, red blood cells, hemoglobin, hematocrit, mean corpuscular volume, mean corpuscular hemoglobin, platelets, alanine aminotransferase, aspartate aminotransferase, albumin, gamma-glutamyl transferase, and proteinuria; The composite indicator variables include triglyceride-glucose index and systemic immune inflammation index; The imaging examination variables include the diagnostic information of kidney ultrasound. 5.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The follow-up time is from the baseline physical examination day to the day when the first chronic kidney disease event is determined to occur, and if no chronic kidney disease event occurs, the follow-up time ends on the last physical examination day. 6.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The step four is specifically: Obtaining a candidate variable set, identifying each variable with missing values, taking each variable as a current interpolation target variable, and taking all variables without missing values as input variables; For each interpolation target variable, a training subset is constructed by extracting samples with complete values of the interpolation target variable, and modeling is performed by taking the training subset as training data, including: A training subsample set is formed by extracting a preset proportion of samples from the training subset by means of replacement sampling, and the preset proportion is between 60% and 80% of the total sample size; In each tree building process, a preset number of variables are randomly selected from all input variables as candidate division features, and the preset number is the square root of the number of input variables; Based on the training subsample set and the candidate division features, a decision tree is constructed, and variance minimization is used as the division standard for splitting until the stop condition is met, and the stop condition includes that the tree depth reaches a set upper limit or the leaf node sample size is less than a set number threshold; A plurality of decision trees are constructed to form a forest model with a plurality of decision tree structures; The constructed forest model is used to predict the training subsample corresponding to the missing value of the interpolation target variable, and the prediction result is independently generated by each decision tree during the prediction process, and all results are integrated by majority voting or mean method to obtain the interpolation value; The interpolation round is repeatedly executed in the entire interpolation process until the average absolute change between the interpolation results of two consecutive interpolation rounds is less than a preset convergence threshold, and the final interpolation is completed. The candidate variable set after the final interpolation is taken as a complete variable set, and the complete variable set is randomly divided into a training set and a test set according to a 7:3 ratio. 7.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The step five is specifically: In the training set, all variables in the complete variable set are taken as independent variables to input Lasso regression, regression coefficient compression is performed under the condition of applying L1 norm constraint, a corresponding fitting function is constructed for each candidate penalty coefficient, the average prediction error under each penalty coefficient is evaluated by K-fold cross-validation, the penalty coefficient λ value corresponding to the minimum prediction error is selected, the variables with non-zero regression coefficients under the penalty coefficient λ value are extracted, and a Lasso regression screening variable set is obtained; A plurality of variable subsets are constructed by repeatedly and randomly extracting all variables in the training set, and a binary survival tree population is constructed in each variable subset; Each variable is individually perturbed, the observation value of the variable is randomly shuffled in the out-of-bag sample, the prediction error difference before and after perturbation is calculated, and the VIMP value of the variable is calculated; All variables are sorted in descending order according to the VIMP value, and a group of variables with the top N VIMP values are selected to form a random survival forest screening variable set; The intersection of the Lasso regression screening variable set and the random survival forest screening variable set is taken, and the variables selected by both methods are retained as the final modeling variables. 8.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The step six is specifically: Based on the final modeling variables, a plurality of sub-sample sets are randomly generated by a sampling method with replacement; In each sub-sample set, a decision tree structure is constructed by using a binary splitting method combined with the follow-up time and outcome status of each sample; In each splitting node of each binary decision tree, a plurality of variables are randomly selected from the final modeling variables as candidate splitting variables; For each candidate splitting variable, the samples in the node are divided into two subgroups according to the numerical range or value category; For the division result, a weighted log-rank statistic is calculated based on the corresponding follow-up time and outcome status, and in the calculation process of the log-rank statistic, a weighting function is introduced to weight the risk set at each time point, so that the survival information at different time points has different contribution degrees to the statistic; The weighted log-rank statistics of all candidate splitting variables are compared, and the variable and splitting point with the largest weighted log-rank statistic are selected as the division basis of the current node, until the depth of the tree reaches the set maximum number of layers or the number of samples in the current leaf node is lower than the set minimum sample number threshold, and the construction of the random survival forest model is completed. 9.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The step seven is specifically: In the test set, the prediction probability of each individual for the chronic kidney disease event at a set time point is calculated based on the random survival forest model, and the risk ranking corresponding to the prediction probability is recorded; The prediction probability and the real follow-up outcome of the individual are compared, the C-index is used to evaluate the correct prediction rate in all paired comparisons, and the consistency of the prediction result with the actual time sequence is quantified; The receiver operating characteristic curve is drawn, the area AUC under the curve is calculated by numerical integration, and the prediction performance is evaluated; The average prediction probability value and the actual chronic kidney disease event rate in each prediction probability segment are calculated, the mapping curve of the prediction value and the actual value is drawn, and the calibration curve is formed to reflect the difference between the prediction value and the observed value of the random survival forest model; The final modeling variables are sequentially perturbed in the sample individuals, the rest of the variable values remain unchanged, the prediction probability change value before and after perturbation is recorded, and the SHAP value of each variable is obtained by using the Shapley additive interpretation method; The SHAP values of all variables are averaged, and the positive and negative contributions and numerical magnitudes of each variable to the prediction risk increase or decrease are extracted. 10.The method of predicting the risk of occurrence of chronic kidney disease based on the random survival forest method according to claim 1, characterized in that, The step eight is specifically: In the test set, the risk probability of each individual for the chronic kidney disease at a set time point is obtained, and the best cutoff value is obtained by using the maximum log-rank test method; According to the best cutoff value, the research samples are divided into a high-risk group and a low-risk group, the high-risk group is composed of individuals with a risk score greater than or equal to the best cutoff value, and the low-risk group is composed of individuals with a risk score less than the best cutoff value; Kaplan-Meier survival curves are constructed for the high-risk group and the low-risk group, respectively, the survival probability of each group is calculated at each time point based on the follow-up time and the event occurrence status of each group, and the difference between the Kaplan-Meier survival curves of the two groups is compared and analyzed to reflect the discrimination ability of the individual risk score output by the random survival forest model in the population risk stratification.
Citation Information
Patent Citations
Construction method of chronic kidney disease prediction model, prediction system and application
CN117542504A