Causal feature selection method based on neighborhood mutual information
Through the causal feature selection method based on neighborhood mutual information, the problems of causal feature selection algorithm complexity and CI test error are solved, the model performance and generalization ability are improved, and it is suitable for large-scale data sets.
Patent Information
- Application Number
- CN202410815653.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-24
AI Technical Summary
The complexity of existing causal feature selection algorithms increases exponentially with the feature space, and the independent condition test error problem affects model performance.
The causal feature selection method based on neighborhood mutual information is used to identify the Markov blanket structure of the target variable by processing missing values in the data set, discovering father-child variables and spouse variables, and combining normalized neighborhood mutual information and conditional mutual information. Reduce spurious parent-child variables and improve feature selection accuracy.
It improves the performance and generalization ability of the model, reduces the algorithm complexity, improves the accuracy and time efficiency of feature selection, reduces CI test errors, and is suitable for large-scale data sets.
Smart Images

Figure CN118690157A
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of data mining and relates to a causal feature selection method based on neighborhood mutual information. Background Art
[0002] In recent years, with the development of artificial intelligence, feature selection has been widely studied and applied in the fields of machine learning, data mining, genetic analysis, etc. It is a commonly used data dimensionality reduction technology in machine learning. Causal feature selection is an emerging filtering method whose main goal is to learn the Markov blanket (MB) of class variables to improve the robustness and interpretability of the prediction model. However, almost all existing causal feature selection algorithms use independent conditional tests (CI) to learn the Markov blanket, which not only causes the algorithm complexity to grow exponentially with the feature space, but also encounters the CI test error problem and affects the model performance.
[0003] In a faithful Bayesian network (BN), the Markov blanket of the target variable T consists of its parents (direct causes), children (direct effects), and spouses (other parents of the variable's children). Figure 1 As shown in Figure 1, a simple Markov blanket, the MB of the target variable T consists of parent variables {A; C}, child variables {B; D} and spouse variables {E; F}.
[0004] At present, there are three main classification methods for feature selection: one is to divide it into single MB learning and multiple MB learning according to whether the algorithm violates the fidelity assumption to learn MB, among which the single MB learning method is further divided into direct MB learning and divide-and-conquer MB learning. The single MB discovery algorithm attempts to find the only MB of the target variable. Although it has a high accuracy, it is not friendly to large-scale data and may even produce cascading CI test errors. The multiple MB learning algorithm has certain defects and cannot be directly used as a feature selection technology. The other is to divide it into constraint-based methods and score-based methods according to whether the algorithm uses independence tests. The former uses independence tests and has high accuracy and interpretability. The latter uses a score-based BN structure to learn the MB of class variables, which can adapt to different data patterns more flexibly, but requires more computing resources and time. Even if the learned BN structure is too complex, it may increase the risk of overfitting. The third is based on topological structure classification, which is divided into topological-based methods and non-topological methods. Topological-based methods require a large number of CI tests, resulting in excessive time complexity of the algorithm. Therefore, this type of method is data-efficient but not time-efficient; while non-topological-based methods are time-efficient but not data-efficient.
[0005] Neighborhood mutual information is a statistic used to measure the degree of association between two random variables and is often used in the field of feature selection. Its core idea is based on the concepts of information theory, especially mutual information. Mutual information is used to measure the degree of mutual dependence between two random variables, while neighborhood mutual information considers the local feature space on this basis. It measures the degree of association between a feature and other features in its neighborhood. In causal feature selection, calculating neighborhood mutual information can help identify features that have a causal relationship with the target variable, thereby improving the performance and generalization ability of the model. Summary of the invention
[0006] The purpose of the present invention is to provide a causal feature selection method based on neighborhood mutual information to solve the problem that the complexity of the existing causal feature selection algorithm grows exponentially with the feature space, and to make up for the deficiency of the CI test error problem in the prior art that affects the model performance.
[0007] In order to achieve the above object, the technical solution adopted by the present invention is as follows: a causal feature selection method based on neighborhood mutual information, the specific steps are as follows:
[0008] 1) Process the missing values in the data set;
[0009] 2) The parent-child variable discovery stage for causal feature selection on the processed data set, in which the neighborhood mutual information is used to find the local causal structure of each target variable, but only the direct cause and direct effect of the target variable are considered;
[0010] 3) In the mate discovery phase of causal feature selection, conditional mutual information is used to find the set of mate variables for each target variable based on the results of step 2);
[0011] 4) The stage of retrieval of ignored features in causal feature selection re-evaluates the features excluded in the first two stages and identifies the ignored strongly correlated features by analyzing the relationship between these features and the target variable and the selected features;
[0012] 5) Output the intersection of the parent-child variable set and the spouse variable set, that is, the result of the Markov blanket of the target variable.
[0013] Preferably, the specific implementation process of step 2) includes:
[0014] First, neighborhood mutual information is used to measure the correlation between X and Y. In order to further eliminate the influence of variable scale on mutual information value, normalized neighborhood mutual information is used to identify the correlation between features to find the PC set of the target variable. When the PC of each target variable is found, each feature that is strongly correlated with the target variable is marked. The PC set reveals the causal relationship between features, which is convenient for the next stage.
[0015] Preferably, the specific implementation process of step 3) includes:
[0016] By traversing the set of parent-child variables obtained in the previous stage, the mutual information between the target variable T and variables X and Y is calculated, and many false parent-child variables of each variable are removed; the conditional mutual information between T and Y given X is continued to be calculated. If the mutual information between T and Y given X is greater than the mutual information between T and Y, it can be asserted that Y is the spouse of T relative to X, thereby obtaining the spouse variable of each target variable.
[0017] Preferably, the specific formula for calculating the normalized neighborhood mutual information in step 2) is as follows:
[0018]
[0019] Among them, NH δ (A) and NH δ (B) are the adaptive neighborhood entropies of A and B respectively. The larger the NMI(A,B), the higher the correlation between A and B.
[0020] The following definitions are used in this application:
[0021] Definition 1 Mutual Information: Given variables X and Y, where x is a possible value of X and y is a possible value of Y, the mutual information between X and Y is expressed as follows:
[0022]
[0023] Where H(X) is the information entropy of variable X, which defines the uncertainty of the variable. H(X|Y) is the information entropy of X given variable Y, which measures the degree of influence of one variable on another.
[0024] Mutual information can measure the correlation between two random variables. The stronger the correlation between the two variables, the greater the mutual information. The mutual information between the feature and the target variable is calculated to evaluate their degree of association.
[0025] Given a variable Z, the conditional mutual information between X and Y is defined as follows:
[0026]
[0027] Conditional mutual information is a measure of the degree of dependence of two variables given a third variable. The larger I(X; Y|Z), the more related X and Y are given Z. Use conditional mutual information to measure the correlation between two variables given another variable.
[0028] Definition 2 Neighborhood Entropy: Given a set of samples U = x1, x2, ..., xn, this set of samples has a feature set F, A is a subset of the attributes in F, δA (x i ) represents x i In the neighborhood of A, the neighborhood uncertainty of A is expressed as:
[0029]
[0030] The average uncertainty of A, or the adaptive neighborhood entropy of A, is calculated as:
[0031]
[0032] Definition 3 Joint Neighborhood Entropy: A and B are two feature subsets of F, δ A (x i ) represents the sample x i In the neighborhood of feature space A∪B, the joint neighborhood entropy of A and B is calculated as:
[0033]
[0034] The conditional neighborhood entropy of A relative to B is:
[0035]
[0036] Definition 4 Neighborhood Mutual Information: Given two feature subsets A and B of F, the neighborhood mutual information between them is calculated as follows:
[0037]
[0038] The present invention uses neighborhood mutual information to measure the correlation between X and Y. However, in order to effectively measure the relationship between variables and make this measurement comparable between different data sets, the normalized domain mutual information is used to eliminate the influence of the variable scale on the mutual information value, making the mutual information values between different features more comparable. The present invention expresses the normalized domain mutual information as:
[0039]
[0040] Neighborhood mutual information is a metric used for feature selection that aims to evaluate the correlation between features and target variables. Unlike traditional mutual information methods, neighborhood mutual information focuses on the local relationship of data points in the feature space and calculates mutual information by considering the relationship between data points and their neighborhoods, thereby more effectively capturing nonlinear and complex relationships.
[0041] The causal feature selection method based on neighborhood mutual information of the present invention has the following specific beneficial effects:
[0042] 1. The interaction between features is taken into account and combined with the neighborhood mutual information metric, which can fully analyze the neighborhood relationship between the target variable and the features, study the neighborhood entropy and normalized neighborhood mutual information, and introduce the maximization of neighborhood mutual information to improve the algorithm performance.
[0043] 2. Experiments were conducted on 5 benchmark BN datasets and compared with 6 most advanced causal feature selection algorithms. The results showed that the present invention has a higher accuracy rate, verifying the effectiveness of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 For a faithful Bayesian network diagram, nodes represent variables and arrows represent causal relationships between variables.
[0045] Figure 2 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0046] The specific implementation modes of the present invention are described in detail below with reference to specific examples.
[0047] Figure 2 The flowchart of the causal feature selection method based on neighborhood mutual information provided by the present invention specifically includes the following steps:
[0048] 1. Preprocess the samples of the given data set, specifically, process the missing values that may exist in the data set and replace the missing values in the feature with the average value of the feature.
[0049] 2. PC discovery phase: This phase looks for the local causal structure of each target variable, but only considers direct causes and direct effects (i.e., PCs) because it takes too much time to find SPs. It should be noted that PCs represent parent-child variables and SPs represent spouse variables.
[0050] 2.1 Neighborhood mutual information can be used to measure the correlation between X and Y. The specific formula is as follows:
[0051]
[0052] Among them, δ A (x i ) represents x i Neighborhood in A, δ B (x i ) represents x i Neighborhood in B, δ A∪B (x i ) represents x i Neighborhood in A∪B.
[0053] 2.2 In order to further eliminate the influence of variable scale on mutual information value, normalized neighborhood mutual information is used to identify the degree of correlation between features to find the PC set of the target variable.
[0054] The specific formula for calculating the normalized neighborhood mutual information is as follows:
[0055]
[0056] Among them, NH δ (A) and NH δ (B) are the adaptive neighborhood entropies of A and B. The larger the NMI(A,B), the higher the correlation between A and B.
[0057] 2.3 When the PC of each target variable is found, mark each feature that is strongly correlated with the target variable. The PC set reveals the causal relationship between the features, which facilitates the next stage.
[0058] Specifically, the neighborhood of each sample in the data set is first calculated and stored. The definition of the neighborhood may vary depending on the characteristics of the data and the specific application, but it usually refers to a set of features that are closest to the target variable in the feature space. Therefore, the method takes the features with the minimum distance to the target variable under some distance metric (such as Euclidean distance or Manhattan distance).
[0059] Secondly, the N2MI (normalized neighborhood mutual information NMI, abbreviated as N2MI) between the target variable T and other variables is calculated and sorted in descending order. The normalization process ensures that the mutual information values of different features are comparable, so that important features can be screened out more accurately.
[0060] In each iteration, the maximum neighborhood mutual information between the currently selected feature subset and the remaining feature set is calculated.
[0061] If the difference between the new maximum neighborhood mutual information max_nmi and the last calculated last_nmi is greater than the control parameter ctrl_num, and max_nmi is greater than 0, the corresponding feature is added to the feature subset fs_subset and removed from the remaining feature set.
[0062] Update last_nmi to max_nmi.
[0063] If the above conditions are not met, the iteration is terminated.
[0064] 3. SP discovery phase: traverse the PC set obtained in the first phase, calculate the mutual information between the target traversal and X and Y, and remove many false PCs for each variable in the PC.
[0065] The calculation formula of mutual information is as follows:
[0066]
[0067] 3.1 Next, we continue to calculate the mutual information relationship between T and Y under the condition of given X, that is, conditional mutual information, and the calculation formula is as follows:
[0068]
[0069] 3.2 If the mutual information between T and Y given X is greater than the mutual information between T and Y, it can be asserted that Y is the spouse of T relative to X, thereby deriving the SP of each target variable.
[0070] Specifically, first, for each pair of target variable and candidate feature (i.e., features recorded in the first stage), their conditional mutual information is calculated. CMI is the mutual information between two variables given other features, which can help understand the contribution of a specific feature to the target variable when other features are taken into account.
[0071] Based on the calculated CMI value, the features are further screened. Generally speaking, the higher the CMI value, the greater the conditional contribution of the feature to the target variable.
[0072] The purpose of this step is to further identify a set of features that still maintain high relevance in the conditional context among the screened PC features, namely the SP set of the target variable.
[0073] 4. Retrieve ignored features stage: First, re-evaluate the features that were excluded in the first two stages.
[0074] 4.1 By analyzing the relationship between these features and the target variable and the selected features (i.e., PC and SP sets), we can identify those strongly associated features that may be ignored due to multicollinearity or other reasons.
[0075] Specifically, the strongly correlated features labeled in the first stage are identified, and the ignored features are found by traversing all possible ignored features, removing the strongly correlated labels and retesting the dependency between the ignored features and the target variable.
[0076] Once the ignored strongly associated features are identified, they are merged with the previously selected PC and SP sets to form the final feature subset.
[0077] The merging process needs to ensure that these newly identified features do contribute significantly to the target variable and do not introduce unnecessary redundant information.
[0078] 5. Output the intersection of PC and SP, that is, the result of MB.
[0079] In order to verify the effectiveness of the present invention, MB is learned from the benchmark Bayesian network datasets Asia, Child, Alarm, Hailfinder and Hepar2 with known network distribution. These data are typical data networks in causal feature selection algorithms and are evaluated by comparing with 6 more advanced causal feature selection algorithms. Table 1 summarizes the specific information of these biological datasets, including the number of features (Num.Vars) and the number of edges (Num.Edges).
[0080] Table 1 Detailed information of the dataset
[0081]
[0082] Since the BN structures of these data sets are known, the output results of the present invention are compared with the known BN structures to obtain precision, recall and F1 to evaluate the performance of the algorithm. The number of conditional independent tests performed on each algorithm on the benchmark BN data set is compared, and the time indicator (in seconds) is used to evaluate the efficiency of the algorithm.
[0083] Precision. Precision is the number of true positives in the output (features in the output that belong to the true MB of a variable) divided by the number of variables in the output of the algorithm.
[0084] Recall. Recall is the number of true positives in the output divided by the number of true positives in the BN (true MB of the variable).
[0085] F1. F1 = 2 * precision * recall / (precision + recall). The F1 score is the harmonic mean of precision and recall, where F1 = 1 is the best case and F1 = 0 is the worst case.
[0086] In order to intuitively compare the performance of different methods, the experimental results of the present invention and six comparative algorithms running on different BN datasets are summarized in Table 2. Each entry in the table shows the mean of each indicator on the five datasets, and the best result is highlighted in bold.
[0087] Table 2 Experimental results on the benchmark BN dataset
[0088]
[0089]
[0090] In summary, the causal feature selection method based on neighborhood mutual information proposed in the present invention has higher accuracy than other advanced algorithms, and even has the best performance in some specific data sets. Even in the worst case, the error margin remains within 10%. Even if the present invention sacrifices some time efficiency, the Test_num index is still improved.
[0091] Therefore, in the five benchmark BN datasets, the proposed algorithm achieved better performance.
Claims
1. A causal feature selection method based on neighborhood mutual information, characterized in that: The method comprises the following steps: 1) Process the missing values in the data set; 2) The parent-child variable discovery stage for causal feature selection on the processed data set, in which the neighborhood mutual information is used to find the local causal structure of each target variable, but only the direct cause and direct effect of the target variable are considered; 3) In the mate discovery phase of causal feature selection, conditional mutual information is used to find the set of mate variables for each target variable based on the results of step 2); 4) The stage of retrieval of ignored features in causal feature selection re-evaluates the features excluded in the first two stages and identifies the ignored strongly correlated features by analyzing the relationship between these features and the target variable and the selected features; 5) Output the intersection of the parent-child variable set and the spouse variable set, that is, the result of the Markov blanket of the target variable.
2. The causal feature selection method based on neighborhood mutual information according to claim 1, characterized in that: The specific implementation process of step 2) includes: First, the correlation between X and Y is measured using neighborhood mutual information. Further, the normalized neighborhood mutual information is used to identify the degree of correlation between features to find the PC set of the target variable. When the PC of each target variable is found, each feature that is strongly correlated with the target variable is marked. The PC set reveals the causal relationship between the features, which facilitates the next stage.
3. The causal feature selection method based on neighborhood mutual information according to claim 1, characterized in that: The specific implementation process of step 3) includes: By traversing the set of parent-child variables obtained in the previous stage, the mutual information between the target variable T and variables X and Y is calculated, and many false parent-child variables of each variable are removed; the conditional mutual information between T and Y given X is continued to be calculated. If the mutual information between T and Y given X is greater than the mutual information between T and Y, it can be asserted that Y is the spouse of T relative to X, thereby obtaining the spouse variable of each target variable.
4. The causal feature selection method based on neighborhood mutual information according to claim 2, characterized in that: Step 2) The specific formula for calculating the normalized neighborhood mutual information is as follows: Among them, NH δ (A) and NH δ (B) are the adaptive neighborhood entropies of A and B respectively. The larger the NMI(A,B), the higher the correlation between A and B.
