An explainable heart disease risk warning method based on association interaction

CN119905275BActive Publication Date: 2026-10-27GUANGDONG OCEAN UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510181084.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-19
Publication Date
2026-10-27
Estimated Expiration
2045-02-19

AI Technical Summary

Technical Problem

然而,该方法基于特征之间相互独立的假设,这导致难以观察不同特征之间的交互关联关系,使得难以在心脏病风险解释性领域落地

Benefits of technology

本发明针对心脏病风险是否存在两种类别分别构建关联规则特征,通过挖掘关联交互信息丰富数据集,该方法缓解了传统模型难以从小规模心脏病数据集中学习相关信息的挑战;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119905275B_ABST
    Figure CN119905275B_ABST
Patent Text Reader

Abstract

The application discloses an explainable heart disease risk early warning method based on association interaction, comprising the following steps: S1, acquiring a Kaggle public heart disease dataset and preprocessing the same; S2, performing association rule feature mining and feature selection on two categories of whether a heart disease risk exists; S3, using a random forest classifier based on Bayesian optimization of a TPE process to perform risk early warning, and using an isotonic regression to further calibrate a prediction result; and S4, analyzing a contribution degree of a key influencing factor and an interaction on a heart disease risk by using a SHAP model. The application can effectively select meaningful association rule features, and enhances the robustness of a final heart disease risk early warning model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an interpretable method for early warning of heart disease risk based on correlation and interaction. Background Technology

[0002] Heart disease remains a leading cause of death worldwide, and developing heart disease risk warning models using data mining techniques is an emerging trend. However, improving the predictive accuracy of heart disease risk warning models on small datasets remains a challenge. Furthermore, most existing heart disease risk warning models suffer from limitations in interpretability, hindering their widespread clinical application.

[0003] In the area of ​​cardiac risk warning, predictive models aim to establish a robust and efficient early warning model based on cardiovascular disease-related indicators of potential patients for early risk identification and intervention. Currently, cardiac risk warning models are mainly divided into cardiac risk warning models based on electrocardiogram (ECG) signals and cardiac risk warning models based on influencing factors. ECG-based warning models utilize image processing techniques to extract high-order features from patients' ECGs for prediction. However, this type of warning model requires difficult and costly sample acquisition and is slow to collect data.

[0004] Descriptive models aim to reveal the contribution and interaction of relevant influencing factors to heart disease risk, providing interpretability analysis for early warning models. Existing interpretability analysis methods are mainly divided into three types: intrinsic interpretability, ex-post interpretability, and model interpretation visualization. Intrinsic interpretability methods refer to the results of the predictive model's evaluation of influencing factors during training, such as the regression coefficients of logistic regression. Although this method can represent positive and negative correlations and the degree of influence through the sign and magnitude of the coefficients, it is difficult to capture complex nonlinear relationships, limiting the application scenarios of this type of method. Ex-post interpretability methods refer to methods that help interpret complex models after the model's prediction task, such as tree-based feature importance methods that quantify the degree of influence by calculating information gain or the decrease in impurity during feature segmentation. However, this type of method can only provide a global interpretation of the model and cannot analyze the relationship between individual features and sample distribution. The SHAP model is an emerging interpretability method that provides global, local, and interactive interpretations of the model by calculating the Shapley value for each sample. However, few previous studies have analyzed the interactive interpretation of factors influencing heart disease risk. Model interpretation visualization methods refer to directly analyzing the importance of influencing factors through visualizations such as partial dependency graphs to show the degree of influence of specific feature values ​​on model predictions. However, this method is based on the assumption that features are independent of each other, which makes it difficult to observe the interaction relationships between different features, making it difficult to apply in the field of cardiac risk interpretation.

[0005] To address the aforementioned issues, an interpretable method for early warning of heart disease risk based on relational interactions is proposed. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of existing methods and provide an interpretable heart disease risk warning method based on association interaction, which can effectively select meaningful association rule features and enhance the robustness of the final heart disease risk warning model.

[0007] The technical solution to achieve the above objectives is: An interpretable cardiac risk early warning method based on correlational interactions includes: Step S1: Obtain the publicly available heart disease dataset from Kaggle and preprocess it; Step S2 involves performing association rule feature mining and feature selection for the two categories of heart disease risk. Step S3: Use a Bayesian optimized random forest classifier based on the TPE process for risk warning, and use order-preserving regression to further calibrate the prediction results. Step S4: Analyze the contribution of key influencing factors and their interaction with heart disease risk using the SHAP (Machine Learning Model Interpretation and Visualization Tool) model.

[0008] Preferably, in step S1, the heart disease dataset publicly available by Kaggle (dataset platform) includes five public sub-datasets: Cleveland, Hungarian, Switzerland, Long Beach VA, and Stalog; In step S1, the continuous features of the heart disease dataset are preprocessed by equal-width binning.

[0009] Preferably, in step S2, the two categories are: having heart disease risk and not having heart disease risk, and association rule feature mining and feature selection are performed respectively, including: The Aprior algorithm was used to mine association rules, and binary variables were constructed as association rule features. Next, the SuSIE model is used to filter the features of the association rules.

[0010] Preferably, in step S2, association rule mining belongs to the unsupervised learning algorithm in machine learning, and an association rule can be defined by the following formula: ; In the formula, Indicates the preceding term of the association rule. Indicates the term following the association rule. Represents itemsets; The goal of association rule mining is to find the preceding terms Given the existence of itemsets, it is possible to predict subsequent items while satisfying a certain strength threshold. The rules governing the occurrence of middle itemsets; In association rule mining, support, confidence, and lift are three metrics commonly used to evaluate the strength and relevance of these rules. Support is defined as the sum of the preceding terms in the dataset. and the following item The proportion is expressed by the following formula: ; In the formula, Indicates that it includes the preceding term. and the following item Quantity, This indicates the total number of itemsets in the dataset; Confidence level is defined as the preceding term. Given that it exists, the latter term The proportion of occurrence is expressed by the following formula: ; Lift is defined as the subsequent term. The appearance of the preceding term The degree of improvement is expressed by the following formula: ; If the lift is greater than 1, it indicates that the preceding term... and the following item Positive correlation; a value less than 1 indicates the preceding term. and the following item Negative correlation.

[0011] Preferably, in step S2, the SuSIE (sum of single effects regression) model is based on the SER (single effect regression) model. Let the SuSIE model be a multiple regression model. If only one of the explanatory variables has a non-zero regression coefficient, i.e., the effect variable, then in the SER model, assuming the residual variance... Prior variance of effect variables and prior inclusion probability The SER model can be defined by the following formula: ; ; ; ; ; In the formula, yes dimensional target variable, express Sample A matrix of exogenous variables in 1 dimension The coefficients representing the effect variables, express The indicator variable of dimension, used to indicate the first dimension. Are the variables effect variables? express A vector of regression coefficients in dimensional form. Represents the error vector. Indicates the class probability as The multinomial distribution; level A credible set is defined as one containing at least one effect variable with a probability of at least 1. A subset of variables, using posterior inclusion probability in Bayesian regression variable selection. Let the probability of each variable being selected in the trust set be expressed as follows: ; In a given and Then, the posterior included probability vector can be derived from single-effect regression. ,in The calculation method is as follows: ; Based on the aforementioned SER model and the principle of trust sets, multiple single effect vectors are introduced. and the overall effect vector Constructed as the sum of these individual effects, i.e., SuSIE: ; ; ; ; ; ; In the formula, To select feature parameters.

[0012] Preferably, in step S3, the core idea of ​​random forest is to use a set of decision trees to train and predict the input data; the results of all trees are aggregated to make the final prediction, and each decision tree... These are all bootstrap samples extracted from the original dataset. The training is performed on the tree, and at each node, a subset of features is randomly selected to partition the data, thereby introducing variability between the trees; For a given input The prediction is obtained by aggregating the predictions of all decision trees in the forest. For classification tasks, the final prediction result is determined by majority vote and can be expressed as follows: ; In the formula, Indicates input The Prediction of decision trees It is the total number of trees in the forest, and the predicted category in the majority vote. It is the category that received the most votes across all trees.

[0013] Preferably, in step S3, the Bayesian optimization algorithm based on the TPE process is used to optimize the hyperparameters of the random forest classifier, including: Each hyperparameter is set to follow a Gaussian distribution with a mean of 0, and then samples are taken from that distribution; Random sampling Group hyperparameters And calculate the true loss of the model when these hyperparameters are applied. ; The TPE (Tree-Based Bayesian Optimization) process is set as a surrogate function fitting. ,right The following divisions are made: ; ; Based on this division, we can obtain: ; for Choose and set hyperparameters to indicate The quantiles, i.e. Therefore, the above formula can be simplified as follows: ; The EI (Expected Improvement) function is selected as the acquisition function to evaluate the acquisition points. The EI function represents the average improvement relative to a given threshold. For the collection point set Each collection point calculate And select the optimal one from the collection points. Substitute into the model to calculate the actual loss The formula for the EI function is as follows: ; The value of the EI function is inversely proportional to its denominator, and the size of the denominator depends on the proportion. Therefore, the optimal sampling point is the one that maximizes this ratio; Will Add to collection Form a new Repeat the above steps until the maximum number of iterations is reached, thus completing the hyperparameter optimization of the random forest classifier.

[0014] Preferably, in step S3, ordinal-preserving regression is a technique for fitting a free-form line to a series of observations, such that the fitted line is monotonic at any position and is as close as possible to the observations. The established order-preserving regression model is solved using the PAV algorithm. This method has only one constraint, namely that the function space is a space of monotonically increasing functions. The main steps are as follows: Assuming each observed variable Follows a normal distribution , and when Timely satisfaction ; Using the previous step as a monotonic constraint, identify points that violate this constraint and form a monotonic sequence with their neighbors. Assume that points within this range follow the same distribution. At that time, the order was in Points within the range satisfy a normal distribution. ; If the newly constructed distribution violates the monotonicity constraint in subsequent comparisons, such as when... The situation makes it possible to... Points within the range will satisfy ; Repeat the above steps until the distribution stabilizes and no longer violates the monotonicity constraint, and then further calibrate the prediction results.

[0015] Preferably, in step S4, the SHAP model is obtained through... Will Mapped to This creates a simplified input method; based on Original model The following is an example of a linear function that can be approximated as a bivariate variable: ; In the formula, , It is the number of input features. , The contribution value of a feature is calculated as follows: ; ; In the formula, yes The non-zero set of inputs, yes Exclude the A subset of features It is a unified measure of additive feature attributes, namely the SHAP value. This represents the output probability of the prediction model.

[0016] The beneficial effects of this invention are: This invention constructs association rule features for two categories: the presence or absence of heart disease risk. By mining association interaction information, the dataset is enriched. This method alleviates the challenge of traditional models learning relevant information from small-scale heart disease datasets. This invention uses the SuSIE algorithm to filter association rule features. Compared with traditional feature filtering methods, this algorithm can make the best selection from multiple highly related association rule features through a confidence set, thereby reducing the redundancy between association rule features and effectively alleviating overfitting. This invention uses a random forest classifier tuned by the TPE process for risk prediction and calibrates the prediction results using ordination-preserving regression to enhance the robustness of the final heart disease risk warning model. This invention utilizes the SHAP model to conduct interpretability analysis on a heart disease risk warning model, exploring the degree of contribution and the magnitude and direction of the interaction between key influencing factors and heart disease risk. Attached Figure Description

[0017] Figure 1 This is a flowchart of an interpretable heart disease risk early warning method based on correlation interaction according to the present invention; Figure 2 This is the overall architecture diagram of the interpretable heart disease risk early warning model in this invention; Figure 3 This is a schematic diagram of the ROC curve of the original method on the dataset; Figure 4 This is a schematic diagram of the ROC curve of the method proposed in this invention on the dataset; Figure 5 This is a schematic diagram of the confusion matrix of the original method on the dataset; Figure 6 This is a schematic diagram of the confusion matrix of the method proposed in this invention on the dataset; Figure 7 This is a summary diagram of the SHAP model based on random forest in this invention. Figure 8This is the SHAP bee colony graph drawn based on the SHAP model of random forest in this invention; Figure 9 This is the interaction dependency graph of ST_Slope with respect to Cholesterol, Oldpeak, and MaxHR in this invention; Figure 10 This is the Cholesterol interaction dependency graph regarding ST_Slope, Oldpeak, and MaxHR in this invention; Figure 11 This is the interaction dependency graph of Oldpeak regarding ST_Slope, Cholesterol, and MaxHR in this invention; Figure 12 This is the interaction SHAP dependency graph of MaxHR with respect to ST_Slope, Cholesterol, and Oldpeak in this invention. Detailed Implementation

[0018] The technical solution of the present invention will now be clearly and completely described in conjunction with the accompanying drawings. In the description of the present invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0019] The invention will now be further described with reference to the accompanying drawings.

[0020] like Figure 1 As shown, an interpretable cardiac risk early warning method based on association interaction is divided into three stages: feature engineering, association rule feature mining and feature selection, and risk early warning and interpretability analysis. The overall model architecture diagram is shown below. Figure 2 As shown, it includes: Feature engineering phase: Step S1: Obtain the publicly available heart disease dataset from Kaggle and preprocess it.

[0021] In the example, the publicly available heart disease dataset from Kaggle includes five public subsets: Cleveland, Hungarian, Switzerland, Long Beach VA, and Stalog.

[0022] In this embodiment, continuous features of the heart disease dataset are preprocessed using equal-width binning.

[0023] Association rule feature mining and feature selection stages: Step S2 involves performing association rule feature mining and feature selection for the existence of two categories of heart disease risk.

[0024] In this embodiment, the two categories are: those with heart disease risk and those without heart disease risk. Association rule feature mining and feature selection are performed on each category, including: The Aprior algorithm was used to mine association rules, and binary variables were constructed as association rule features. Next, the SuSIE model is used to filter the features of the association rules.

[0025] In this embodiment, association rule mining belongs to the unsupervised learning algorithm in machine learning. This method reveals the correlation between data based on support and confidence. Association rule mining can not only be used to explain the relationship between antecedents and consequents, but also to enhance the information content of the heart disease dataset by constructing binary variables for feature engineering. An association rule can be defined by the following formula: ; In the formula, Indicates the preceding term of the association rule. Indicates the term following the association rule. Represents itemsets; The goal of association rule mining is to find the preceding terms Given the existence of itemsets, it is possible to predict subsequent items while satisfying a certain strength threshold. The rules governing the occurrence of middle itemsets; In association rule mining, support, confidence, and lift are three metrics commonly used to evaluate the strength and relevance of these rules. Support is defined as the sum of the preceding terms in the dataset. and the following item The proportion is expressed by the following formula: ; In the formula, Indicates that it includes the preceding term. and the following item Quantity, This indicates the total number of itemsets in the dataset; Confidence level is defined as the preceding term. Given that it exists, the latter term The proportion of occurrence is expressed by the following formula: ; Lift is defined as the subsequent term. The appearance of the preceding term The degree of improvement is expressed by the following formula: ; If the lift is greater than 1, it indicates that the preceding term... and the following item Positive correlation; a value less than 1 indicates the preceding term. and the following item Negative correlation.

[0026] This invention utilizes the Apriori algorithm to mine association rules from a dataset processed with equal-width bins, separately identifying two categories of samples: those indicating the presence or absence of heart disease risk. Support and confidence metrics are used to evaluate the importance and strength of the extracted rules, retaining only those rules that meet predefined support and confidence thresholds. Finally, association rules for the two categories of heart disease risk are constructed as distinct binary variables, namely, association rule features.

[0027] In this embodiment, the SuSIE model is based on the SER model, and is assumed to be a multiple regression model. If only one of the explanatory variables has a non-zero regression coefficient, i.e., the effect variable, then in the SER model, assuming the residual variance... Prior variance of effect variables and prior inclusion probability The SER model can be defined by the following formula: ; ; ; ; ; In the formula, yes dimensional target variable, express Sample A matrix of exogenous variables in 1 dimension The coefficients representing the effect variables, express The indicator variable of dimension, used to indicate the first dimension. Are the variables effect variables? express A vector of regression coefficients in dimensional form. Represents the error vector. Indicates the class probability as The multinomial distribution; level A credible set is defined as one containing at least one effect variable with a probability of at least 1. A subset of variables, using posterior inclusion probability in Bayesian regression variable selection. Let the probability of each variable being selected in the trust set be expressed as follows: ; In a given and Then, the posterior included probability vector can be derived from single-effect regression. ,in The calculation method is as follows: ; Based on the aforementioned SER model and the principle of trust sets, multiple single effect vectors are introduced. and the overall effect vector Constructed as the sum of these individual effects, i.e., SuSIE: ; ; ; ; ; ; In the formula, To select feature parameters, this invention specifies the maximum selectable feature parameter. It is 10.

[0028] Risk warning and interpretability analysis phase: Step S3: Use a Bayesian-optimized random forest classifier based on the TPE process for risk warning, and use order-preserving regression to further calibrate the prediction results.

[0029] In this embodiment, the core idea of ​​random forest is to use a set of decision trees to train and predict the input data; the results of all trees are aggregated to make the final prediction, and each decision tree... These are all bootstrap samples extracted from the original dataset. The training is performed on the tree, and at each node, a subset of features is randomly selected to partition the data, thereby introducing variability between the trees; For a given input The prediction is obtained by aggregating the predictions of all decision trees in the forest. For classification tasks, the final prediction result is determined by majority vote and can be expressed as follows: ; In the formula, Indicates input The Prediction of decision trees It is the total number of trees in the forest, and the predicted category in the majority vote. It is the category that received the most votes across all trees.

[0030] In this invention, each tree in the constructed random forest is a CART tree, characterized by its ability to capture nonlinear relationships between features. The splitting criterion for the leaf nodes of the constructed CART trees is the Gini coefficient. Samples are split by calculating the decrease in impurity of the nodes, which can better handle binary classification tasks.

[0031] In this embodiment, Bayesian optimization is a method for optimizing an objective function by establishing a probabilistic model that links hyperparameters to performance. By continuously observing the evaluation results of the objective function, the posterior probability distribution is updated to make a more informed choice for the next hyperparameter to be evaluated. Commonly used surrogate models in Bayesian optimization include Gaussian processes and TPE processes. A Bayesian optimization algorithm based on the TPE process is used to optimize the hyperparameters of a random forest classifier, including: Each hyperparameter is set to follow a Gaussian distribution with a mean of 0, and then samples are taken from that distribution; Random sampling Group hyperparameters And calculate the true loss of the model when these hyperparameters are applied. ; Set the TPE process to surrogate function fitting ,right The following divisions are made: ; ; Based on this division, we can obtain: ; for Choose and set hyperparameters to indicate The quantiles, i.e. The present invention will The value is set to 0.25, so the above formula is simplified as follows: ; The EI function is selected as the acquisition function to evaluate the acquisition points. The EI function represents the average improvement relative to a given threshold. For the collection point set Each collection point calculate And select the optimal one from the collection points. Substitute into the model to calculate the actual loss The formula for the EI function is as follows: ; The value of the EI function is inversely proportional to its denominator, and the size of the denominator depends on the proportion. Therefore, the optimal sampling point is the one that maximizes this ratio; Will Add to collection Form a new Repeat the above steps until the maximum number of iterations is reached, thus completing the hyperparameter optimization of the random forest classifier.

[0032] In this embodiment, in traditional classification prediction, the probability output by the model often deviates from the true probability of the sample class. This deviation between the model output and the actual result can have a significant impact on the early warning of heart disease risk. To address this issue, this invention employs ordinal-preserving regression as a post-processing technique. Ordinal-preserving regression is a technique that fits a free-form line to a series of observations, ensuring that the fitted line is monotonic at any position and as close as possible to the observations.

[0033] The established order-preserving regression model is solved using the PAV algorithm. This method has only one constraint, namely that the function space is a space of monotonically increasing functions. The main steps are as follows: Assuming each observed variable Follows a normal distribution , and when Timely satisfaction ; Using the previous step as a monotonic constraint, identify points that violate this constraint and form a monotonic sequence with their neighbors. Assume that points within this range follow the same distribution. At that time, the order was in Points within the range satisfy a normal distribution. ; If the newly constructed distribution violates the monotonicity constraint in subsequent comparisons, such as when... The situation makes it possible to... Points within the range will satisfy ; Repeat the above steps until the distribution stabilizes and no longer violates the monotonicity constraint, and then further calibrate the prediction results.

[0034] Step S4: Analyze the contribution of key influencing factors and their interaction with heart disease risk using the SHAP model.

[0035] In the embodiment, the SHAP model is implemented through... Will Mapped to This creates a simplified input method; based on Original model The following is an example of a linear function that can be approximated as a bivariate variable: ; In the formula, , It is the number of input features. , The contribution value of a feature is calculated as follows: ; ; In the formula, yes The non-zero set of inputs, yes Exclude the A subset of features It is a unified measure of additive feature attributes, namely the SHAP value. This represents the output probability of the prediction model.

[0036] The five cardiac datasets used in this invention are Cleveland, Hungarian, Switzerland, LongBeach VA, and Stalog, all of which can be obtained from the Kaggle platform. The datasets used have a total of 11 attributes, and the attribute information is shown in Table 1.

[0037] Table 1 Attribute information of the dataset The dataset used in this invention contains 918 non-repeating samples. To verify the effectiveness of the proposed method, 33% of the samples were randomly selected as the test set, and the remaining samples were used as the training set. During hyperparameter optimization of the random forest, the TPE process was used for 10-fold cross-validation on the training set. The target variable in the dataset is heart disease, a binary variable where a value of 1 indicates a risk of heart disease (55.34%) and 0 indicates no risk (44.66%). Age and gender characteristics represent basic patient information. In the dataset, the age group is predominantly middle-aged and elderly, and the gender group is predominantly male. ChestPainType, FastingBS, RestingECG, ExerciseAngina, and ST_Slope are discrete variables, while RestingBP, Cholesterol, MaxHR, and Oldpeak are continuous variables. These variables contain potential information about the patients' diabetes risk, cardiovascular risk, and metabolic function. Most patients in the dataset are at risk of early-stage heart disease and mild ischemia.

[0038] This invention uses various metrics to evaluate the performance of proposed models in different prediction models. These metrics are used to evaluate the effectiveness of binary classification tasks, as described below.

[0039] Accuracy: Accuracy is the proportion of instances correctly predicted by the model out of the total number of predictions. It is calculated as the ratio of the total number of true positive and false positive samples to all samples. ; Precision: Precision is the ratio of correctly predicted positive instances to all instances predicted as positive. The precision of a class is calculated using the following formula: ; Recall: Recall is the ratio of correctly predicted positives to all actual positives. The recall rate of a class is calculated using the following formula: ; F1 Score: The F1 score is the harmonic mean of precision and recall. (Category) The F1 score is calculated by the following formula: ; AUC-ROC: The area under the receiver operating characteristic curve (AUC-ROC) is a performance metric for classification problems. It reveals the trade-off between the true positive rate and the false positive rate, and is calculated using the following formula: ; The true positive rate (TP) refers to instances correctly predicted as positive; the true negative rate (TN) refers to instances correctly predicted as negative; the false positive rate (FP) refers to instances incorrectly predicted as positive; and the false negative rate (FN) refers to instances incorrectly predicted as negative.

[0040] The key to mining association rules lies in generating frequent itemsets and filtering strong rules. A frequent itemset is defined as an itemset that satisfies a minimum support threshold. A strong rule is defined as a rule within a frequent itemset that satisfies a minimum confidence threshold. This invention performs association rule mining on two categories of samples—those indicating the presence or absence of heart disease risk—with support and confidence thresholds set to 0.2 and 0.6, respectively.

[0041] To meet the data requirements of the Aprior algorithm, this invention performs equal-width binning on the continuous variables of the dataset, and the binning results are shown in Table 2.

[0042] Table 2 Binning Boundaries for Continuous Variables The Apriori algorithm was applied to the two categories of "presence or absence of heart disease risk," resulting in 50 association rules for "absence or absence of heart disease risk" and 48 association rules for "presence or absence of heart disease risk." Some of the association rules obtained from the dataset are shown in Tables 3 and 4. Table 3 does not contain association rules for heart disease risk. Table 4 Association Rules for Cardiac Risk By constructing binary variables for the aforementioned association rules, features with associated interactions can be introduced. However, the number of features for the constructed association rules is as high as 98, which can lead to overfitting during model training; therefore, feature selection is necessary.

[0043] After identifying association rules, binary variables are constructed, referred to as association rule features. For association rule features indicating the absence of heart disease risk, samples meeting the precondition are assigned a value of 1; otherwise, they are assigned a value of 0. For association rule features indicating the absence of heart disease risk, samples meeting the antecedent condition are assigned a value of 3; otherwise, they are assigned a value of 2. After processing, the dataset used in this invention consists of three parts: the original features in the dataset (hereinafter referred to as influencing factors), association rule features indicating the presence of heart disease risk, and association rule features indicating the absence of heart disease risk.

[0044] To improve the model's generalization ability and select the features that contribute most to the dependent variable, this invention uses SuSIE to sequentially filter features from the three components of the dataset. The selection of association rule features for influencing factors, absence of heart disease risk, and presence of heart disease risk is shown in Table 5.

[0045] Table 5 shows the results of selecting the three components of the dataset. Where variable represents the name of the selected variable, variable_prob represents the probability that the variable is a significant effect variable, i.e., the marginal posterior inclusion probability, cs represents the exponent of the confidence set to which the variable belongs, and cs_log10bf represents the logarithm of the Bayes factor of the confidence set, which is used to measure the importance of the set.

[0046] After constructing and selecting features for association rules, a random forest classifier is used with maximum accuracy as the objective function, and hyperparameters are optimized through a TPE process. Finally, ordination-preserving regression is used to calibrate the predicted probabilities.

[0047] To gain a comprehensive understanding of the performance improvement of binary classification tasks on the dataset, the proposed method of this invention is compared with the original method that only performs TPE parameter tuning. Table 6 summarizes the key performance indicators of the two methods.

[0048] Table 6 shows the performance comparison before and after applying the proposed method on the dataset. As shown in Table 6, the proposed method significantly outperforms the original method in generalization on the dataset. Specifically, the proposed method improves precision, recall, and F1 score by more than 5% in the category of "no risk of heart disease" and by more than 3% in the category of "risk of heart disease".

[0049] By constructing association rules for the risk categories of heart disease (both healthy and disease-prone), the random forest classifier achieves a more balanced approach in handling these two risk classes. Specifically, the proposed method improves the accuracy and ROC / AUC on the dataset by 4.95% and 2.81%, respectively, demonstrating a significant improvement in the classifier's detection performance. To further analyze the generalization ability of the proposed method, the ROC curves and confusion matrices of the original and proposed methods on the UCI dataset are shown below. Figure 3 and Figure 4 As shown.

[0050] In the original method, the ROC curve exhibits significant fluctuations and lacks smoothness, indicating unstable predictive performance. In contrast, the proposed method significantly improves the predictive performance of the random forest classifier, resulting in a smoother curve with a larger area. This improvement highlights the enhanced early warning capability of the proposed method when facing the problem of heart disease risk identification. Furthermore, to further verify whether the classifier has the ability to distinguish between these two types of samples in heart disease risk assessment, Figure 5 and Figure 6 Confusion matrices for both the original method and the proposed method on the dataset are presented. The results show the confusion matrix based on whether heart disease is classified as a risk category. The confusion matrix is ​​color-normalized to ensure consistent color intensity for both categories, allowing for a fair and intuitive representation of the importance of each category. The proposed method adds 5 correct prediction instances in the "no heart disease risk" category and 10 correct prediction instances in the "heart disease risk" category. In summary, the proposed method demonstrates significant superiority on the dataset.

[0051] This invention presents the overall results of an ablation experiment using random forest as a heart disease risk warning model on a dataset. The experiment was divided into 7 groups: the original method, constructing only association rule features, filtering original features without filtering association rule features, filtering both original features and association rule features, filtering association rule features without filtering original features, filtering both and then post-processing, and the proposed method.

[0052] As shown in Table 7, the better classification performance after constructing association rule features is due to the consideration of the interactions between the original features during feature construction. Admittedly, not further filtering the original features yields better results than further filtering, possibly because the dataset has a smaller number of features, and selecting the original features would result in a loss of dataset information. Ultimately, combining association rule feature construction, SuSIE feature filtering only on association rule features, and ordinal-preserving regression post-processing yielded the best predictive performance for heart disease risk, validating the effectiveness of the proposed method.

[0053] Table 7 shows the ablation analysis results on the dataset. This invention evaluates the performance of different machine learning models under both the original and proposed methods. Table 8 shows the performance of various mainstream classifiers on the dataset, evaluated using different classification metrics. Experimental results on the dataset demonstrate that, compared to the original method, the proposed method improves the performance of almost all mainstream classifiers, and the random forest outperforms other mainstream models under both methods.

[0054] Table 8 compares and analyzes the mainstream classifiers of the original method and the proposed method on the dataset. It is worth noting that although logistic regression performed best among the original methods, the performance improvement of the three classification models, logistic regression, K-nearest neighbors, and multilayer perceptron, after applying this method was significantly lower than that of decision tree, support vector machine, and random forest. This difference may be due to their limitations in capturing nonlinear features, and the increase in the amount of data may make it more difficult for the model to extract useful information.

[0055] This invention comprehensively evaluates the performance of various feature selection methods. Table 9 shows the classification performance of these methods as random forest classifiers on the dataset. Experimental results on the dataset show that, except for a slight decrease in accuracy from the relevance filtering method, all other methods improve the model's performance.

[0056] The poor performance of relevance filtering stems from its inability to accurately identify the best feature when faced with a large number of highly correlated association rule features. Elastic networks and random forests show significant enhancement effects; in our experiments, we set a regularization factor of 0.5 and a threshold of 0.02, respectively, to filter redundant features. In contrast, SuSIE, due to its trusted set, makes more accurate judgments in the small-sample association rule feature selection task, making it possible to consider how to accurately select among highly correlated features during the feature selection process.

[0057] Table 9 Comparative Analysis of SuSIE Feature Selection Method with Other Feature Selection Techniques Feature contribution analysis: To evaluate and validate the analysis results from the perspective of feature contribution, a SHAP summary diagram and a SHAP beehive diagram were constructed based on a random forest-based SHAP model. The absolute impact of a feature on the risk of heart disease is represented by its average absolute SHAP value across all instances, such as... Figure 7 As shown; Figure 8 As shown, the SHAP beehive diagram illustrates the distribution of SHAP values ​​and their positive and negative effects across all instances of each feature.

[0058] By comparing the SHAP value distributions of the 10 most influential features in a random forest model, we can determine the differences in the contributions of these features to the random forest model's identification of heart disease risk.

[0059] Figure 7 The average absolute SHAP value for each feature across all instances is displayed, representing the average impact of each feature on the estimated risk of heart disease. Figure 8 The SHAP value for each risk factor at each data point is displayed, revealing the directional impact of each feature value on the model output.

[0060] Taking the association rule feature rule_1 as an example, it represents a scenario where Oldpeak is in the range of -0.84 to 0.92 and ST_Slope slopes upward. The number of samples satisfying this association rule is relatively small, but it shows a significant positive contribution to the risk of heart disease. However, in the instances that meet the condition, the negative impact is more widely distributed, which may be due to dependence on other feature values.

[0061] Taking cholesterol as an example, most cases were in the range of 173-223 mg / dl, which had only a moderate negative impact on heart disease risk. However, both raising and lowering cholesterol levels had a positive effect on risk. Notably, in some cases, when cholesterol levels were below 100 mg / dl, the SHAP value of this characteristic with heart disease risk exceeded 0.3. This suggests that low serum cholesterol and underlying malnutrition or liver disease are strongly associated with heart disease risk.

[0062] Interaction effect analysis: Depend on Figure 7 , 8 It is known that ST_Slope, Cholesterol, Oldpeak, and MaxHR are the four risk factors for heart disease with the highest importance. Therefore, this invention performs an interaction dependency analysis on them.

[0063] The interactive effects of these four characteristics on heart disease risk are as follows: Figure 9-12 The dependency graph is shown below. For each feature, the color of the scatter point depends on the other three features, thus reflecting the influence of these three features on the current feature's SHAP value. A positive SHAP value has a positive impact on heart disease risk, while a negative SHAP value has a negative impact on heart disease risk.

[0064] Figure 9 In the graph, A1, A2, and A3 are the SHAP dependency graphs of ST_Slope, colored according to Cholesterol, Oldpeak, and MaxHR, respectively, to show the influence of Cholesterol, Oldpeak, and MaxHR on the SHAP value of ST_Slope. The SHAP value is negative when ST_Slope is upward sloping, and positive when it is flat or downward sloping. Figure 9 As shown in A1, the risk of heart disease is lowest when the ST-slope slopes upward and serum cholesterol levels are between 150 and 300 mg / dL. Conversely, the risk is highest when the ST-slope is flat and serum cholesterol levels are between 250 and 300 mg / dL. Furthermore, when the ST-slope slopes downward, the Oldpeak distribution is wider, indicating a higher risk of heart disease.

[0065] Figure 10 In the figure, B1, B2, and B3 are SHAP-dependent plots of cholesterol, colored according to ST_Slope, Oldpeak, and MaxHR, respectively, to show the effects of ST_Slope, Oldpeak, and MaxHR on the SHAP value of cholesterol. When cholesterol levels are in the range of 150-300 mg / dL, the risk of heart disease increases with increasing cholesterol levels, and a positive effect begins to appear at 200 mg / dL. Figure 10 As shown in B1, when the risk of heart disease is negative, ST_Slope mostly shows an upward trend, while when the risk of heart disease is positive, ST_Slope begins to show a downward trend and gradually transitions to a flat state. This process is accompanied by an increase in Cholesterol levels.

[0066] Figure 11 In the graph, C1, C2, and C3 are the SHAP dependency graphs of Oldpeak, colored according to ST_Slope, Cholesterol, and MaxHR respectively to show the impact of ST_Slope, Cholesterol, and MaxHR on the SHAP value of Oldpeak. When Oldpeak is between 0 and 2, it generally reflects a negative impact. Figure 11 As shown in C1, as Oldpeak increases, ST_Slope gradually transitions from an upward slope to a downward slope and then to a flat slope; as shown in subplot C3, when Oldpeak is low, MaxHR is high, while as Oldpeak increases, MaxHR decreases.

[0067] Figure 12 In the diagram, D1, D2, and D3 are SHAP dependency plots of MaxHR, colored according to ST_Slope, Cholesterol, and Oldpeak, respectively, to show the effects of ST_Slope, Cholesterol, and Oldpeak on the SHAP value of MaxHR. With increasing maximum heart rate, the risk of heart disease significantly decreases. It is worth noting that... Figure 12 As shown in D1, when MaxHR is less than 125, ST_Slope is generally flat. As MaxHR increases, more ST_Slopes gradually slope upward. As shown in subplot D3, as MaxHR increases, Oldpeak is in the range of 0 to 1.771.

[0068] in conclusion: This invention performs association rule mining on both no-heart disease risk and heart disease risk, effectively overcoming the limitation of limited feature quantity in small datasets. Then, SuSIE is used to filter association rule features, and a credibility set is used to consider the mutual influence between features, improving traditional feature selection methods. Experimental results show that this method can effectively select meaningful association rule features. Rank-preserving regression is used for post-processing of the random forest model, significantly calibrating classification probabilities to produce more reliable results. The interpretability of the model is enhanced by calculating the SHAP value for each feature and instance. Beehive graphs are used to visualize the contribution of each feature to the classification process, while dependency graphs are used to illustrate the interaction between any two features and their impact on the model results. The effectiveness of the method is validated using a heart disease risk dataset, and ablation studies and comparative experiments further demonstrate the robustness and adaptability of the model in heart disease risk identification.

[0069] While the model successfully identified heart disease risk on the dataset, a key challenge remains: correctly identifying instances near the heart disease risk boundary. Classifiers can still misclassify when feature values ​​are similar, highlighting the need for more precise association rule mining. To further improve the accuracy of heart disease risk warning models, future work will focus on designing an improved association rule mining algorithm capable of uncovering potential and marginal associations in small heart disease datasets. Simultaneously, the antecedent form of association rules will be improved to an interval form, moving beyond the traditional equals sign form. This will allow for more accurate extraction and selection of association rules, leading to the development of heart disease risk warning models with enhanced risk identification capabilities.

[0070] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting heart disease risk based on relational interactions, characterized in that, include: Step S1: Obtain the publicly available heart disease dataset from Kaggle and preprocess it; Step S2 involves performing association rule feature mining and feature selection for the two categories of heart disease risk. Step S3: Use a Bayesian optimized random forest classifier based on the TPE process for risk warning, and use order-preserving regression to further calibrate the prediction results. Step S4: Analyze the contribution of key influencing factors and their interaction with heart disease risk using the SHAP model; In step S2, the two categories are: those with heart disease risk and those without heart disease risk. Association rule feature mining and feature selection are performed on each category, including: The Aprior algorithm was used to mine association rules, and binary variables were constructed as association rule features. Next, the SuSIE model was used to filter the features of the association rules; In step S2, the SuSIE model is based on the SER model. Let's assume the SuSIE model is a multiple regression model. If only one of the explanatory variables has a non-zero regression coefficient, i.e., the effect variable, then in the SER model, assuming the residual variance... Prior variance of effect variables and prior inclusion probability The SER model is defined by the following formula: ; ; ; ; ; In the formula, yes dimensional target variable, express Sample A matrix of exogenous variables in 1 dimension The coefficients representing the effect variables, express The indicator variable of dimension, used to indicate the first dimension. Are the variables effect variables? express A vector of regression coefficients in dimensional form. Represents the error vector. Indicates the class probability as The multinomial distribution; level A credible set is defined as one containing at least one effect variable with a probability of at least 1. A subset of variables, using posterior inclusion probability in Bayesian regression variable selection. Let the probability of each variable being selected in the trust set be expressed as follows: ; In a given and Then, the posterior included probability vector is derived from single-effect regression. ,in The calculation method is as follows: ; Based on the aforementioned SER model and the principle of trust sets, multiple single effect vectors are introduced. and the overall effect vector Constructed as the sum of these individual effects, i.e., SuSIE: ; ; ; ; ; ; In the formula, To select feature parameters, For the first The coefficients of each effect variable; In step S4, the SHAP model is passed through Will Mapped to This creates a simplified input method; based on Original model The following is an approximation of a linear function with two variables: ; In the formula, , It is the number of input features. , The contribution value of a feature is calculated as follows: ; ; In the formula, yes The non-zero set of inputs, yes Exclude the A subset of features As a weighting factor, For subset The number of features, its logic is: used to calculate "from Select from features The first feature, and excluding the second feature. The combination probability of "features" It is a unified measure of additive feature attributes, namely the SHAP value. This represents the output probability of the prediction model.

2. The method for interpretable cardiac risk early warning based on correlation interaction according to claim 1, characterized in that, In step S1, the publicly available heart disease datasets from Kaggle include five public sub-datasets: Cleveland, Hungarian, Switzerland, Long Beach VA, and Stalog. In step S1, the continuous features of the heart disease dataset are preprocessed by equal-width binning.

3. The method for interpretable heart disease risk early warning based on correlation interaction according to claim 1, characterized in that, In step S2, association rule mining is an unsupervised learning algorithm in machine learning, and an association rule is defined by the following formula: ; In the formula, Indicates the preceding term of the association rule. Indicates the term following the association rule. Represents itemsets; The goal of association rule mining is to find the preceding terms Given the existence of itemsets, it is possible to predict subsequent items while satisfying a certain strength threshold. The rules governing the occurrence of middle itemsets; In association rule mining, support, confidence, and lift are three metrics commonly used to evaluate the strength and relevance of these rules. Support is defined as the sum of the preceding terms in the dataset. and the following item The proportion is expressed by the following formula: ; In the formula, Indicates that it includes the preceding term. and the following item Quantity, This indicates the total number of itemsets in the dataset; Confidence level is defined as the preceding term. Given that it exists, the latter term The proportion of occurrence is expressed by the following formula: ; Lift is defined as the subsequent term. The appearance of the preceding term The degree of improvement is expressed by the following formula: ; If the lift is greater than 1, it indicates that the preceding term... and the following item Positive correlation; a value less than 1 indicates the preceding term. and the following item Negative correlation.

4. The method for interpretable heart disease risk early warning based on correlation interaction according to claim 1, characterized in that, In step S3, the core idea of ​​random forest is to use a set of decision trees to train and predict the input data; the results of all trees are aggregated to make the final prediction, and each decision tree... These are all bootstrap samples extracted from the original dataset. The training is performed on the tree, and at each node, a subset of features is randomly selected to partition the data, thereby introducing variability between the trees; For a given input The prediction is obtained by aggregating the predictions of all decision trees in the forest. For classification tasks, the final prediction result is determined by majority vote, expressed as follows: ; In the formula, Indicates input The Prediction of decision trees It is the total number of trees in the forest, and the predicted category in the majority vote. It is the category that received the most votes across all trees.

5. The method for interpretable heart disease risk early warning based on correlation interaction according to claim 4, characterized in that, In step S3, the Bayesian optimization algorithm based on the TPE process performs hyperparameter optimization on the random forest classifier, including: Each hyperparameter is set to follow a Gaussian distribution with a mean of 0, and then samples are taken from that distribution; Random sampling Group hyperparameters And calculate the true loss of the model when these hyperparameters are applied. ; Set the TPE process to surrogate function fitting ,right The following divisions are made: ; ; Based on this division, we get: ; for Choose and set hyperparameters to indicate The quantiles, i.e. Therefore, the above formula can be simplified as follows: ; The EI function is selected as the acquisition function to evaluate the acquisition points. The EI function represents the average improvement relative to a given threshold. For the collection point set Each collection point calculate And select the optimal one from the collection points. Substitute into the model to calculate the actual loss The formula for the EI function is as follows: ; The value of the EI function is inversely proportional to its denominator, and the size of the denominator depends on the proportion. Select ratio The largest point is taken as the optimal sampling point; Will Add to collection Form a new Repeat the above steps until the maximum number of iterations is reached, thus completing the hyperparameter optimization of the random forest classifier.

6. The method for interpretable cardiac risk early warning based on correlation interaction according to claim 5, characterized in that, In step S3, ordinal-preserving regression is a technique that fits a free-form line to a series of observations, so that the fitted line is monotonic at any position and is as close as possible to the observations. The established order-preserving regression model is solved using the PAV algorithm. This method has only one constraint, namely that the function space is a space of monotonically increasing functions. The main steps are as follows: Assuming each observed variable Follows a normal distribution , and when Timely satisfaction ; Using the previous step as a monotonic constraint, identify points that violate this constraint and form a monotonic sequence with their neighbors. Assume that points within this range follow the same distribution. At that time, the order was in Points within the range satisfy a normal distribution. ; If the newly constructed distribution violates the monotonicity constraint in subsequent comparisons, such as when... The situation makes it possible to... Points within the range will satisfy ; Repeat the above steps until the distribution stabilizes and no longer violates the monotonicity constraint, and then further calibrate the prediction results.

Citation Information

Patent Citations

  • Heart disease prediction method based on dual feature selection and XGBoost algorithm

    CN111243751A

  • Deep learning-based diagnosis and referral of diseases and disorders using natural language processing

    CN113015977A