Method for constructing cardiovascular disease risk prediction model based on taper index
By constructing a cardiovascular disease risk prediction model based on the taper index, the problems of unsystematic screening of obesity and lipid indicators and insufficient generalization of prediction models in existing technologies have been solved, enabling more accurate prediction of cardiovascular disease risk across populations and cohorts, and providing transparent quantitative evidence.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- THE SECOND AFFILIATED HOSPITAL OF CHONGQING MEDICAL UNIV
- Filing Date
- 2026-03-27
- Publication Date
- 2026-07-03
AI Technical Summary
Existing methods for predicting cardiovascular disease risk suffer from unsystematic screening of obesity and lipid indicators, and insufficient generalization of prediction models.
A cardiovascular disease risk prediction model was constructed based on the taper index. The model was preprocessed by obtaining a sample dataset, divided into training and test sets, a candidate model library was built, and each model was trained using a unified training interface. Feature subsets were extracted and evaluated on the test set, and finally the optimal model was selected.
It significantly improves the model's robustness and prediction accuracy in cross-population and cross-cohort environments, and can more accurately reflect the association between central obesity and cardiovascular risk, providing transparent and causally explanatory quantitative evidence.
Smart Images

Figure CN122337589A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of model building technology, and in particular to a method for building a cardiovascular disease risk prediction model based on the taper index. Background Technology
[0002] Atherosclerotic cardiovascular disease (ASCVD) is a significant component of the global disease burden and a leading cause of death. Despite significant improvements in patient outcomes due to current medical practices, approximately 17.6 million people still die from ASCVD each year. Fortunately, ASCVD is preventable because most of its major risk factors are modifiable, such as hyperlipidemia, hypertension, diabetes, smoking, and obesity. Therefore, early identification of ASCVD risk and timely intervention and treatment are crucial for improving patient outcomes.
[0003] Based on the risk factors for ASCVD, researchers have proposed a series of indicators for predicting ASCVD risk. Obesity is one of the important risk factors for ASCVD, which can be divided into general obesity (usually measured by body mass index BMI) and central obesity (commonly assessed by waist circumference (WC) or waist-to-height ratio (WHtR)). However, these indicators cannot accurately distinguish between subcutaneous fat and visceral fat. In recent years, researchers have proposed several new anthropometric obesity indices that can better distinguish between abdominal adipose tissue and body fat percentage, such as body roundness index (BRI), body shape index (ABSI), taper index (C-index), relative fat mass (RFM), and weight-adjusted waist circumference index (WWI). Studies have shown that they are significantly associated with cardiovascular disease. In addition, several lipid-related indicators have shown strong association with and predictive ability for cardiovascular disease risk, including visceral fat index (VAI), lipid accumulation products (LAP), plasma atherosclerosis index (AIP), Castelli Risk Index I (CRI-I) and Castelli Risk Index II (CRI-II), atherogenic coefficient (AC), lipoprotein combined index (LCI), and triglyceride-glucose (TyG) index and its combinations with obesity indicators (TyG-BMI, TyG-WC, TyG-WHtR). Previous studies have suggested that these indicators vary in their effectiveness in predicting ASCVD risk, but comprehensive and systematic comparative studies are still limited. Existing studies mainly compare the effectiveness of these indicators in predicting 10-year ASCVD risk, which is usually calculated based on the 2013 ACC / AHA guidelines using pooled cohort equations (PCE). Because the PCE model is used to predict the 10-year ASCVD risk of African American and non-Hispanic white adults aged 40–79, the applicability of these findings may be limited. Furthermore, sample size is another factor limiting the extrapolation of research results.
[0004] Therefore, there is a need for a method for constructing a cardiovascular disease risk prediction model based on the taper index, which can solve the problems of unsystematic screening of obesity and lipid indicators and insufficient generalization of prediction models in existing cardiovascular disease risk prediction. Summary of the Invention
[0005] This invention provides a method for constructing a cardiovascular disease risk prediction model based on the taper index, which can solve the problems of unsystematic screening of obesity and lipid indicators and insufficient generalization of prediction models in existing cardiovascular disease risk prediction.
[0006] To solve the above-mentioned technical problems, this application provides the following technical solution: The method for constructing a cardiovascular disease risk prediction model based on the taper index includes the following steps: S1. Obtain the sample dataset, where each sample contains an outcome label and a feature vector. The feature vector contains the continuous variable taper index. Preprocess the sample data. S2. Divide the preprocessed sample dataset into a training set and a test set; construct a candidate model library and combine the models in the candidate model library to generate a candidate model set; S3. Use a unified training interface to train each model in the candidate model set, and extract the feature subset retained by each model after training is completed; S4. Evaluate each candidate model after training on the test set, and select the optimal cardiovascular disease risk prediction model based on the evaluation results.
[0007] Furthermore, it also includes: S5. For the input features of external validation samples, use the optimal cardiovascular disease risk prediction model to calculate the prediction probability output as the prediction result. S6. Calculate the feature contribution of each feature to the prediction result; S7. Construct the rendering and output process based on feature contribution.
[0008] Furthermore, in step S1, the sample data is preprocessed, including: Missing values in the data can be imputed using the mean, median, mode, or model-driven methods. Perform one-hot encoding or ordinal encoding on categorical variables; Continuous variables are standardized; if queue identifiers are provided in the dataset, the data is split into different queues and standardized separately, and then merged back into the overall feature matrix in the order of the original samples.
[0009] Furthermore, in step S2, the candidate model library contains multiple binary classification models; a two-stage training strategy of first screening features and then training the classifier is adopted to arrange and combine the models in the candidate model library to generate a candidate model set containing a combination of feature screener and classifier.
[0010] Furthermore, the candidate model library includes: regularized regression model, stepwise regression model, support vector machine model, linear discriminant analysis model, boosting logistic regression model, partial least squares generalized linear regression model, random forest model, gradient boosting machine model, extreme gradient boosting model, and Naive Bayes model.
[0011] Furthermore, in step S3, after training is completed, the feature subset retained by each model is extracted, including: For regularized or sparse models, extract variables with non-zero coefficients as a subset of features; For tree models, extract highly important features as a feature subset and remove the intercept term; The final subset of features used during training is recorded and stored in the model object.
[0012] Furthermore, in step S4, the test set data is divided into different queues according to the queue identifier; when evaluating each candidate model after training, risk score calculation and binary label prediction processing are included. Risk score calculation is achieved by defining a risk score prediction function. The risk score prediction function receives a trained model object and new input data as input parameters, calls the feature subset stored in the trained model object, aligns the feature dimensions of the new input data with the feature subset, extracts the category attributes of the trained model object, and dynamically calls the corresponding prediction interface based on a multi-branch selection structure to generate a risk score, and uniformly formats the risk score into a numerical vector with sample identifier names as output. When performing binary label prediction, after obtaining the risk score output of the risk score prediction function, a threshold determination is performed based on the model features to generate discrete binary labels. Based on the generated risk scores and binary labels, the area under the subject operating characteristic curve is calculated for each cohort, and the corresponding matrix is generated. Compare the area under the receiver operating characteristic curve (AUC) and mean value of different candidate models on various datasets, and select the optimal cardiovascular disease risk prediction model based on the mean AUC value.
[0013] Furthermore, in step S4, when dynamically calling the corresponding prediction interface based on the multi-branch selection structure to generate a risk score: When the model type is a logistic regression network, a generalized linear model, a generalized linear boosting model, a partial least squares regression model, or a gradient boosting model, call the response type interface to output the probability; When the model type is a support vector machine, enable the probability prediction parameter; When the model category is random forest or Naive Bayes, extract the probability column corresponding to the positive class from the original prediction output; When the model category is an extreme gradient boosting tree, the feature-aligned data is converted into a matrix format and its predicted probability is calculated directly. When the model category is a general training framework, extract the positive class probability from its probability output list.
[0014] Furthermore, in step S4, when performing threshold determination based on model features to generate discrete binary classification labels: For models that output continuous probabilities, a preset threshold is configured to generate binary classification labels. For models with internal default classification decision boundaries, their default rules are used.
[0015] Furthermore, in step S7, the features are sorted from largest to smallest based on the absolute value of their contribution; starting from the model baseline output, the contribution of each sorted feature is accumulated to obtain a step path from the baseline to the final individual prediction output; the generated step path is represented by different colored bars to indicate increased or decreased risk, and is graphically displayed together with the individual prediction output.
[0016] This approach significantly improves the model's robustness and prediction accuracy across populations and cohorts by employing a C-index-based feature vector construction and a two-stage training strategy combining feature filters and classifiers. Compared to traditional single-indicator models, the C-index in this approach more accurately reflects the association between central obesity and cardiovascular risk. Combined with encoding categorical variables and standardized preprocessing of continuous variables according to cohort identifiers, batch variance between multi-center datasets is effectively eliminated. Feature subset alignment and Shapley value-based feature contribution calculation, coupled with a visual output process consisting of absolute value sorting, a ladder path, and color bars, transform the model from a black box into a clear and quantifiable representation of the evolution path from baseline to individual prediction output. This provides transparent and causally interpretable quantitative evidence for clinical decision-making. Attached Figure Description
[0017] Figure 1 This is a schematic diagram comparing the predictive performance of obesity-related and lipid-related indicators in the UKB cohort in an example. Figure 2 This is a schematic diagram comparing the predictive performance of obesity-related and lipid-related indicators in the NHANES cohort as an example. Figure 3 This is a schematic diagram comparing the predictive performance of obesity-related and lipid-related indicators in the KNHANES cohort as an example. Figure 4 This is a schematic diagram comparing the UKB cohort AUC index in the predictive performance of obesity-related and lipid-related indicators in an example. Figure 5 This is a schematic diagram comparing the AUC index of the NHANES cohort in the predictive performance of obesity-related and lipid-related indicators in an example. Figure 6 This is a schematic diagram comparing the AUC index of the KNHANES cohort in the predictive performance of obesity-related and lipid-related indicators in an example. Figure 7 This is a schematic diagram comparing the predictive performance of obesity-related indicators and lipid-related indicators in the UK cohort DeLong test in an example. Figure 8This is a schematic diagram comparing the predictive performance of obesity-related indicators and lipid-related indicators in the NHANES cohort using the DeLong test. Figure 9 This is a schematic diagram comparing the predictive performance of obesity-related indicators and lipid-related indicators in the KNHANES cohort using the DeLong test. Figure 10 This is a schematic diagram illustrating the verification of the UKB queue taper index in the embodiment; Figure 11 This is a schematic diagram illustrating the verification of the CHARLS queue taper index in the embodiment; Figure 12 This is a schematic diagram illustrating the ELSA queue taper index verification in the embodiment; Figure 13 This is a schematic diagram illustrating the verification of the merged queue taper index in the embodiment; Figure 14 This is a schematic diagram illustrating the ASCVD event occurrence rate of the UKB queue in the embodiment. Figure 15 This is a schematic diagram of the ASCVD event occurrence rate of the CHARLS queue in Example 1; Figure 16 This is a schematic diagram illustrating the ASCVD event occurrence rate of the ELSA queue in the embodiment; Figure 17 This is a schematic diagram illustrating the ASCVD event occurrence rate of the merged queue in the embodiment. Figure 18 This is a schematic diagram illustrating the relationship between the UKB queue C-index and ASCVD risk in the embodiment. Figure 19 This is a schematic diagram illustrating the relationship between the CHARLS queue C-index and ASCVD risk in the embodiment; Figure 20 This is a schematic diagram illustrating the relationship between the ELSA queue C-index and ASCVD risk in the embodiment; Figure 21 This is a schematic diagram illustrating the relationship between the merged queue C-index and ASCVD risk in the embodiment. Figure 22 This is a schematic diagram of the AUC of different prediction models in the embodiments; Figure 23 This is a schematic diagram illustrating the mean absolute SHAP value of the SHAP feature importance in the prediction model in the embodiment. Figure 24 This is a schematic diagram showing the mean and standard deviation of the SHAP feature importance in the prediction model in the example; Figure 25 The waterfall plot shows the ASCVD risk prediction model constructed using random forest as an example. Detailed Implementation
[0018] The following detailed description illustrates the specific implementation method: Example The cardiovascular disease risk prediction model construction method based on the taper index in this embodiment includes the following: S0. Screening for the optimal indicator. Compare obesity-related indicators and screen for the optimal indicator, the cone index (C-index).
[0019] In this study, the comparison of obesity and lipid-related indicators was conducted based on three cohorts: NHANES, KNHANES, and UKB. NHANES, designed to assess the health and nutritional status of adults and children in the United States, is conducted by the National Center for Health Statistics (NCHS), a division of the Centers for Disease Control and Prevention (CDC). This study used NHANES data from 1999–2018, including 101,316 participants. After excluding 46,238 participants with missing ASCVD data and 37,240 participants with missing covariates such as height, weight, waist circumference, LDL cholesterol, and fasting blood glucose, a final total of 13,939 participants were included in the analysis.
[0020] KNHANES is a nationwide cross-sectional survey conducted regularly by the Korea Centers for Disease Control and Prevention to monitor the health and nutritional status of the general population in South Korea. This study included 105,843 participants from KNHANES 2009–2021. After excluding 54,723 participants with missing ASCVD data and 40,334 participants with missing covariates, a final total of 10,786 participants were included in the analysis.
[0021] The UK Biobank (UKB) is a large, prospective, population-based cohort comprising over 500,000 UK residents aged 37–73 years. Recruitment took place between 2006 and 2010 at 22 assessment centers in England, Wales, and Scotland. The UKB baseline initially recruited 501,950 participants. After excluding 23,921 individuals with ASCVD at baseline or lost to follow-up, and 71,837 individuals with missing covariate data, the primary analysis ultimately included 406,192 participants.
[0022] During the longitudinal validation phase, two databases were used: ELSA and CHARLS.
[0023] ELSA is a longitudinal prospective cohort study that collects multidisciplinary data from a representative sample of adults aged ≥50 years in the UK. This example uses ELSA Round 2 (2004–2005) as the baseline, enrolling 9,432 participants, of whom only 7,666 were followed up by nurses. After excluding 2,408 individuals with ASCVD at baseline or lost to follow-up, and 1,051 individuals with missing covariates, the final sample size was 4,207 participants, who were followed up to Round 9 (2018–2019).
[0024] CHARLS used round 1 (2011) as the baseline and included 17,708 participants. After excluding 9,019 participants who already had ASCVD or were lost to follow-up at baseline, and 389 participants with missing covariates, a final 8,300 participants were included in the follow-up and tracked up to round 4 (2018).
[0025] The outcome of this study was ASCVD (atherosclerotic cardiovascular disease), defined according to the 2013 American College of Cardiology / American Heart Association (ACC / AHA) guidelines on reducing the risk of atherosclerotic cardiovascular disease in adults through cholesterol treatment. ASCVD was defined as any of the following diagnoses: coronary artery disease, angina pectoris, myocardial infarction (heart attack), or stroke. A more stringent criterion was a history of myocardial infarction or stroke. In this study, cardiovascular disease was identified based on participants' self-reports or physician diagnoses of angina pectoris, coronary artery disease, myocardial infarction, or stroke. Researchers asked participants if they had been diagnosed with at least one of the above conditions; participants who answered "yes" were classified as ASCVD.
[0026] For the longitudinal cohort, follow-up began at CHARLS Round 1 and ELSA Round 2. The follow-up endpoint was the first occurrence of ASCVD or the censoring date (whichever occurred first). The censoring date was the final survey date for each participant. Ideally, the final follow-up surveys were conducted at CHARLS Round 4 (2018) and ELSA Round 9 (2018–2019). The method for defining ASCVD based on ICD-10 coding in the UKB database referenced the research of Sniderman et al.
[0027] In this embodiment, the covariates used include: age, sex, race, education level, smoking, alcohol consumption, hypertension, diabetes, and hyperlipidemia. To ensure consistency of covariates among UKB, NHANES, KNHANES, CHARLS, and ELSA, race is categorized as white or non-white. However, KNHANES and CHARLS are not included in the race variable. Education level is divided into three levels: college and above, other, and unknown. Smoking status is divided into non-smokers and smokers, with smokers including former smokers and current smokers. Similarly, alcohol consumption is divided into non-drinkers and drinkers.
[0028] First, based on three independent cohorts, the system compared the performance of various obesity and lipid-related indicators in predicting ASCVD risk.
[0029] First, the R package "pROC" was used to plot ROC curves for each indicator and calculate AUC. The discriminative power of different indicators was then compared using the DeLong test. Subsequently, four machine learning methods—decision tree, gradient boosting machine (GBM), random forest, and XGBoost—were used to rank the importance of the indicators and evaluate their performance in predicting ASCVD.
[0030] For the selected optimal indicator, external validation was further performed in two longitudinal follow-up cohorts (CHARLS and ELSA); these two longitudinal cohorts were then merged with the UKB cohort for analysis to more clearly characterize the association between the indicator and ASCVD. In addition, restrictive cubic spline (RCS) curves were plotted using the R package “rcssci” to evaluate the dose-response relationship between the optimal indicator and ASCVD.
[0031] In the UKB, NHANES, and KNHANES cohorts, results from various machine learning models consistently indicate that only the C-index consistently ranks among the top six in importance across different cohorts and models, demonstrating good robustness (e.g., Figure 1-3 (As shown). Meanwhile, the diagnostic performance of obesity-related and lipid-related indicators in the three cohorts was compared to identify more discriminative risk predictors. In the UKB cohort, the C-index had the highest AUC (AUC=0.634) and was significantly higher than other indicators (such as...). Figure 4 As shown; DeLong test, P<0.05). In the NHANES cohort, body mass index (ABSI) had the highest diagnostic efficacy (e.g., ...). Figure 5 As shown, AUC=0.703), followed by C-index (as shown). Figure 6 As shown, AUC=0.697). Figure 7-9As shown, the differences between the two methods were not statistically significant (DeLong test, P>0.05). In the KNHANES cohort, the weight-adjusted waist circumference index (WWI) had the highest diagnostic power (AUC=0.727), significantly outperforming the second-ranked C-index (AUC=0.703) (DeLong test, P<0.001). However, the AUC of WWI in KNHANES was significantly lower than that of C-index in UKB and NHANES (DeLong test, P<0.01). Combining the ROC curve and machine learning results, C-index was selected as the overall best indicator for predicting ASCVD risk.
[0032] To further evaluate the association between C-index and ASCVD, follow-up validation was conducted in two prospective cohorts: ELSA with a median follow-up time of 14 years and CHARLS with a median follow-up time of 7 years. Three Cox regression models were constructed.
[0033] In the unadjusted Model 1, the C-index was significantly associated with an increased risk of ASCVD: UKB (HR=117.76, 95% CI=107.17–129.40, P<0.001), ELSA (HR=8.77, 95% CI=3.12–24.63, P<0.001), CHARLS (HR=3.29, 95% CI=1.83–5.93, P<0.001), and the merged cohort (HR=103.35, 95% CI=94.42–113.14, P<0.001).
[0034] In Model 2 (adjusted for age, sex, race, and education), the HRs for C-index were: UKK 14.53 (95% CI = 12.97–16.28, P < 0.001), ELSA 2.72 (95% CI = 0.81–9.14, P > 0.05), CHARLS 3.13 (95% CI = 1.73–5.64, P < 0.001), and merged cohort 12.72 (95% CI = 11.39–14.21, P < 0.001).
[0035] In Model 3 (further adjusted for smoking, alcohol consumption, hypertension, diabetes, and hyperlipidemia), the HRs for C-index remained significant: UKK 8.89 (95% CI = 7.92–9.98, P < 0.001), ELSA 1.82 (95% CI = 0.53–6.28, P > 0.05), CHARLS 2.09 (95% CI = 1.20–3.62, P < 0.001), and the pooled cohort 7.68 (95% CI = 6.86–8.59, P < 0.001).
[0036] Furthermore, at baseline, the C-index was divided into three groups (low, medium, and high) according to the ternary percentile and followed up. Compared with the low C-index group, the high C-index group showed a significantly higher risk of ASCVD in all three models (e.g., Figure 10 –13 shows: UKB (HR=1.57, 95% CI=1.53–1.62, P<0.001), ELSA (HR=1.36, 95% CI=1.03–1.80, P<0.05), CHARLS (HR=1.32, 95% CI=1.10–1.58, P<0.01), and the combined cohort (HR=1.56, 95% CI=1.51–1.60, P<0.001). The cumulative incidence curve further shows that, regardless of whether it is UKB, ELSA, CHARLS, or the combined cohort, the incidence of ASCVD events increases in a stepwise manner from low to high with C-index grouping, and the differences are statistically significant (e.g., ...). Figure 14 –17 is shown; log-rank test, P<0.001). Figure 18-21 As shown, RCS analysis indicates that C-index is non-linearly associated with ASCVD risk in UKB, CHARLS, and the merged cohort (non-linearity test P<0.001), while a linear relationship is observed in ELSA.
[0037] S1. Data Acquisition and Processing. Acquire the sample dataset, where each sample contains an outcome label and a feature vector.
[0038] The outcome label is a binary label indicating whether ASCVD has occurred.
[0039] Feature vectors include continuous variables (such as the C-index) and categorical variables (such as "whether one has diabetes / whether one has high blood pressure / whether one smokes"). The sample data is preprocessed, including one-hot encoding or ordinal encoding of categorical variables using the mean, median, mode, or model-driven imputation for missing values. In this embodiment, during model-driven imputation, the variable containing missing values is used as the dependent variable, and other complete variables are used as independent variables. A random forest model is then constructed to predict the specific missing values.
[0040] Continuous variables are standardized by calling a data standardization function. Specifically, if a queue identifier variable is provided, the data will be split into different queues and standardized separately, and then merged back into the overall feature matrix in the order of the original samples to reduce the impact of batch or queue differences on model training.
[0041] For example, when using RunML(..., mode="Variable"), the framework calls ExtractVar() to extract a subset of features retained for each model. For sparse or regularized models (such as glmnet, glmboost, plsRglm), variables with non-zero coefficients are extracted; for random forests, var.select(fit)$topvars is extracted as the most important features; for GBM, it is filtered by relative importance (rel.inf>0); intercept terms are removed for all models.
[0042] S2. Construct a candidate model library and generate a candidate model set. Divide the preprocessed sample dataset into a training set and a test set. Construct a candidate model library containing 12 binary classification models, including: Regularized regression models, such as Elastic Net / Lasso / Ridge (glmnet), employ cross-validation to select the optimal regularization strength (lambda.min). Specifically, 10-fold cross-validation is performed using `cv.glmnet(..., family="binomial", nfolds=10)` to select the optimal `lambda.min` value, which is then used to fit the final model. In Lasso, alpha=1 is used; in Ridge, alpha=0 is used; and in Elastic Net, multiple alternative alpha values are compared.
[0043] Stepwise GLM: Based on logistic regression, it uses a forward, backward, or bidirectional stepwise strategy to select variables. For example, using a logistic regression model (glm(..., family="binomial")) combined with the step(..., direction=...) function to perform stepwise variable selection.
[0044] Support Vector Machine (SVM) model: The outcome variable is converted into factors and the probability output model is trained using the svm(..., probability=TRUE) function to obtain the classification probability.
[0045] Linear Discriminant Analysis (LDA) model: trained through cross-validation and outputs classification probability or discriminant score.
[0046] Boosting the logistic regression model (glmBoost): K-fold cross-validation is used to select the optimal number of iterations, and mstop is used to control complexity (a lower limit is set for the number of iterations to avoid underfitting). For example, 10-fold cross-validation is performed using caret::train(..., method="lda", trControl=trainControl(method="cv")) to train the LDA model.
[0047] Partial Least Squares Generalized Linear Regression (PLS-GLM), such as plsRglm: First, cross-validation is performed to determine the number of components, and then a sparse PLS logistic regression model is fitted. For example, first, cv.plsRglm(..., nt=10) is executed for cross-validation, and then a sparse logistic regression PLS model is fitted (plsRglm(..., modele="pls-glm-logistic",sparse=TRUE)). Random Forest (RF) model: Set the number of trees (e.g., ntree=1000) and node parameters (e.g., nodesize=5) to train and output a measure of variable importance.
[0048] Gradient Boosting Machine (GBM) model: Sets up cross-validation and searches within a large range of tree numbers to refit the final model with the number of trees corresponding to the minimum cross-validation error. For example, it sets cv.folds=10 and n.trees=10000 for cross-validation, selects the number of trees corresponding to the minimum cv.error, and then refits the final model with that number of trees.
[0049] Extreme Gradient Boosting (XGBoost) models employ K-fold cross-validation, using metrics such as log loss to determine the optimal number of iterations, and then determining the final n-round and refitting accordingly. For example, using 5-fold cross-validation (createFolds(..., k=5)), the optimal number of iterations per fold is selected using test_logloss, and the "most frequently occurring optimal number of iterations" is chosen as the final n-round, then the final model is fitted on the entire training set.
[0050] Naive Bayes: The naive Bayes classifier is trained directly using the naiveBayes(classVar~.) function to generate classification probabilities.
[0051] In this embodiment, an internal validation / complexity control strategy is also set for each type of model to determine key hyperparameters and reduce the risk of overfitting.
[0052] To improve the robustness of the model, a two-stage training strategy is adopted, which involves first selecting features and then training the classifier. The models in the candidate model library are arranged and combined to generate a candidate model set with a scale of hundreds (e.g., 113 types).
[0053] For example, a subset of candidate features can be obtained first using Lasso / glmBoost / random forest / stepwise regression, and then the subset of features can be input into classifiers such as SVM, Ridge, Enet, GBM, XGBoost, and NaiveBayes for training, forming a two-stage structure of "filter + classifier".
[0054] Candidate combinations may include, but are not limited to: Lasso + Stepglm[both], glmBoost + SVM, RF + Ridge, Stepglm[backward] +RF, RF + XGBoost, Stepglm[both] + NaiveBayes, etc.
[0055] S3, Model Training and Feature Subset Extraction. A unified training interface is used as the central framework to train each model in the candidate model set.
[0056] The training interface receives a string of "model name + hyperparameters" and dynamically executes the corresponding training function to integrate different machine learning models within the same data framework.
[0057] During training, specific internal validation and complexity control strategies are employed. For example, cross-validation is used to select the optimal regularization strength of the Lasso model or the optimal number of trees in the GBM model, and the lower bound of the iteration parameters is controlled to avoid improving the underfit of logistic regression.
[0058] After the model training is completed, the feature extraction function is called to extract the feature subset retained by each model; specifically, variables with non-zero coefficients are extracted for regularized or sparse models, and highly important features are extracted for tree models, while intercept terms are removed.
[0059] The final feature subset used during training is recorded and stored in the model object to ensure consistent feature alignment in subsequent prediction stages.
[0060] In this embodiment, a unified training interface, RunML(), is used as the central framework to execute various binary classification models and supports user-defined hyperparameters. The `method` parameter in the interface supports the string format "model name + hyperparameters" (e.g., `Enet[alpha=0.4]`), which is parsed and dynamically executed via `do.call()` to execute the corresponding training function. This allows different machine learning models to be seamlessly integrated into the same data framework. After model training is complete, the feature subset used during training is recorded in `fit$subFeature`, ensuring consistent feature alignment during the prediction phase. It supports both the output of the model object and the extraction of selected feature subsets, facilitating subsequent analysis and validation.
[0061] When using RunML(..., mode="Variable"), the framework calls ExtractVar() to extract a subset of features retained for each model. For sparse or regularized models (such as glmnet, glmboost, plsRglm), variables with non-zero coefficients are extracted; for random forests, var.select(fit)$topvars is extracted as the most important features; for GBM, it is filtered by relative importance (rel.inf>0); intercept terms are removed for all models.
[0062] S4. Establish the optimal model. Divide the test set data into different queues according to the queue identifier; when evaluating each candidate model after training, this includes risk score calculation and binary label prediction processing.
[0063] In this embodiment, risk score calculation is achieved by defining a risk score prediction function. The function receives a trained model object (fit) and new input data (new_data) as input parameters and executes the following logic: First, feature alignment is performed: the feature subset (fit$subFeature) stored in the trained model object is called to align the feature dimensions of the new input data with the feature subset to ensure that the input features are consistent; second, adaptive probability prediction of the model type is performed: the class attribute (class) of the trained model object is extracted, and the corresponding prediction interface is dynamically called based on a multi-branch selection structure (switch) to generate a risk score. Specifically, this includes: when the model type is LogNet, GLM, GLMBoost, PLSRGLLMModel, or GBM, calling the response type interface (type="response") to output the probability; when the model type is SVM, enabling the probability prediction parameter (probability=T); when the model type is RFSRC or Naive Bayes, extracting the probability column corresponding to the positive class from the original prediction output; when the model type is XGBBooster, converting the feature-aligned data into matrix format to directly calculate its predicted probability; when the model type is a general training framework (train), extracting the positive class probability from its probability output list; and finally, uniformly formatting the above prediction results into a numerical vector output with sample identifier names.
[0064] Next, binary classification label prediction is performed: After obtaining the risk score output of the above function, a threshold determination is performed based on the model features to generate discrete classification labels. For models that output continuous probabilities, such as logistic regression and extreme gradient boosting trees, a preset threshold (e.g., 0.5) is configured to generate binary classification labels; for models with internal default classification decision boundaries, their default rules are used. In the specific implementation of model prediction, in order to achieve standardized integration of prediction results from heterogeneous models, this embodiment uses a risk score calculation function (e.g., the CalPredictScore() function) and a binary classification label prediction function (e.g., the PredictClass() function) to perform feature alignment and probability output. Specifically, the CalPredictScore() function first strictly aligns the features of the newly input data (e.g., the test set) with the feature subset stored in the trained model (e.g., fit$subFeature in the code implementation) to generate a risk score (i.e., the probability value of a sample belonging to the positive class). When calculating the score, the function performs adaptive prediction calls based on the differences in different model interfaces: for example, for logistic regression (such as glmnet, glm) and gradient boosting models (gbm), the response type interface (configuration parameter type="response") is used for probability prediction; for random forest models, the positive class output (such as predicted[,"1"]) is extracted from the predicted objects; for extreme gradient boosting trees (XGBoost), the input data is converted into matrix format (such as by processing with the as.matrix function) before prediction; and for Naive Bayes models, the probability of class "1" is extracted through the raw output type (configuration parameter type="raw").
[0065] After obtaining the risk score, the PredictClass() function is responsible for generating the final binary classification labels. For models such as glm, plsRglm, gbm, and xgboost, which output continuous probabilities by default, the PredictClass() function performs hard decision generation based on a preset 0.5 threshold to generate binary classification labels (i.e., a probability greater than or equal to 0.5 is classified as one class, and otherwise as another class). For other models with internal default classification decision boundaries, their respective default classification thresholds are directly called for prediction.
[0066] Each candidate model is compared under the same data partition and evaluation framework. Evaluation metrics include AUC, accuracy, sensitivity, specificity, Brier score, and calibration curve error. The test set data is divided into different queues according to queue identifiers. By aligning the test set features with the feature subsets saved by each model, the area under the receiver operating characteristic (AUC) is calculated for each queue, generating an AUC matrix. The AUC and average AUC of different candidate models are compared across datasets. The optimal model is selected based on the average AUC value, the number of machine learning models used, and the number of covariates included.
[0067] like Figure 22As shown, in this embodiment, Stepglm[backward]+RF, Stepglm[both]+RF, Lasso+RF, and the RF single model have the highest average AUC (average AUC = 0.732). After comprehensive consideration, the Random Forest (RF) model is selected as the optimal ASCVD prediction model because it has the highest AUC value, is simple (built by a single algorithm), and incorporates factors such as age, gender, education level, hypertension, diabetes, hyperlipidemia, smoking, alcohol consumption, and C-index covariates. Figure 23 and 24 As shown. Figure 25 As shown, SHAP was used to interpret the model and a waterfall plot was drawn to predict the patient's risk of developing the disease.
[0068] S5. Perform prediction tests on external validation samples. Obtain the sample data x of the external validation samples and convert them into model input features using the same preprocessing and feature encoding methods as during the training period.
[0069] The transformed input features are aligned with the feature subset recorded in the optimal ASCVD prediction model, and then input into the model to obtain the predicted probability output f(x) that the individual belongs to the positive category.
[0070] S6. Calculate Feature Contribution. To achieve interpretable output, for external validation samples, calculate the feature contribution Φi of each feature to the prediction result. The feature contributions satisfy an additive relationship:
[0071] Where E[f(x)] is the baseline output value of the model, such as the average prediction of the training set or the expected value of the background distribution; Φi represents the magnitude by which the i-th feature shifts the predicted value upward or downward from the baseline. This contribution is calculated based on the Shapley Additive Interpretation (SHAP) method.
[0072] S7. Construct a visual output. Sort each feature by its absolute contribution value |Φi| from largest to smallest, and select the top K most important features (where K can be flexibly configured according to actual display needs). In this embodiment, to ensure the simplicity of the interface, the remaining features with lower rankings are merged into "Other Items" for summary display.
[0073] Starting from the model baseline output value E[f(x)], the contribution values Φi of each feature are accumulated sequentially according to the sorted feature order. This accumulation process forms a complete contribution path from the baseline level to the final individual prediction probability output f(x).
[0074] When Φi>0, a specific color bar that moves to the right or upward represents the positive effect of the feature on the predicted probability (increasing the output value); when Φi<0, another color bar that moves to the left or downward represents the negative effect of the feature on the predicted probability (decreasing the output value).
[0075] Map the original data feature names to preset readable business fields, and convert the values of categorical variables into semantic text labels (such as "yes / no" or "specific classification level").
[0076] The specific numerical value of the contribution (e.g., +0.144, -0.0172) is clearly marked in each color bar to intuitively reflect the degree of influence of each factor.
[0077] Finally, the generated path diagram and the predicted output f(x) are output synchronously, providing a transparent quantitative basis for the evaluation results, which facilitates business personnel to verify and interpret the logic of the model generation.
[0078] Taking the calculation process of a single sample as an example: the baseline output value of this sample is E[f(x)] = 0.00882. After superimposing the contributions of various features, the final predicted output value is f(x) = 0.224. Contribution factor analysis: among the input features of this sample, biometrics A and B show the main positive contributions to the output result (contribution values of approximately +0.144 and +0.0545, respectively); the taper index and age also show different degrees of positive impetus (contribution values of approximately +0.0341 and +0.0207, respectively); while lifestyle indicator C has a negative corrective effect (contribution value of approximately -0.0172).
[0079] This embodiment utilizes a systematic study with multiple cohorts and large samples to identify the taper index (C-index) as the optimal indicator for predicting ASCVD risk. Experiments demonstrate that the C-index exhibits significantly higher correlation and discriminative power than traditional indicators such as body mass index (BMI) and waist circumference (WC) in multiple multinational datasets, including UKB and NHANES. Even after adjusting for confounding factors such as age, sex, hypertension, diabetes, and lipids, the high C-index group still showed a significantly higher risk of developing ASCVD, with the incidence rate increasing stepwise with the index value. This effectively addresses the problems of existing anthropometric indicators failing to accurately distinguish fat distribution and exhibiting poor predictive robustness across different ethnic groups and populations.
[0080] This embodiment employs a two-stage training strategy: first, feature selection, then classifier training, constructing a candidate model set of hundreds. Through a unified training interface (RunML()) and its internal validation mechanism, it can dynamically integrate multiple models such as Random Forest, Extreme Gradient Boosting (XGBoost), and Logistic Regression, and automatically extract non-zero coefficient variables or subsets of highly important features. Experimental data shows that the optimal Random Forest (RF) model selected through permutation and combination achieves an average AUC of 0.732 on test sets from different sources. This embodiment's multi-model fusion and selection mechanism significantly improves the generalization ability and accuracy of the prediction model when dealing with cross-national and cross-center data.
[0081] This embodiment can also calculate the specific contribution of each input feature (such as C-index, age, medical history, etc.) to the final predicted probability, and generate a color-coded ladder path diagram sorted by the absolute value of contribution. This visual output not only intuitively shows the complete derivation process from baseline values to individual predicted output, but also clearly marks the specific numerical impact of each indicator on the increase or decrease of risk. It provides business personnel with transparent decision-making basis and enhances the clinical interpretability and verification convenience of cardiovascular disease risk prediction results.
[0082] The above are merely embodiments of the present invention. The invention is not limited to the fields covered by these embodiments. Commonly known structures and characteristics in the solutions are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are able to access all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.
Claims
1. A method for constructing a cardiovascular disease risk prediction model based on a tapering index, characterized by, Includes the following steps: S1. Obtain the sample dataset, where each sample contains an outcome label and a feature vector. The feature vector contains the continuous variable taper index. Preprocess the sample data. S2. Divide the preprocessed sample dataset into a training set and a test set; construct a candidate model library and combine the models in the candidate model library to generate a candidate model set; S3. Use a unified training interface to train each model in the candidate model set, and extract the feature subset retained by each model after training is completed; S4. Evaluate each candidate model after training on the test set, and select the optimal cardiovascular disease risk prediction model based on the evaluation results.
2. The method of claim 1, wherein the method is characterized by: Also includes: S5. For the input features of external validation samples, use the optimal cardiovascular disease risk prediction model to calculate the prediction probability output as the prediction result. S6. Calculate the feature contribution of each feature to the prediction result; S7. Construct the rendering and output process based on feature contribution.
3. The method of claim 2, wherein the method is characterized by: In step S1, the sample data is preprocessed, including: Missing values in the data can be imputed using the mean, median, mode, or model-driven methods. Perform one-hot encoding or ordinal encoding on categorical variables; Continuous variables are standardized; if queue identifiers are provided in the dataset, the data is split into different queues and standardized separately, and then merged back into the overall feature matrix in the order of the original samples.
4. The method of claim 3, wherein the method is characterized by: In step S2, the candidate model library contains multiple binary classification models; a two-stage training strategy of first screening features and then training the classifier is adopted to arrange and combine the models in the candidate model library to generate a candidate model set that includes a combination of feature screener and classifier.
5. The method for constructing a cardiovascular disease risk prediction model based on the taper index according to claim 4, characterized in that: The candidate model library includes: regularized regression model, stepwise regression model, support vector machine model, linear discriminant analysis model, boosted logistic regression model, partial least squares generalized linear regression model, random forest model, gradient boosting machine model, extreme gradient boosting model, and Naive Bayes model.
6. The method of claim 5, wherein the method is characterized by: For regularized or sparse models, extract variables with non-zero coefficients as a subset of features; For tree models, extract highly important features as a feature subset and remove the intercept term; The final subset of features used during training is recorded and stored in the model object.
7. The method of claim 6, wherein the method is characterized by: In step S4, the test set data is divided into different queues according to the queue identifier; when evaluating each candidate model after training, risk score calculation and binary label prediction processing are included. Risk score calculation is achieved by defining a risk score prediction function. The risk score prediction function receives a trained model object and new input data as input parameters, calls the feature subset stored in the trained model object, and aligns the feature dimensions of the new input data with the feature subset. Risk scores are generated by extracting the category attributes of trained model objects and dynamically calling the corresponding prediction interfaces based on a multi-branch selection structure; the risk scores are then uniformly formatted as numerical vector outputs with sample identifier names. When performing binary label prediction, after obtaining the risk score output of the risk score prediction function, a threshold determination is performed based on the model features to generate discrete binary labels. Based on the generated risk scores and binary labels, the area under the subject operating characteristic curve is calculated for each cohort, and the corresponding matrix is generated. Compare the area under the receiver operating characteristic curve (AUC) and mean value of different candidate models on various datasets, and select the optimal cardiovascular disease risk prediction model based on the mean AUC value.
8. The method for constructing a cardiovascular disease risk prediction model based on the taper index according to claim 7, characterized in that: In step S4, when dynamically calling the corresponding prediction interface based on the multi-branch selection structure to generate a risk score: When the model type is a logistic regression network, a generalized linear model, a generalized linear boosting model, a partial least squares regression model, or a gradient boosting model, call the response type interface to output the probability; When the model type is a support vector machine, enable the probability prediction parameter; When the model category is random forest or Naive Bayes, extract the probability column corresponding to the positive class from the original prediction output; When the model category is an extreme gradient boosting tree, the feature-aligned data is converted into a matrix format and its predicted probability is calculated directly. When the model category is a general training framework, extract the positive class probability from its probability output list.
9. The method of claim 8, wherein the method is characterized by: In step S4, when performing threshold determination based on model features to generate discrete binary classification labels: For models that output continuous probabilities, a preset threshold is configured to generate binary classification labels. For models with internal default classification decision boundaries, their default rules are used.
10. The method of claim 9, wherein the method is characterized by: In step S7, the features are sorted from largest to smallest based on their absolute value of contribution. Starting from the model baseline output, the feature contribution is accumulated one by one according to the sorted features to obtain a step path from the baseline to the final individual prediction output. The generated step path is represented by different colored bars to indicate the increase or decrease of risk, and is graphically displayed together with the individual prediction output.