Cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking
By constructing a heterogeneous base model group and dynamically adjusting the weights, and combining the KNN meta-model and the SHAP framework, the problems of insufficient feature selection and model adaptability in cardiovascular disease prediction are solved, achieving efficient and accurate cardiovascular disease prediction and interpretable analysis.
Patent Information
- Application Number
- CN202610234412.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-27
- Publication Date
- 2026-05-29
AI Technical Summary
In existing cardiovascular disease prediction methods, single feature selection strategies are difficult to capture the nonlinear interactions between key indicators, and ensemble learning models lack dynamic adaptability, making it difficult to balance prediction accuracy and computational efficiency, especially in real-time medical scenarios.
A cross-combination strategy was adopted to construct a heterogeneous base model group. The best-performing model was selected by the area under the receiver operating characteristic curve. A dynamic weighted stacking strategy was used to adjust the model weights. The feature contribution was analyzed by combining the KNN meta-model and the SHAP framework to achieve multi-dimensional feature mining and dynamic weight allocation.
It improves the accuracy and adaptability of cardiovascular disease prediction, reduces the rate of missed diagnoses, provides interpretable prediction results, and is suitable for real-time medical scenarios.
Smart Images

Figure CN122117395A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of medical information processing and machine learning technology, specifically a cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking. Background Technology
[0002] Cardiovascular diseases are characterized by their high degree of insidicity and severity. Early symptoms are often subtle, yet the disease progresses rapidly. Without timely screening and intervention, they can easily develop into serious complications, placing a heavy burden on patients' health and the healthcare system. Currently, hospitals rely heavily on single or a few indicators such as electrocardiograms and blood pressure for diagnosis of cardiovascular diseases. This makes it difficult to assess the risk of disease early, often leading to diagnosis only when symptoms are already pronounced, missing the optimal intervention window and increasing the difficulty of treatment and the overall healthcare burden.
[0003] While existing methods for predicting cardiovascular diseases have made some progress with the help of machine learning and data mining techniques, certain limitations remain. In terms of feature processing, the dimensionality is limited, and current models often employ single feature selection strategies (such as using only tree-based importance ranking), making it difficult to fully capture the complex nonlinear interactions between key indicators such as blood pressure and blood glucose, and blood lipids and age, easily overlooking potential high-risk signals. Regarding ensemble learning, isomorphic base models (such as using only gradient boosting tree series) and fixed weight stacking are typically used, lacking dynamic adaptability to sample differences. Once data shifts, the model's generalization performance significantly decreases. Furthermore, while complex models (such as deep neural networks) can improve prediction accuracy, they require substantial computational resources, facing a trade-off between computational efficiency and prediction quality, making them difficult to apply to real-time medical scenarios such as rapid emergency assessment and community-based screening. Summary of the Invention
[0004] To address the limitations of single feature selection strategies and unreasonable weight allocation in ensemble learning methods in existing approaches, this invention provides a cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking.
[0005] This invention adopts the following technical solution: a cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking, comprising: S1: Collect data and build a dataset for prediction; S2: Construct a heterogeneous base model set based on the dataset; S3: Using the area under the receiver operating characteristic curve as the evaluation index, the 10 heterogeneous base models with the best performance were selected for subsequent integration; S4: Assign adaptive weights to the 10 heterogeneous base models selected in S3; S5: Use adaptive weights to weight and fuse the prediction probabilities of 10 heterogeneous base models to generate a meta-feature dataset for training the meta-model. S6: Select a meta-model and train it using the meta-feature dataset; S7: Input the data into the trained meta-model and predict based on the meta-model's results; S8: Analyze the impact of each characteristic on the risk of disease.
[0006] In some embodiments, step S1 includes: S11: Collect multi-dimensional patient data, specifically covering demographic characteristics, clinical examination indicators, lifestyle characteristics, and past medical history. S12: Standardize the collected raw data to ultimately construct a standardized dataset that can be used for predictive analysis.
[0007] In some embodiments, step S2 includes: S21: Discover features strongly correlated with cardiovascular diseases from different dimensions, and finally obtain multiple effective feature subsets; S22: Select a variety of algorithms, including: LR, SGD, RF, XGBoost, LGBM, AdaBoost, CatBoost, SVM and MLP; S23: Combine the feature subsets obtained from S21 with the various algorithms provided in S22 to generate heterogeneous basis models through full cross-combination.
[0008] In some embodiments, step S3 includes: S31: Divide the preprocessed dataset into a training set and a validation set to ensure consistent data distribution; S32: Train all heterogeneous base models separately on the training set and make predictions on the test set, and calculate the area under the receiver operating characteristic curve for each base model; S33: Sort all base models from highest to lowest according to the area under the receiver operating characteristic curve; S34: Select the top 10 base models as the optimal base model set for subsequent integration. If there are base models with the same area under the receiver operating characteristic curve, select the base model with lower model complexity and higher computational efficiency.
[0009] In some embodiments, step S4 includes: S41: Assign uniform initial weights to the 10 heterogeneous basis models; S42: Perform multiple iterations within a preset parameter grid range; S43: Calculate the prediction error of the base model in reverse using the accuracy rate: in This represents the prediction error of the h-th base model in the t-th iteration, with a value ranging from 0 to 1. A larger value indicates a worse prediction effect. S44: The weights are dynamically updated based on an error feedback mechanism. The larger the error, the greater the weight decay. in This represents the weight of the h-th base model after the t-th iteration update. This represents the weight after the (t-1)th iteration. To control the update rate, adjust the weight adjustment step size; S45: Normalize the updated weights to ensure that the sum of all weights is 1; S46: Evaluate the performance of the ensemble model obtained by weighting the current weight combination based on the performance of the 10 heterogeneous base models on the test set.
[0010] In some embodiments, step S5 includes: S51: Use S45 to update the normalized weights, and perform weighted fusion of the predicted probabilities of the 10 heterogeneous base models to generate the meta-feature value of a single sample. in Let i be the meta-feature value of the i-th sample. Let h be the optimal weights for the h-th base model. Let h be the predicted probability of the h-th base model for the i-th sample; S52: For each sample in the training set, calculate its corresponding meta-feature value one by one according to the weighted fusion formula in S51. All meta-feature values of all samples are arranged into feature vectors according to sample order, and combined with the true labels of the samples to construct a complete meta-feature dataset for training the meta-model: Where I is the total number of samples in the training set. Let be the true label of the i-th sample.
[0011] In some embodiments, step S7 includes: S71: Input the meta-feature dataset constructed in S5 into the preset meta-model, train the meta-model by minimizing the prediction error, so that it learns the mapping relationship between meta-feature values and true labels, and save the optimal meta-model parameters after training is completed. S72: Input new patient data, first inputting it through the optimal hyperparameters. The 10 heterogeneous base models trained were used to obtain the prediction probability of each base model for the patient. Then, the meta-feature values of the new patient are calculated using the optimal weights: ; S73: Meta-feature values of new patients The meta-model, once trained, outputs a corresponding prediction result based on the learned mapping relationship. The output is in the form of a classification label, where 0 represents normal and 1 represents disease, serving as the final prediction result for cardiovascular disease risk.
[0012] In some embodiments, step S8 includes: calculating the SHAP value of each feature for the prediction result using the SHAP framework, wherein the calculation method is to use the SHAP interpreter adapted to the meta-model, and input the meta-model and training set meta-feature data; quantifying the degree of feature contribution by the magnitude of the SHAP value, and determining the direction of feature action by the positive or negative SHAP value, wherein a positive value indicates that the feature increases the risk of disease; and a negative value indicates that the feature reduces the risk of disease.
[0013] In some embodiments, in step S6, KNN is used as the meta-model.
[0014] Compared with the prior art, the present invention has the following beneficial effects: This invention proposes a cardiovascular disease prediction method based on a cross-combination strategy and dynamic weighted stacking ensemble. By employing a multi-feature selection method and a full cross-combination of multiple classifiers, it addresses the problem of insufficient feature association mining. Furthermore, the dynamic weighted stacking ensemble strategy overcomes the poor generalization performance of fixed-weight methods, effectively improving the accuracy, adaptability, and clinical applicability of cardiovascular disease prediction. Specifically: We employ an 8-class feature selection method combined with a 14-class classifier to construct a cluster of 112 heterogeneous base models for a single dataset. This approach captures the interaction of indicators from multiple dimensions, including statistical correlation and information gain, thus avoiding the high signal omission rate of traditional single-strategy approaches.
[0015] The dynamic weight allocation strategy adjusts the base model weights through error feedback, tilting the weights towards the base model that "fits the current data". Experiments show that this invention (CCS-DWSE) leads in core metrics across three datasets: the AUC on the Cleveland dataset reaches 0.9992, a 3.3% improvement over MCF; the recall on the Framingham dataset increases from 24.18% to 50.37%, effectively reducing missed diagnoses; and the accuracy on the CVD dataset is 82.1%, remaining stable even under high noise conditions, as shown in Table 4.
[0016] The SHAP framework enables interpretability analysis of prediction results by quantifying the contribution values of features and their correlation with risk (r-value). Figure 2As shown in Figure 4, in the Cleveland dataset, heart rate (thalach, r=0.966) and fasting blood glucose (fbs, r=0.957) are the core risk indicators, intuitively demonstrating their significant role in disease risk. In the Framingham dataset, total cholesterol (totChol), daily smoking volume (cigsPerDay), and smoking status (currentSmoker) are key influencing factors. In the CVD dataset, smoking (smoke) and alcohol (alcohol) are significantly correlated with disease risk. These visualizations clearly reveal the specific roles of different features in prediction results, effectively breaking the limitations of "black box" models and providing a clear basis for clinical decision-making. Attached Figure Description
[0017] Figure 1 This is a framework diagram for cardiovascular disease prediction based on cross-combination strategy and dynamic weighted stacking; Figure 2 Feature contribution map for the Cleveland dataset; Figure 3 Feature contribution map for the Framingham dataset; Figure 4 Feature contribution map for the CVD dataset. Detailed Implementation
[0018] This invention addresses the limitations of single feature selection strategies and unreasonable weight allocation in ensemble learning methods in existing approaches, proposing a cardiovascular disease prediction method based on cross-combination and dynamic weighted stacking. This invention constructs a heterogeneous base model group through multi-feature selection and multi-classifier cross-combination, selects the base model with the optimal AUC, and then employs a dynamic weighted stacking ensemble strategy. Combined with SHAP analysis, the feature contribution is quantified. The overall framework diagram is shown below. Figure 1 As shown.
[0019] A cardiovascular disease prediction method based on a cross-combination strategy and dynamic weighted stacking includes: S1: Collect data and build a dataset for prediction; S2: Construct a heterogeneous base model set based on the dataset; S3: Using the area under the receiver operating characteristic curve as the evaluation index, the 10 heterogeneous base models with the best performance were selected for subsequent integration; S4: Assign adaptive weights to the 10 heterogeneous base models selected in S3; S5: Use adaptive weights to weight and fuse the prediction probabilities of 10 heterogeneous base models to generate a meta-feature dataset for training the meta-model. S6: Use KNN as the meta-model and train the meta-model using the meta-feature dataset; S7: Input the data into the trained meta-model and predict based on the meta-model's results; S8: Analyze the impact of each characteristic on the risk of disease.
[0020] Specifically, step S1 includes: S11: Collect multi-dimensional patient data, specifically covering demographic characteristics (age, gender, height, weight, education level, etc.), clinical examination indicators (blood pressure, blood glucose, blood lipids, heart rate, electrocardiogram-related parameters, etc.), lifestyle characteristics (smoking status, alcohol consumption, exercise frequency, etc.), and past medical history information (history of hypertension, history of diabetes, family history of heart disease, other chronic diseases, etc.). S12: Standardize the collected raw data, including missing value imputation, outlier removal, data encoding conversion, etc., and finally construct a standardized dataset that can be used for predictive analysis.
[0021] In a specific embodiment, data cleaning and transformation processes were performed on the three public datasets (Cleveland, Framingham, and CVD) to eliminate the interference of data noise on model training. (1) Cleveland dataset: Remove missing samples of “ca” (number of coronary artery lesions) and “thal” (thalassemia type), recode the “thal” value according to clinical significance as 0 (normal), 1 (fixed defect), 2 (reversible defect), and convert the original multi-class target variable into binary label (0 represents normal, 1 represents confirmed diagnosis); (2) Framingham dataset: For “glucose” (blood glucose value) with a missing rate higher than 10%, the KNNImputer algorithm is used to fill missing values (excluding “glucose” and target variables during calculation to avoid data leakage); for variables with a missing rate lower than 5%, missing samples are directly deleted; outliers are detected and removed using the IQR (interquartile range) method. CVD dataset: No missing values, only outlier records are removed using the IQR method to preserve the original features to the maximum extent.
[0022] Specifically, step S2 includes: S21: Feature subset selection: The eight feature selection methods in Table 1 (covering statistical methods: ANOVA F-value, Chi-Squared; filtering methods: Mutual Information, Variance Threshold; wrapping methods: Recursive Feature Elimination; embedding methods: L1-based, Tree-based, Gini Index) are used to mine features strongly related to cardiovascular diseases from different dimensions, and finally obtain multiple effective feature subsets. S22: Diverse Algorithm Selection: 14 types of algorithms from Table 2 are used (covering linear models: LR, SGD; tree models: RF, XGBoost, LGBM; ensemble models: AdaBoost, CatBoost; kernel methods: SVM; neural networks: MLP). These algorithms belong to different modeling paradigms (the core principles and logic include linear modeling paradigm, tree splitting paradigm, kernel mapping paradigm, neural network hierarchical propagation paradigm, etc.), which can comprehensively capture feature correlations (including the correlation between features and cardiovascular disease status, synergistic or inhibitory effects between features, etc.). Among them, S21 provides the "feature input" foundation for subsequent modeling, and S22 provides "method tools" support for modeling. S23: Heterogeneous base model generation: The feature subsets selected in S21 are fully cross-combined with the various algorithm classifiers provided in S22. Each "feature subset-classifier" pairing constitutes an independent base model. Through this multi-dimensional combination method, a large number of heterogeneous base models are generated, thereby enhancing the ability to identify nonlinear relationships of features and potential high-risk signals.
[0023] Table 1 Feature Selection Methods Table 2 Classifiers Specifically, step S3 includes: S31: Divide the preprocessed dataset into training and testing sets in a 7:3 ratio to ensure that the data distribution is consistent between model training and evaluation. S32: Train all heterogeneous base models separately on the training set and make predictions on the test set. Calculate the area under the receiver operating characteristic (AUC) curve for each base model using the following formula: in, The positive class prediction probability output by the model , The true labels for the samples are (1 represents the positive class, 0 represents the negative class). During calculation, first... The test set samples are sorted from highest to lowest probability, and the predicted probability of each sample is used as the classification threshold to calculate the corresponding true positive rate. and false positive rate n is the total number of samples in the test set. and These represent the false positive rate and the true positive rate corresponding to the i-th threshold, respectively.
[0024] S33: Sort all base models from highest to lowest according to the area under the receiver operating characteristic curve; S34: Select the top 10 base models as the optimal base model set for subsequent integration. If there are base models with the same area under the receiver operating characteristic curve, prioritize the base model with lower model complexity and higher computational efficiency.
[0025] From the constructed heterogeneous base model group, the 10 best-performing base models were selected for subsequent integration, using AUC (area under the receiver operating characteristic curve) as the core evaluation metric. AUC takes precedence over accuracy, as it more comprehensively reflects the model's ability to distinguish between "disease-related" and "normal" samples, meeting the clinical need for "reducing missed diagnoses and misdiagnoses" in cardiovascular disease prediction.
[0026] Specifically, step S4 includes: S41: Assign uniform initial weights to the 10 heterogeneous basis models. Let the initial weight of the h-th basis model be... ,but: , S42: Perform multiple iterations within a preset parameter grid, which includes key hyperparameters of the base model (such as update rate, number of iterations, n_neighbors, and p). The specific iteration process is as follows: ① Initialize the number of iterations t=1, and set the maximum number of iterations. and convergence threshold ; ② In the t-th iteration, fix the current weight combination. Iterate through a set of hyperparameter combinations in the parameter grid and retrain each base model; ③ Perform five-fold cross-validation on each base model: Divide the training set into 5 parts randomly and hierarchically (denoted as fold=1,2,3,4,5), use the fold-th part as the validation set, and use the remaining 4 parts as the training set to retrain the base model, and calculate its accuracy on the fold-th validation set. ④ Calculate the average accuracy of the h-th base model in the t-th iteration using five-fold cross-validation: in This represents the average accuracy of the h-th base model in the t-th iteration using five-fold cross-validation. This represents the accuracy of the h-th base model on the h-th fold of data; ⑤ If the change in average accuracy between two adjacent iterations satisfies or If the iteration fails, stop; otherwise, let t = t + 1 and return to step ② to continue the iteration. S43: Calculate the prediction error of the base model in reverse using the accuracy rate: in This represents the prediction error of the h-th base model in the t-th iteration (the value ranges from 0 to 1, and the larger the value, the worse the prediction effect). S44: The weights are dynamically updated based on an error feedback mechanism. The larger the error, the greater the weight decay. in This represents the weight of the h-th base model after the t-th iteration update. This represents the weight after the (t-1)th iteration. To control the update rate, adjust the weight adjustment step size; S45: Normalize the updated weights to ensure that the sum of all weights is 1. in This represents the normalized weights, which will be used as the final weights for integrated prediction; S46: Evaluate the performance of the ensemble model obtained by weighting the current weight combination based on the performance of the 10 heterogeneous base models on the test set (e.g., AUC, accuracy, recall). Quantify the ensemble performance on the test set using task-related core metrics (e.g., AUC) and select the weight combination with the best performance. and hyperparameter combinations If multiple combinations exhibit identical performance, the combination with a more uniform weight distribution and a simpler hyperparameter structure should be selected. The resulting hyperparameter combinations... This will be used to retrain 10 heterogeneous base models on the full training set, providing basic model support for subsequent meta-feature generation and prediction tasks.
[0027] Specifically, step S5 includes: S51: Use S45 to update the normalized weights, and perform weighted fusion of the predicted probabilities of the 10 heterogeneous base models to generate the meta-feature value of a single sample. in Let i be the meta-feature value of the i-th sample. Let h be the optimal weights for the h-th base model. Let h be the predicted probability of the h-th base model for the i-th sample; S52: For each sample in the training set, calculate its corresponding meta-feature value one by one according to the weighted fusion formula in S51. All meta-feature values of all samples are arranged into feature vectors according to sample order, and combined with the true labels of the samples to construct a complete meta-feature dataset for training the meta-model: Where I is the total number of samples in the training set. Let be the true label of the i-th sample.
[0028] Specifically, in step S6: KNN (K-Nearest Neighbors algorithm) is used as the meta-model and trained on the meta-feature dataset: the core parameters of KNN (number of nearest neighbors n_neighbors, distance metric p) are set according to Table 3, and the optimal values are determined by grid search; By employing a two-level ensemble structure of "base model-meta-model," the model's adaptability and generalization performance across different dataset distributions are enhanced. KNN, as a non-parametric model, requires no pre-defined data distribution and allows for flexible control of model complexity by adjusting the n_neighbors (number of nearest neighbors) value. It captures local features while resisting noise and reducing the risk of overfitting. It requires no complex training process, completing predictions solely through storing training data and calculating distances, resulting in high computational efficiency and suitability for the rapid response requirements of real-time medical scenarios. Furthermore, based on the characteristics of local similarity-based decision-making, it naturally captures the non-linear relationships between meta-features, and stable generalization performance can be ensured by appropriately selecting the n_neighbors (number of nearest neighbors) and distance metric. Therefore, KNN was chosen as the meta-model.
[0029] The core criteria for selection are: moderate model complexity, computational efficiency suitable for the scenario, ability to capture nonlinear relationships of meta-features, and stable generalization performance.
[0030] Specifically, step S7 includes: S71: Input the meta-feature dataset constructed in S5 into a pre-defined meta-model (such as KNN). Train the meta-model by minimizing the prediction error, enabling it to learn the mapping relationship between meta-feature values and true labels, which is equivalent to learning the decision-making pattern of a combination of 10 base models. Save the optimal meta-model parameters after training. S72: For newly input patient data, first input it through the optimal hyperparameters. The 10 heterogeneous base models trained were used to obtain the prediction probability of each base model for the patient. Then use the optimal weight Calculate the meta-features of this new patient: ; S73: Transfer the meta-feature values of the new patient The optimal meta-model, after being trained, is input into the system. Based on the learned mapping relationship, the meta-model outputs the corresponding prediction result in the form of a classification label (0 for normal and 1 for disease), which serves as the final prediction result for cardiovascular disease risk.
[0031] Step S8 includes: calculating the SHAP value of each feature for the prediction result using the SHAP framework, the calculation method is to use the SHAP interpreter adapted to the meta-model, inputting the meta-model and training set meta-feature data; quantifying the degree of feature contribution by the magnitude of the SHAP value, and judging the direction of feature effect by the positive or negative SHAP value, a positive value indicates that the feature increases the risk of disease; a negative value indicates that the feature reduces the risk of disease.
[0032] Cardiovascular disease prediction models need to provide clear decision-making basis for medical personnel. This step, by quantifying the contribution and direction of action of features, breaks through the "black box" limitation of integrated models, enhances the credibility and usability of models in clinical practice, and is a key step in connecting model prediction results with clinical applications.
[0033] The prediction results of the ensemble model are explained based on the SHAP framework: (1) Calculate the SHAP value of each feature for the prediction result. This is achieved by using the KernelExplainer, an interpreter adapted to the KNN meta-model in the SHAP library. Input the meta-model and the meta-feature data of the training set, and calculate the SHAP value of each feature in each sample. Essentially, it is to fairly allocate the contribution of each feature to the prediction result through the Shapley value. (2) The contribution of a feature is quantified by the magnitude of the SHAP value, and the direction of the feature's effect is determined by the positive or negative value of the SHAP value (a positive value indicates that the feature increases the risk of disease, such as hyperglycemia; a negative value indicates that the feature reduces the risk of disease, such as regular exercise). (3) Generate feature contribution maps (as shown in Figure 2-4) to intuitively display the impact of key risk indicators under each dataset, provide clear model decision-making basis for medical personnel, and enhance the credibility and usability of the model in clinical practice.
[0034] The specific implementation details of this invention are as follows: Application environment: Based on a hardware platform with i5-1035G1 CPU, 1.00GHz, and 16GDDR4 memory, using the Python programming language and relying on machine learning frameworks such as NumPy, Scikit-learn, and Shap for development.
[0035] Related technologies: This invention is based on a multi-feature selection method, a multi-classifier, and dynamically weighted stacked ensemble learning. The multi-feature selection method eliminates irrelevant and redundant features through a multi-dimensional screening mechanism, providing the model with a high-quality feature subset. The multi-classifier is an algorithmic system for classifying samples, capturing the correlation between features and target variables from different paradigms. Dynamically weighted stacked ensemble learning is a two-level collaborative model fusion strategy. It dynamically adjusts and normalizes weights through error feedback, and then optimizes predictions by learning the decision patterns of base models through a meta-model, adapting to differences in data distribution to improve ensemble performance. In the field of cardiovascular disease prediction, this invention differs from traditional methods in that it fully explores feature correlations, dynamically allocates weights to solve the problem of insufficient generalization of fixed weights, and possesses strong robustness.
[0036] Parameter settings: In model testing and optimization, the iteration round T and update rate are... KNN nearest neighbor count n_neighbors Distance metric p These are several important parameters. After repeated experiments and grid search verification, the optimal parameters were determined as shown in Table 3.
[0037] Performance Comparison with Existing Methods: Our proposed method (CCS-DWSE) was compared with existing methods (MCF, XGBLR-IMBODE) on three datasets. Evaluation metrics included accuracy, precision, recall, F1 score, and AUC. The results are shown in Table 4. Our invention outperforms the comparison methods in all core metrics across the datasets. Specifically, the AUC value reaches 0.9992 on the Cleveland dataset, 0.9539 on the Framingham dataset, and 0.9028 on the CVD dataset, fully demonstrating the accuracy and generalization ability of our proposed method.
[0038] Table 3 Key Parameter Settings Table 4 Performance Comparison of Various Methods .
Claims
1. A method for predicting cardiovascular diseases based on a cross-combination strategy and dynamic weighted stacking, characterized in that, include: S1: Collect data and build a dataset for prediction; S2: Construct a heterogeneous base model set based on the dataset; S3: Using the area under the receiver operating characteristic curve as the evaluation index, the 10 heterogeneous base models with the best performance were selected for subsequent integration; S4: Assign adaptive weights to the 10 heterogeneous base models selected in S3; S5: Use adaptive weights to weight and fuse the prediction probabilities of 10 heterogeneous base models to generate a meta-feature dataset for training the meta-model. S6: Select a meta-model and train it using the meta-feature dataset; S7: Input the data into the trained meta-model and predict based on the meta-model's results; S8: Analyze the impact of each characteristic on the risk of disease.
2. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 1, characterized in that, Step S1 includes: S11: Collect multi-dimensional patient data, specifically covering demographic characteristics, clinical examination indicators, lifestyle characteristics, and past medical history. S12: Standardize the collected raw data to ultimately construct a standardized dataset that can be used for predictive analysis.
3. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 1, characterized in that, Step S2 includes: S21: Discover features strongly correlated with cardiovascular diseases from different dimensions, and finally obtain multiple effective feature subsets; S22: Select a variety of algorithms, including: LR, SGD, RF, XGBoost, LGBM, AdaBoost, CatBoost, SVM and MLP; S23: Combine the feature subsets obtained from S21 with the various algorithm classifiers provided in S22 to generate heterogeneous base models through full cross-combination.
4. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 1, characterized in that, Step S3 includes: S31: Divide the preprocessed dataset into a training set and a validation set to ensure consistent data distribution; S32: Train all heterogeneous base models separately on the training set and make predictions on the test set, and calculate the area under the receiver operating characteristic curve for each base model; S33: Sort all base models from highest to lowest according to the area under the receiver operating characteristic curve; S34: Select the top 10 base models as the optimal base model set for subsequent integration. If there are base models with the same area under the receiver operating characteristic curve, select the base model with lower model complexity and higher computational efficiency.
5. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 1, characterized in that, Step S4 includes: S41: Assign uniform initial weights to the 10 heterogeneous basis models; S42: Perform multiple iterations within a preset parameter grid range; S43: Calculate the prediction error of the base model in reverse using the accuracy rate: in This represents the prediction error of the h-th base model in the t-th iteration, with a value ranging from 0 to 1. A larger value indicates a worse prediction effect. S44: The weights are dynamically updated based on an error feedback mechanism. The larger the error, the greater the weight decay. in This represents the weight of the h-th base model after the t-th iteration update. This represents the weight after the (t-1)th iteration. To control the update rate, adjust the weight adjustment step size; S45: Normalize the updated weights to ensure that the sum of all weights is 1; S46: Evaluate the performance of the ensemble model obtained by weighting the current weight combination based on the performance of the 10 heterogeneous base models on the test set.
6. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 5, characterized in that, Step S5 includes: S51: Use S45 to update the normalized weights, and perform weighted fusion of the predicted probabilities of the 10 heterogeneous base models to generate the meta-feature value of a single sample. in Let i be the meta-feature value of the i-th sample. Let h be the optimal weights for the h-th base model. Let h be the predicted probability of the h-th base model for the i-th sample; S52: For each sample in the training set, calculate its corresponding meta-feature value one by one according to the weighted fusion formula in S51. All meta-feature values of all samples are arranged into feature vectors according to sample order, and combined with the true labels of the samples to construct a complete meta-feature dataset for training the meta-model: Where I is the total number of samples in the training set. Let be the true label of the i-th sample.
7. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 1, characterized in that, Step S7 includes: S71: Input the meta-feature dataset constructed in S5 into the preset meta-model, train the meta-model by minimizing the prediction error, so that it learns the mapping relationship between meta-feature values and true labels, and save the optimal meta-model parameters after training is completed. S72: Input new patient data, first inputting it through the optimal hyperparameters. The 10 heterogeneous base models trained were used to obtain the prediction probability of each base model for the patient. Then, the meta-feature values of the new patient are calculated using the optimal weights: ; S73: Meta-feature values of new patients The meta-model, once trained, outputs a corresponding prediction result based on the learned mapping relationship. The output is in the form of a classification label, where 0 represents normal and 1 represents disease, serving as the final prediction result for cardiovascular disease risk.
8. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 1, characterized in that, Step S8 includes: calculating the SHAP value of each feature for the prediction result using the SHAP framework, the calculation method being to use the SHAP interpreter adapted to the meta-model, inputting the meta-model and training set meta-feature data; quantifying the degree of feature contribution by the magnitude of the SHAP value, and determining the direction of feature action by the positive or negative SHAP value, with a positive value indicating that the feature increases the risk of disease and a negative value indicating that the feature reduces the risk of disease.
9. The cardiovascular disease prediction method based on cross-combination strategy and dynamic weighted stacking according to claim 1, characterized in that, In S6, KNN is used as the meta-model.