A method and system for processing cardiovascular case data

Through technical means such as random forest model and LSTM network, cardiovascular case data are preprocessed and characterized to determine key factors, solving the problem that traditional methods are difficult to accurately handle cardiovascular disease risks, and achieving more efficient and personalized cardiovascular disease diagnosis and treatment. disease risk prediction.

CN118471540BActive Publication Date: 2024-10-15THE FIRST AFFILIATED HOSPITAL OF MEDICAL COLLEGE OF XIAN JIAOTONG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410925105.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-10-15
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

Traditional data analysis methods are difficult to fully tap the potential information in cardiovascular case data, resulting in inaccurate processing of cardiovascular disease risks.

Method used

Random forest model, LSTM network, factor decomposition machine, gradient boosting decision tree and other technical means are used to preprocess and feature sort the hypertension electronic medical record data, determine the key factors affecting the risk of cardiovascular disease, and use feature interaction and integration models Improve forecast accuracy.

Benefits of technology

It improves the efficiency and accuracy of identifying cardiovascular disease risks, can flexibly adapt to changes in different patients and time points, captures long-term dependencies in time series data, enhances feature correlation, and improves the personalization and accuracy of processing. sex.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118471540B_ABST
    Figure CN118471540B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for processing cardiovascular case data, which relates to the technical field of data processing. The method comprises: determining key factors affecting cardiovascular disease risk according to a feature ranking table and a dynamic factor; using a causal stability and time-aware long short-term memory network to learn disease risk information in a patient's long-term metabolic characteristics according to the key factors to construct a processing model; performing feature interaction between individual characteristics and disease risk information learned by a causal stability and time-aware long short-term memory network according to the processing model to obtain a feature interaction result; and using a fully connected network to perform final disease risk processing on the processing model according to the feature interaction result, and outputting the processing result. The present invention can make full use of multidimensional information in electronic medical record data, and improve work efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data processing, and in particular to a method and system for processing cardiovascular case data. Background Art

[0002] With the rapid development of modern medical technology, the prevention, treatment and research of cardiovascular diseases have become an important global issue. Cardiovascular disease, especially hypertension, is one of the major diseases affecting human health, and its morbidity and mortality rates are high worldwide. In order to better prevent, diagnose and treat cardiovascular diseases, a large amount of electronic medical record data is collected and used for related research.

[0003] However, cardiovascular case data usually contain a large amount of characteristic information, such as the patient's physiological indicators, living habits, family medical history, etc. There may be complex nonlinear relationships between these characteristics, and the impact of some characteristics on disease risk may change over time. Traditional data analysis methods often find it difficult to fully tap the potential information in these data, resulting in inaccurate treatment of cardiovascular disease risks. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method and system for processing cardiovascular case data, which can make full use of the multi-dimensional information in the electronic medical record data and improve work efficiency and accuracy.

[0005] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0006] In a first aspect, a method for processing cardiovascular case data comprises:

[0007] Preprocessing the hypertension electronic medical record dataset to obtain preprocessed data;

[0008] Using the preprocessed data to build a random forest model, and training the random forest model to obtain a trained random forest model;

[0009] Calculate the importance score of each feature through the trained random forest model;

[0010] According to the importance score of each feature, the features are sorted to obtain a feature ranking table;

[0011] Determine the key factors affecting cardiovascular disease risk based on the feature ranking table and dynamic factors;

[0012] According to the key factors, a hidden state sequence is determined through the LSTM network, and the hidden state sequence contains information related to the disease risk; according to the hidden state sequence, a weight is assigned to each hidden state;

[0013] The factor decomposition machine is used to perform second-order feature interaction on the original features of the individual to obtain the interaction result; the interaction result is fused with the hidden state sequence to obtain the feature interaction result;

[0014] The feature interaction results are input into a fully connected network for feature abstraction and combination to obtain the fully connected network output data; for the gradient boosting decision tree model, a series of decision trees are trained. After the training is completed, the output data of the gradient boosting decision tree model is the weighted sum of the prediction results of all decision trees; the output data of the fully connected network and the gradient boosting decision tree are integrated to obtain integrated data, and the final disease risk treatment result is obtained based on the integrated data.

[0015] Furthermore, the hypertension electronic medical record dataset is preprocessed to obtain preprocessed data, including:

[0016] Random Selection k Initial cluster centers are selected and iterated until the clustering results are stable. The update formula is:

[0017] ;

[0018] in, is the cluster label, It is i data points, is the total number of data points in the dataset, is the index, It is a data point To cluster center The square of the Euclidean distance, is a constant;

[0019] For each cluster, calculate the covariance matrix between features. C ,in,

[0020] in, It is i The weight of the data point, represents the transpose of a matrix, Indicates j The weight of each data point; It is j data points; j is the index;

[0021] Covariance matrix C Perform eigendecomposition to obtain the covariance matrix C The eigenvalues ​​and corresponding eigenvectors of

[0022] Sort eigenvectors by eigenvalue;

[0023] The preprocessed data is obtained by multiplying the original data matrix with the selected principal component matrix.

[0024] Further, a random forest model is constructed using the preprocessed data, and the random forest model is trained to obtain a trained random forest model, including:

[0025] Determine the number of decision trees, the final depth of each decision tree, and the number of samples required for leaf nodes;

[0026] Use the bootstrap sampling method to extract samples from the original training data set to generate a new training subset, and build a decision tree on the new training subset;

[0027] At each node of the decision tree, the importance of each feature is processed and the final feature is determined for node division;

[0028] The decision tree continues to grow until a predetermined stopping condition is reached. During the growth process, each node is divided according to the selected features and recursively generates child nodes;

[0029] Repeat the operation, each time using a different bootstrapped subset to build a decision tree, until the specified number of decision trees are generated;

[0030] Integrate all the constructed decision trees together to form a random forest model;

[0031] The random forest model is trained to obtain a trained random forest model.

[0032] Furthermore, the importance score of each feature is calculated through the trained random forest model, including:

[0033] Get the feature importance properties of the trained random forest model;

[0034] Based on the feature importance attributes, calculate the feature importance score.

[0035] Furthermore, the features are sorted according to the importance score of each feature to obtain a feature sorting table, including:

[0036] According to the importance scores of the features, the features are preliminarily sorted using the quick sort method to obtain a preliminary sorted list;

[0037] According to the preliminary sorting list, the correlation between the features is analyzed, and the preliminary sorting list is adjusted according to the correlation to obtain an optimized sorting result, including: for each pair of features in the preliminary sorting list ( , ),in, and Respectively represent h and m features, calculate and The correlation coefficient between them is calculated as follows:

[0038] ;

[0039] in, It is The weight of the samples; and They are h and m The standard deviation of the feature, , Representation sample The frequency of occurrence in the data set, , Indicates The sample in h The value of the feature, , represents the number of samples; a correlation value is constructed using the correlation coefficient ,in, , is the smoothing factor of EWMA, is the time; according to the correlation value , construct a correlation matrix R ; Traverse the features in the preliminary sorted list, for each feature F h , find the feature set with high correlation H h ; According to the greedy strategy, for each feature F h , and combine it with the feature set H h The features in are exchanged to obtain the optimized sorting result;

[0040] Generate a feature sorting table based on the optimized sorting results.

[0041] Furthermore, based on the characteristic ranking table and dynamic factors, the key factors affecting the risk of cardiovascular disease are determined, including:

[0042] According to the importance score of the feature and the value of the dynamic factor, the comprehensive score of each feature is calculated, where the calculation formula of the comprehensive score is:

[0043] ;

[0044] in, It is The comprehensive score of the features, represents the number of features, It is The weight of static features It is The feature in The standardized value on samples, is the dynamic factor, ( ) is in The weight at each time point, It is in At a point in time The observed value of a feature, is the time window size of the moving average, It's time. is the index;

[0045] Based on the comprehensive score, the key factors affecting the risk of cardiovascular disease are determined.

[0046] Furthermore, according to the comprehensive score, the key factors affecting the risk of cardiovascular disease are determined, including:

[0047] All characteristics are ranked according to the comprehensive score;

[0048] According to the preset threshold, features with a comprehensive score ≥ the threshold are selected from the sorted feature list, and features with a comprehensive score ≥ the threshold are identified as key factors affecting the risk of cardiovascular disease.

[0049] In a second aspect, a method for processing cardiovascular case data includes:

[0050] An acquisition module is used to preprocess the hypertension electronic medical record data set to obtain preprocessed data; use the preprocessed data to build a random forest model, train the random forest model to obtain a trained random forest model; calculate the importance score of each feature through the trained random forest model; sort the features according to the importance score of each feature to obtain a feature sorting table;

[0051] The processing module is used to determine the key factors affecting the risk of cardiovascular disease based on the feature ranking table and dynamic factors; based on the key factors, a hidden state sequence is determined through the LSTM network, and the hidden state sequence contains information related to the disease risk; according to the hidden state sequence, a weight is assigned to each hidden state; the factor decomposition machine is used to perform second-order feature interaction on the original features of the individual to obtain the interaction result; the interaction result is fused with the hidden state sequence to obtain the feature interaction result; the feature interaction result is input into a fully connected network for feature abstraction and combination to obtain the fully connected network output data; for the gradient boosting decision tree model, a series of decision trees are trained, and after the training is completed, the output data of the gradient boosting decision tree model is the weighted sum of the prediction results of all decision trees; the output data of the fully connected network and the gradient boosting decision tree are integrated to obtain the integrated data, and the final disease risk processing result is obtained based on the integrated data.

[0052] According to a third aspect, a computing device includes:

[0053] one or more processors;

[0054] The storage device is used to store one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method described.

[0055] In a fourth aspect, a computer-readable storage medium stores a program, and when the program is executed by a processor, the method described is implemented.

[0056] The above scheme of the present invention includes at least the following beneficial effects.

[0057] By preprocessing the hypertension electronic medical record data set, the present invention can clean and normalize the original data, remove noise and redundant information, and thus obtain high-quality preprocessed data.

[0058] Using the random forest model, the present invention can calculate the importance score of each feature and sort the features according to these scores, which enables medical workers to quickly identify the key factors that have the greatest impact on cardiovascular disease risk, thereby improving work efficiency and accuracy.

[0059] When determining key factors, the present invention not only considers the importance score of the features, but also introduces dynamic factors, so that the model can more flexibly adapt to changes in different patients and time points, thereby improving the personalization of treatment.

[0060] By adopting the causal stability and time-aware long short-term memory network (LSTM), the present invention can effectively learn the disease risk information in the long-term metabolic characteristics of patients. The introduction of LSTM enables the model to capture the long-term dependencies in time series data, thereby more accurately predicting the risk of cardiovascular disease.

[0061] The present invention performs feature interaction between individual features and disease risk information learned by LSTM. This step enhances the correlation between features, enables the processing model to more comprehensively consider the influence of various factors, and improves the accuracy of processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] Figure 1 It is a flowchart of a method for processing cardiovascular case data provided by an embodiment of the present invention.

[0063] Figure 2 It is a schematic diagram of a cardiovascular case data processing system provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0064] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0065] like Figure 1 As shown, an embodiment of the present invention provides a method for processing cardiovascular case data, the method comprising the following steps:

[0066] Step 11, preprocessing the hypertension electronic medical record data set to obtain preprocessed data;

[0067] Step 12, using the preprocessed data to build a random forest model, and training the random forest model to obtain a trained random forest model;

[0068] Step 13, calculate the importance score of each feature through the trained random forest model;

[0069] Step 14, sorting the features according to the importance score of each feature to obtain a feature sorting table;

[0070] Step 15, determining the key factors affecting cardiovascular disease risk based on the feature ranking table and dynamic factors;

[0071] Step 16, according to the key factors, determine a hidden state sequence through the LSTM network, the hidden state sequence contains information related to the disease risk; according to the hidden state sequence, assign a weight to each hidden state;

[0072] Step 17, using a factorization machine to perform second-order feature interaction on the original features of the individual to obtain an interaction result; fusing the interaction result with the hidden state sequence to obtain a feature interaction result;

[0073] Step 18, input the feature interaction results into a fully connected network for feature abstraction and combination to obtain the fully connected network output data; for the gradient boosting decision tree model, train a series of decision trees. After the training is completed, the output data of the gradient boosting decision tree model is the weighted sum of the prediction results of all decision trees; integrate the output data of the fully connected network and the gradient boosting decision tree to obtain integrated data, and obtain the final disease risk treatment result based on the integrated data.

[0074] In an embodiment of the present invention, by preprocessing the hypertension electronic medical record data set, the present invention can clean and normalize the original data, remove noise and redundant information, and thus obtain high-quality preprocessed data. Using the random forest model, the present invention can calculate the importance score of each feature and sort the features according to these scores, which enables medical workers to quickly identify the key factors that have the greatest impact on cardiovascular disease risk, thereby improving work efficiency and accuracy. When determining the key factors, the present invention not only considers the importance score of the feature, but also introduces dynamic factors, so that the model can more flexibly adapt to changes in different patients and time points, thereby improving the degree of personalization of the processing. By adopting the causal stability and time-aware long short-term memory network (LSTM), the present invention can effectively learn the disease risk information in the long-term metabolic characteristics of patients. The introduction of LSTM enables the model to capture the long-term dependencies in the time series data, thereby more accurately predicting the risk of cardiovascular disease. The present invention interacts the individual's features with the disease risk information learned by LSTM. This step enhances the correlation between the features, so that the processing model can more comprehensively consider the influence of various factors, thereby improving the accuracy of the processing.

[0075] In a preferred embodiment of the present invention, the above step 11 may include:

[0076] Step 111, random selection k Initial cluster centers are selected and iterated until the clustering results are stable. The update formula is:

[0077] ;

[0078] in, is the cluster label, It is i data points, is the total number of data points in the dataset, is the index, It is a data point To cluster center The square of the Euclidean distance, is a constant;

[0079] Step 112, for the data in each cluster, calculate the covariance matrix between the features C ,in, ,in, It is i The weight of the data point, represents the transpose of a matrix, Indicates j The weight of each data point; It is j data points; j is the index;

[0080] Step 113, the covariance matrix C Perform eigendecomposition to obtain the covariance matrix C The eigenvalues ​​and corresponding eigenvectors of

[0081] Step 114, sorting the eigenvectors according to the size of the eigenvalues;

[0082] Step 115, obtaining preprocessed data by multiplying the original data matrix with the selected principal component matrix.

[0083] In an embodiment of the present invention, by using clustering algorithms and principal component analysis, the original hypertension electronic medical record data set can be effectively reduced in dimension, redundant information and noise can be removed, and the core features in the data can be extracted, which not only reduces the computational complexity of the subsequent model, but also helps to improve the accuracy of risk management. The cluster center update formula used in step 111 can more accurately locate the center of each cluster, ensure the stability and reliability of the clustering results, and help to more accurately identify the commonalities and differences of different patient groups in subsequent analysis. By calculating the covariance matrix (step 112), the correlation between different features can be quantified, and then possible multicollinearity or redundant features can be identified. The process of feature decomposition (step 113) and sorting feature vectors by eigenvalue size (step 114) helps to extract the principal components in the data, that is, those features that contribute the most to the variation, ensuring that the preprocessed data can retain the effective information in the original data to the greatest extent. By multiplying the principal component matrix with the original data matrix (step 115), the obtained preprocessed data not only has a lower dimension, but also removes the noise and redundant information in the original data, which helps to improve the generalization ability of the processing model constructed subsequently, so that it can maintain stable performance when facing new data.

[0084] In a preferred embodiment of the present invention, the above step 12 may include:

[0085] Step 121, determining the number of decision trees, the final depth of each decision tree, and the number of samples required for leaf nodes;

[0086] Step 122, using a bootstrap sampling method to extract samples from the original training data set, generate a new training subset, and build a decision tree on the new training subset, specifically including: the number of samples extracted from the original training data set, randomly selecting a sample from the original training data set (here, randomly selecting a row of data and its corresponding features and target values), and copying it to the new training subset; determining decision tree parameters, such as the final depth of the decision tree, the minimum number of samples required for leaf nodes, the minimum impurity reduction required for node splitting, etc.; using the new training subset to create a root node, and assigning the entire training subset to the node; starting from the root node, recursively applying the following steps until the stopping condition is met (such as reaching the final depth, the leaf node contains enough samples, etc.); selecting an optimal feature for splitting, dividing the training subset of the current node into two or more subsets according to the selected feature, creating a new child node for each subset, and assigning the corresponding subset to the child node; marking the current node as an internal node, and setting a branching condition according to the value of the split feature;

[0087] Step 123, at each node of the decision tree, the importance of each feature is processed, and the final feature is determined for node partitioning, specifically including: for the selected feature subset, calculating the processing index value of each feature at the current node; according to the calculated processing index value, selecting the feature with the best processing index (such as the maximum information gain and the maximum reduction in Gini impurity) as the partitioning feature of the current node; for the selected partitioning feature, determining the partitioning threshold; after selecting the partitioning feature, updating the value of the feature in the global feature importance list; recording the selected partitioning feature and the corresponding partitioning rule in the current node;

[0088] Step 124, the decision tree continues to grow until a predetermined stop condition is reached. During the growth process, each node is divided according to the selected features and recursively generates child nodes;

[0089] Step 125, repeating the operation, each time using a different self-sampling subset to build a decision tree, until a specified number of decision trees are generated;

[0090] Step 126, integrating all the constructed decision trees together to form a random forest model;

[0091] Step 127, training the random forest model to obtain a trained random forest model.

[0092] In an embodiment of the present invention, samples are extracted from the original data set by a self-service sampling method (step 122) to generate multiple different training subsets. The decision trees constructed on each subset are different. This diversity enables the random forest model to average the deviation and variance of a single decision tree when integrated, thereby improving the overall generalization ability. Since each decision tree is constructed on a different training subset, and the importance of the feature is considered for each node (step 123), the random forest model can effectively avoid overfitting of a specific data set during the training process, which helps to ensure that the model can still maintain good performance when facing unknown data. In the construction process of each decision tree, the importance of each feature is processed and the nodes are divided accordingly (step 123). This division strategy based on feature importance can ensure that the model pays more attention to those features that have a significant impact on the target variable, thereby improving the accuracy of feature selection and the interpretability of the model.

[0093] By setting parameters such as the final depth of each decision tree and the number of samples required for leaf nodes (step 121), the complexity of each decision tree in the random forest model can be effectively controlled, which helps to strike a balance between model complexity and computational efficiency, ensuring that the model can still achieve good performance under limited computing resources. Since each decision tree in the random forest model is independently constructed, it can be easily parallelized (step 125), which can significantly improve the efficiency of model construction and training, especially when processing large-scale data sets. By integrating multiple independent decision trees to form a random forest model (step 126), the learning ability of each decision tree can be fully utilized and effective information fusion can be performed. This integrated learning strategy can significantly improve the overall performance and stability of the model.

[0094] In a preferred embodiment of the present invention, the above step 13 may include:

[0095] Step 131, obtaining the feature importance attributes of the trained random forest model, specifically including: accessing the corresponding attributes of the trained random forest model, which attributes contain information about the feature importance; extracting feature importance data from the attributes, which data is provided in the form of an array, a list, or a dictionary, where each element corresponds to an importance value of a feature;

[0096] Step 132, based on the feature importance attribute, calculate the feature importance score, specifically including, in order to compare the relative importance of different features, normalize the feature importance values, normalization can convert these values ​​to the same scale, for example, scale them to a range of 0 to 1, where 0 represents the least important and 1 represents the most important; assign different weights to the features according to their stability, reliability or business relevance, and calculate the weighted feature importance score; based on the calculated feature importance score, the features can be sorted so as to quickly identify the most important features.

[0097] In an embodiment of the present invention, by obtaining the feature importance attributes of the trained random forest model (step 131), it is possible to intuitively understand which features play a key role in the model prediction. This helps to screen out the features that have the greatest impact on cardiovascular disease risk, improve the interpretability of the model, and make it easier for doctors and patients to understand the processing results. The calculation of the feature importance score (step 132) is based on the feature selection mechanism within the model, which means that features with higher scores have stronger discrimination ability in distinguishing patients with different risk levels. Therefore, sorting and selecting features according to these scores helps to improve the accuracy of the processing of the final cardiovascular case data. The feature importance score can not only be used for the current risk processing model, but also provide guidance for subsequent in-depth analysis. For example, the biological or clinical connection between features with higher scores and cardiovascular disease risk can be further explored to provide more basis for the formulation of disease prevention and treatment strategies.

[0098] In a preferred embodiment of the present invention, the above step 14 may include:

[0099] Step 141, based on the importance scores of the features, use the quick sort method to preliminarily sort the features to obtain a preliminary sorted list, specifically including: sorting the features from high to low (or from low to high) according to their importance scores; selecting a reference value, which can be the first element, the last element, the middle element or a random selection in the list; dividing the list into two sublists: a sublist consisting of elements less than the reference value and a sublist consisting of elements greater than or equal to the reference value; recursively performing quick sorting on the two sublists until the sublists are empty or contain only one element; treating the quick sorted list as input for merge sort, that is, dividing it into several sorted sublists; creating an auxiliary list for merge operation; comparing the first element in the sublist in turn, putting the smaller element into the auxiliary list, and updating the pointer of the sublist; repeating the operation until all elements in the sublists are merged into the auxiliary list; updating the original list with the auxiliary list;

[0100] Step 142, analyzing the correlation between the features according to the preliminary ranking list, and adjusting the preliminary ranking list according to the correlation to obtain an optimized ranking result;

[0101] Step 143, generating a feature ranking table according to the optimized ranking results.

[0102] In an embodiment of the present invention, the features are preliminarily sorted by the quick sorting method (step 141), which can quickly identify the features that have a greater impact on the risk of cardiovascular disease, which helps to pay more attention to these key features in subsequent analysis and improve the efficiency and accuracy of feature selection. On the basis of the preliminary sorting, the correlation between the features is further analyzed (step 142), and the sorting is adjusted according to the correlation. This helps to avoid redundant features and highly correlated features from being selected into the model at the same time, thereby improving the stability and generalization ability of the model. The generated feature sorting table (step 143) not only provides the importance ranking of the features, but also implies the correlation information between the features. The feature sorting table can serve as an important reference for subsequent model construction. For example, when building a more complex machine learning model, features can be selectively introduced according to the feature sorting table to optimize the performance and interpretability of the model.

[0103] In another preferred embodiment of the present invention, the above step 142 may include:

[0104] Step 1421, for each pair of features in the preliminary sorted list ( , ),in, and Respectively represent h and m features, calculate and The correlation coefficient between them is calculated as follows:

[0105] ;

[0106] in, It is The weight of the samples; and They are h and m The standard deviation of the feature, , Representation sample The frequency of occurrence in the data set, , Indicates The sample in h The value of the feature, , Indicates the sample size.

[0107] Step 1422, construct a correlation value using the correlation coefficient ,in, , is the smoothing factor of EWMA, is the time; according to the correlation value , construct a correlation matrix R ; Traverse the features in the preliminary sorted list, for each feature F h , find the feature set with high correlation H h ; According to the greedy strategy, for each feature F h , consider combining it with the feature set H h The positions of the features in are exchanged to reduce the close arrangement of high-correlation features, thereby increasing feature diversity; an exchange strategy is selected, for example: the feature pairs that reduce the sum of correlations the most after exchange are exchanged. After the above adjustments, the optimized sorting result is obtained.

[0108] In the embodiment of the present invention, by considering the sample weight and the standard deviation of the feature, the correlation coefficient can more accurately reflect the correlation between the features, which helps to more accurately handle the importance of the features in the sorting process, thereby improving the accuracy of the sorting results. Using EWMA to update the correlation matrix enables the sorting method to dynamically adapt to changes in the data. After obtaining the correlation coefficient, a correlation matrix can be constructed. R , where each element ( h , m ) is a feature F h and F m The correlation coefficient between ), so the correlation matrix is ​​a symmetric matrix, and the elements on the diagonal (that is, when h = m ) is always 1. As time goes by, new data points will affect the correlation value, thereby updating the sorting result to make it more consistent with the characteristics of the current data. By exchanging feature positions through a greedy strategy, the close arrangement between highly correlated features can be reduced and feature diversity can be increased. This helps to introduce more information in feature selection or model training and improve the generalization ability and performance of the model. The method provides multiple adjustable parameters, such as sample weights, smoothing factors of EWMA, etc., which can be adjusted according to specific application scenarios and data characteristics. This flexibility enables the method to adapt to different needs and challenges and improve its practicality. The sorting results can be further optimized by selecting an exchange strategy, such as exchanging the feature pairs that reduce the sum of correlations the most after exchange. This helps to reduce the redundancy between features while retaining important features and improve the overall quality of the feature list.

[0109] In a preferred embodiment of the present invention, the above step 15 may include:

[0110] Step 151, calculate the comprehensive score of each feature according to the importance score of the feature and the value of the dynamic factor, wherein the calculation formula of the comprehensive score is:

[0111] ;

[0112] in, It is The comprehensive score of the features, represents the number of features, It is The weight of static features It is The feature in The standardized value on samples, is the dynamic factor, ( ) is in The weight at each time point, It is in At a point in time The observed value of a feature, is the time window size of the moving average, It's time. is the index, , is a smoothing factor between 0 and 1, is the proportionality constant;

[0113] Step 152, determining the key factors affecting the risk of cardiovascular disease based on the comprehensive score.

[0114] In the embodiment of the present invention, through the calculation formula of the comprehensive score, step 15 not only considers the importance score of the static feature (reflecting the importance of the feature in the overall data set), but also introduces the value of the dynamic factor (reflecting the change of the feature in the time series). This enables the processing method to more comprehensively capture the various factors that affect the risk of cardiovascular disease. Dynamic factors The introduction of allows the processing method to flexibly adjust the emphasis on static features and dynamic factors according to actual conditions. When it is larger, the method pays more attention to the changes of features in time series; when the dynamic factor When the value is smaller, the method pays more attention to the importance of the feature in the overall data set. This flexibility helps to adapt to the processing needs of cardiovascular case data in different scenarios. Determining the key factors affecting the risk of cardiovascular disease based on the comprehensive score helps doctors and researchers quickly identify the most important risk factors. This is of great significance for formulating targeted prevention and treatment strategies, and can improve the effectiveness and efficiency of intervention measures. By calculating the comprehensive score of each feature, step 15 provides a quantitative basis for determining the key factors. This makes the processing results more objective and reliable.

[0115] In a preferred embodiment of the present invention, the above step 152 may include:

[0116] Step 1521, sorting all features according to the comprehensive scores;

[0117] Step 1522, according to a preset threshold, select features with a comprehensive score ≥ the threshold from the sorted feature list, and determine the features with a comprehensive score ≥ the threshold as key factors affecting cardiovascular disease risk.

[0118] In an embodiment of the present invention, by sorting the comprehensive scores of all features (step 1521), the importance of each feature in affecting the risk of cardiovascular disease can be intuitively compared. Then, screening is performed in combination with a preset threshold (step 1522), which can ensure that the selected features are not only of high importance overall, but also have a significant impact above a specific threshold. This processing method helps to improve the accuracy of key factor identification. The setting of a preset threshold makes the determination of key factors clearer and simpler. Doctors and researchers do not need to analyze all features one by one, but only need to focus on features with a comprehensive score exceeding the threshold. This helps to reduce decision complexity and improve decision efficiency. The introduction of thresholds provides quantitative standards for key factor screening. This makes the screening process more objective and repeatable, and reduces the deviation caused by subjective judgment. At the same time, the threshold can be adjusted according to actual conditions to meet the needs of processing different cardiovascular case data. The determined key factors can provide important guidance for subsequent cardiovascular disease research and analysis. For example, these key factors can be further explored for their biological or clinical connection with cardiovascular disease risk, providing more basis for the formulation of disease prevention and treatment strategies.

[0119] In another preferred embodiment of the present invention, the above step 16 may include:

[0120] Step 161, taking the patient's long-term metabolic feature sequence as input data of the LSTM network. The LSTM network can capture the long-term dependency in the sequence data, thereby learning the association between the metabolic features and the disease risk. The output data of the LSTM will be a hidden state sequence, which contains information related to the disease risk. According to the hidden state sequence output by the LSTM, a weight is assigned to each hidden state, wherein the weight calculation formula is:

[0121] ,

[0122] in, , is the rectified linear unit activation function; V , W , U and is a parameter, is an additional feature, is the hyperbolic tangent function, represents the length of the sequence, is The hidden state of the moment, and Respectively in Moment and The prediction results of the LSTM model are integrated with those of the auxiliary model to improve the overall prediction performance. The auxiliary model can be a model trained based on different feature subsets. The integrated learning method reduces the bias and variance of a single model by combining the predictions of multiple models, thereby improving the accuracy and robustness of the prediction.

[0123] In another preferred embodiment of the present invention, the above step 17 may include:

[0124] Step 171, using the factorization machine to perform second-order feature interaction on the original features of the individual to obtain the interaction result , where the factorization machine calculates the second-order feature interactions through the following formula:

[0125] ;

[0126] in, and is the parameter of the linear part, and It is a feature and The corresponding latent vector is used to calculate the interaction between features, represents the vector inner product, Indicates the number of features;

[0127] Step 172: Fusing the interaction result with the disease risk information learned through the time-aware long short-term memory network to obtain a feature interaction result. , where the calculation formula for the feature interaction result is:

[0128] ;

[0129] in, is the attention weight of the LSTM output, is a parameter, is the LSTM network at time step Output disease risk information, is the total number of time steps.

[0130] In the embodiment of the present invention, by introducing a factor decomposition machine to perform second-order feature interaction on the original features of individuals, the model can automatically learn the combination relationship between features, which is particularly useful when dealing with features with multicollinearity or when it is necessary to explore the potential relationship between features, and can capture information that traditional linear models may ignore. Fusion with the serialized disease risk information learned by LSTM allows the model to consider both static features and dynamic time series information. This is critical for processing data with time series characteristics (such as changes in biomarkers during disease progression) because it can capture risk patterns that change over time. By fusing information from different sources and types (raw feature interactions and time series risk information), the model obtains a richer and more multi-dimensional feature representation. This helps improve the model's ability to model complex nonlinear relationships, thereby improving prediction accuracy. Introducing interactive results This increases the flexibility of the model because it can handle any real-valued feature vector without explicit preprocessing or feature engineering. The second-order interaction terms provide a certain degree of interpretability for the model, because by examining the weights of the interaction terms, we can understand which feature combinations have an important impact on the prediction results. The attention weights of the LSTM output are used in feature fusion, which means that the model can adaptively focus on the part of the time series information that is most relevant to the prediction results, which not only improves the model's ability to process variable-length sequences, but also enhances the model's sensitivity to information at different time points.

[0131] In another preferred embodiment of the present invention, the above step 18 may include:

[0132] Step 181, according to the feature interaction result, the feature interaction result is input into a fully connected network for high-level feature abstraction and combination to obtain the fully connected network output data, wherein the calculation formula of the fully connected network output data is:

[0133] ;

[0134] ;

[0135] ;

[0136] in, , and is the weight matrix; , and is the bias vector; is the input feature interaction result, is the output data of the fully connected network; is the output data of the first hidden layer; is the output data of the second hidden layer;

[0137] Step 182, passing the feature interaction result as input to a gradient boosting decision tree model, specifically including, for the gradient boosting decision tree model, training a series of decision trees, after the training is completed, the output data of the gradient boosting decision tree model is the weighted sum of the prediction results of all decision trees, wherein the calculation formula of the output data is:

[0138] ;

[0139] in, is the learning rate, is the total number of decision trees, It is The prediction function of a decision tree, It is the final output data of the gradient boosting decision tree model;

[0140] Step 183, integrating the outputs of the fully connected network and the gradient boosting decision tree to obtain integrated data, and obtaining the final disease risk processing result based on the integrated data, wherein the calculation formula of the integrated data is:

[0141] ;

[0142] in, Weight parameters, It is the final integrated data.

[0143] like Figure 2 As shown, an embodiment of the present invention further provides a cardiovascular case data processing system 20, comprising:

[0144] The acquisition module 21 is used to preprocess the hypertension electronic medical record data set to obtain preprocessed data; use the preprocessed data to build a random forest model, train the random forest model to obtain a trained random forest model; calculate the importance score of each feature through the trained random forest model; sort the features according to the importance score of each feature to obtain a feature sorting table;

[0145] The processing module 22 is used to determine the key factors affecting the risk of cardiovascular disease based on the feature ranking table and the dynamic factors; based on the key factors, determine a hidden state sequence through the LSTM network, and the hidden state sequence contains information related to the disease risk; according to the hidden state sequence, assign a weight to each hidden state; use a factor decomposition machine to perform second-order feature interaction on the original features of the individual to obtain an interaction result; fuse the interaction result with the hidden state sequence to obtain a feature interaction result; input the feature interaction result into a fully connected network for feature abstraction and combination to obtain fully connected network output data; for the gradient boosting decision tree model, train a series of decision trees, and after the training is completed, the output data of the gradient boosting decision tree model is the weighted sum of the prediction results of all decision trees; integrate the output data of the fully connected network and the gradient boosting decision tree to obtain integrated data, and obtain the final disease risk processing result based on the integrated data.

[0146] Optionally, the hypertension electronic medical record dataset is preprocessed to obtain preprocessed data, including:

[0147] Random Selection k Initial cluster centers are selected and iterated until the clustering results are stable. The update formula is:

[0148] ;

[0149] in, is the cluster label, It is i data points, is the total number of data points in the dataset, is the index, It is a data point To cluster center The square of the Euclidean distance, is a constant;

[0150] For each cluster, calculate the covariance matrix between features. C ,in,

[0151] ,in, is the weight of the ith data point, represents the transpose of a matrix, represents the weight of the jth data point; is the jth data point; j is the index;

[0152] Covariance matrix C Perform eigendecomposition to obtain the covariance matrix C The eigenvalues ​​and corresponding eigenvectors of

[0153] Sort eigenvectors by eigenvalue;

[0154] The preprocessed data is obtained by multiplying the original data matrix with the selected principal component matrix.

[0155] Optionally, using the preprocessed data to build a random forest model, and training the random forest model to obtain a trained random forest model, including:

[0156] Determine the number of decision trees, the final depth of each decision tree, and the number of samples required for leaf nodes;

[0157] Use the bootstrap sampling method to extract samples from the original training data set to generate a new training subset, and build a decision tree on the new training subset;

[0158] At each node of the decision tree, the importance of each feature is processed and the final feature is determined for node division;

[0159] The decision tree continues to grow until a predetermined stopping condition is reached. During the growth process, each node is divided according to the selected features and recursively generates child nodes. Repeat the operation, using a different self-sampled subset to build a decision tree each time, until a specified number of decision trees are generated.

[0160] Integrate all the constructed decision trees together to form a random forest model;

[0161] The random forest model is trained to obtain a trained random forest model.

[0162] Optionally, calculate the importance score of each feature through the trained random forest model, including:

[0163] Get the feature importance properties of the trained random forest model;

[0164] Based on the feature importance attributes, calculate the feature importance score.

[0165] Optionally, the features are sorted according to the importance score of each feature to obtain a feature sorting table, including:

[0166] According to the importance scores of the features, the features are preliminarily sorted using the quick sorting method to obtain a preliminary sorting list; according to the preliminary sorting list, the correlation between the features is analyzed, and the preliminary sorting list is adjusted according to the correlation to obtain an optimized sorting result, including: for each pair of features in the preliminary sorting list ( , ),in, and Respectively represent h and m features, calculate and The correlation coefficient between them is calculated as follows:

[0167] ;

[0168] in, It is The weight of the samples; and are the standard deviations of the h-th and m-th features, respectively. , Representation sample The frequency of occurrence in the data set, , Indicates The value of the sample on the hth feature, , represents the number of samples; a correlation value is constructed using the correlation coefficient ,in, , is the smoothing factor of EWMA, is the time; according to the correlation value , construct a correlation matrix R; traverse the features in the preliminary sorting list, for each feature F h , find the feature set H with higher correlation h ; According to the greedy strategy, for each feature F h , and combine it with the feature set H h The features in are exchanged to obtain the optimized sorting result;

[0169] Generate a feature sorting table based on the optimized sorting results.

[0170] Optionally, key factors affecting cardiovascular disease risk are identified based on the feature ranking table and dynamic factors, including:

[0171] According to the importance score of the feature and the value of the dynamic factor, the comprehensive score of each feature is calculated, where the calculation formula of the comprehensive score is:

[0172] ;

[0173] in, It is The comprehensive score of the features, represents the number of features, It is The weight of static features It is The feature in The standardized value on samples, is the dynamic factor, ( ) is in The weight at each time point, It is in At a point in time The observed value of a feature, is the time window size of the moving average, It's time. is the index;

[0174] Based on the comprehensive score, the key factors affecting the risk of cardiovascular disease are determined.

[0175] Optionally, based on the comprehensive score, key factors affecting cardiovascular disease risk are determined, including:

[0176] All characteristics are ranked according to the comprehensive score;

[0177] According to the preset threshold, features with a comprehensive score ≥ the threshold are selected from the sorted feature list, and features with a comprehensive score ≥ the threshold are identified as key factors affecting the risk of cardiovascular disease.

[0178] It should be noted that the system is a system corresponding to the above method, and all implementation methods in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0179] The embodiment of the present invention further provides a computing device, comprising: a processor, a memory storing a computer program, wherein when the computer program is executed by the processor, the method described above is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0180] The embodiment of the present invention also provides a computer-readable storage medium storing instructions, which, when executed on a computer, enable the computer to execute the method described above. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0181] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0182] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0183] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0184] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0185] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0186] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0187] In addition, it should be pointed out that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it can be understood that all or any steps or components of the method and apparatus of the present invention can be implemented in hardware, firmware, software or a combination thereof in any computing device (including processors, storage media, etc.) or a network of computing devices, which can be achieved by those of ordinary skill in the art using basic programming skills after reading the description of the present invention.

[0188] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0189] The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A method for processing cardiovascular case data, characterized in that: include: Preprocessing the hypertension electronic medical record dataset to obtain preprocessed data; Using the preprocessed data to build a random forest model, and training the random forest model to obtain a trained random forest model; Calculate the importance score of each feature through the trained random forest model; According to the importance score of each feature, the features are sorted to obtain a feature ranking table; Determine the key factors affecting cardiovascular disease risk based on the feature ranking table and dynamic factors; According to the key factors, a hidden state sequence is determined through the LSTM network, and the hidden state sequence contains information related to disease risk; according to the hidden state sequence, a weight is assigned to each hidden state; the weight calculation formula is: ; in, , is the rectified linear unit activation function; V , W , U and is a parameter, is an additional feature, is the hyperbolic tangent function, represents the length of the sequence, is The hidden state of the moment, and Respectively in Moment and Attention score at the moment; Integrate the prediction results of the LSTM model with those of the auxiliary model to improve the overall prediction performance. The auxiliary model is a model trained based on different feature subsets. The ensemble learning method reduces the bias and variance of a single model by combining the predictions of multiple models, thereby improving the accuracy and robustness of the prediction; The factor decomposition machine is used to perform second-order feature interaction on the original features of the individual to obtain the interaction result; the interaction result is fused with the hidden state sequence to obtain the feature interaction result; The feature interaction results are input into a fully connected network for feature abstraction and combination to obtain the fully connected network output data; the feature interaction results are passed as input to a gradient boosting decision tree model, specifically including, for the gradient boosting decision tree model, training a series of decision trees, after the training is completed, the output data of the gradient boosting decision tree model is the weighted sum of the prediction results of all decision trees; the output data of the fully connected network and the gradient boosting decision tree are integrated to obtain integrated data, and the final disease risk treatment result is obtained according to the integrated data; The hypertension electronic medical record dataset is preprocessed to obtain preprocessed data, including: Random Selection k Initial cluster centers are selected and iterated until the clustering results are stable. The update formula is: ; in, is the cluster label, It is i data points, is the total number of data points in the dataset, is the index, It is a data point To cluster center The square of the Euclidean distance, is a constant; For each cluster, calculate the covariance matrix between features. C ,in, ,in, It is i The weight of the data point, represents the transpose of a matrix, Indicates j The weight of each data point; It is j data points; j is the index; Covariance matrix C Perform eigendecomposition to obtain the covariance matrix C The eigenvalues ​​and corresponding eigenvectors of Sort eigenvectors by eigenvalue; The preprocessed data is obtained by multiplying the original data matrix with the selected principal component matrix; The random forest model is constructed using the preprocessed data, and the random forest model is trained to obtain a trained random forest model, including: Determine the number of decision trees, the final depth of each decision tree, and the number of samples required for leaf nodes; Use the bootstrap sampling method to extract samples from the original training data set to generate a new training subset, and build a decision tree on the new training subset; At each node of the decision tree, the importance of each feature is processed and the final feature is determined for node division; The decision tree continues to grow until a predetermined stopping condition is reached. During the growth process, each node is divided according to the selected features and recursively generates child nodes; Repeat the operation, each time using a different bootstrapped subset to build a decision tree, until the specified number of decision trees are generated; Integrate all the constructed decision trees together to form a random forest model; Training the random forest model to obtain a trained random forest model; After training the random forest model, the importance score of each feature is calculated, including: Get the feature importance properties of the trained random forest model; Based on the feature importance attributes, calculate the feature importance score; According to the importance score of each feature, the features are sorted to obtain a feature sorting table, including: According to the importance scores of the features, the features are preliminarily sorted using the quick sort method to obtain a preliminary sorted list; According to the preliminary sorting list, the correlation between the features is analyzed, and the preliminary sorting list is adjusted according to the correlation to obtain an optimized sorting result, including: for each pair of features in the preliminary sorting list ( , ),in, and Respectively represent h and m features, calculate and The correlation coefficient between them is calculated as follows: ; in, It is The weight of the samples; and They are h and m The standard deviation of the feature, , Representation sample The frequency of occurrence in the data set, , Indicates The sample in h The value of the feature, , represents the number of samples; a correlation value is constructed using the correlation coefficient ,in, , is the smoothing factor of EWMA, is the time; according to the correlation value , construct a correlation matrix R ; Traverse the features in the preliminary sorted list, for each feature F h , find the feature set with high correlation H h ; According to the greedy strategy, for each feature F h , and combine it with the feature set H h The features in are exchanged to obtain the optimized sorting result; Generate a feature sorting table based on the optimized sorting results; Based on the characteristic ranking table and dynamic factors, the key factors affecting cardiovascular disease risk are identified, including: According to the importance score of the feature and the value of the dynamic factor, the comprehensive score of each feature is calculated, where the calculation formula of the comprehensive score is: ; in, It is The comprehensive score of the features, represents the number of features, It is The weight of static features It is The feature in The standardized value on samples, is the dynamic factor, ( ) is in The weight at each time point, It is in At a point in time The observed value of a feature, is the time window size of the moving average, It's time. is the index; , is a smoothing factor between 0 and 1, is the proportionality constant; According to the comprehensive score, key factors affecting cardiovascular disease risk are determined; Based on the comprehensive score, key factors affecting cardiovascular disease risk are determined, including: All characteristics are ranked according to the comprehensive score; According to the preset threshold, features with a comprehensive score ≥ the threshold are selected from the sorted feature list, and features with a comprehensive score ≥ the threshold are identified as key factors affecting the risk of cardiovascular disease.

2. A cardiovascular case data processing system, characterized in that: Applied in the method as claimed in claim 1, comprising: An acquisition module is used to preprocess the hypertension electronic medical record data set to obtain preprocessed data; use the preprocessed data to build a random forest model, train the random forest model to obtain a trained random forest model; calculate the importance score of each feature through the trained random forest model; sort the features according to the importance score of each feature to obtain a feature sorting table; The processing module is used to determine the key factors affecting the risk of cardiovascular disease based on the feature ranking table and dynamic factors; based on the key factors, a hidden state sequence is determined through the LSTM network, and the hidden state sequence contains information related to the disease risk; according to the hidden state sequence, a weight is assigned to each hidden state; the factor decomposition machine is used to perform second-order feature interaction on the original features of the individual to obtain the interaction result; the interaction result is fused with the hidden state sequence to obtain the feature interaction result; the feature interaction result is input into a fully connected network for feature abstraction and combination to obtain the fully connected network output data; for the gradient boosting decision tree model, a series of decision trees are trained, and after the training is completed, the output data of the gradient boosting decision tree model is the weighted sum of the prediction results of all decision trees; the output data of the fully connected network and the gradient boosting decision tree are integrated to obtain the integrated data, and the final disease risk processing result is obtained based on the integrated data.