Multi-path routing feature selection method, device and equipment based on causal inference
By using a multi-path routing feature selection method based on causal inference, constructing a causal graph and combining it with multi-path evaluation, we solve the problems of information loss and low model efficiency in feature selection in existing technologies, and achieve efficient and explainable feature selection and model training.
Patent Information
- Application Number
- CN202510538038.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-09-05
AI Technical Summary
Existing data mining methods have problems in feature selection, such as missing information, long model training time, large amount of computation and low accuracy, especially the lack of versatility and interpretability of causal relationship analysis.
A multi-path routing feature selection method based on causal inference is adopted. By constructing a causal graph, causal relationships are used to screen feature variables, and the filtering path and feature importance evaluation path are combined to comprehensively evaluate the input feature variables, thereby improving feature interpretability and model accuracy.
It shortens the model training time and reduces the amount of computation, while improving the model's prediction accuracy and interpretability and enhancing the effectiveness of feature selection.
Smart Images

Figure CN120596876A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of data processing technology, and in particular to a method, device, and apparatus for selecting multi-path routing features based on causal inference. Background Art
[0002] In the data mining scenario, variable relationship background technology can help analysts understand and explain the relationship between unclear variables and reveal related risks and opportunities. Common methods include correlation analysis-based methods, covariance analysis, etc. Chinese patent application CN115879634A uses the Pearson correlation coefficient as a variable screening condition, and fails to consider the causal relationship between variables and labels. The final screening of modeling variables will result in partial information loss and no explanation. Chinese patent application CN116226648A uses the causal discovery algorithm PCMCI (Parallelized Causal Markov Chain Induction) to perform causal relationship analysis and dimensionality reduction. It requires the construction of a causal graph and time series data, resulting in low versatility. Chinese patent application CN110390272B uses the principal component analysis method to obtain the covariance matrix for data dimensionality reduction. It has poor interpretability and insufficient generalization ability, which will result in partial information loss.
[0003] Therefore, the features selected by the current data mining methods have certain defects, which means that using these features to build application models will result in long training time and large amount of calculation for the application models, poor training effect of the application models, and low model accuracy. Summary of the Invention
[0004] In order to solve the problems existing in the prior art, the embodiments of this specification provide a multi-path routing feature selection method, device and equipment based on causal inference, which is used to screen variables with high causal scores, while improving the interpretability of features, and has a guiding role in subsequent scenario decisions and analysis of the influence relationship between variables. The feature training application model selected by the method of the embodiments of this specification can shorten the training time of the application model, reduce the amount of calculation, and improve the model accuracy.
[0005] The specific technical solutions of the embodiments of this specification are as follows:
[0006] On the one hand, an embodiment of this specification provides a multi-path routing feature selection method based on causal inference, the method comprising:
[0007] Collect target data and form a data set;
[0008] Preprocessing the data set to obtain a preprocessed data set, and identifying characteristic variables from the preprocessed data set;
[0009] Constructing a causal graph corresponding to the preprocessed data set;
[0010] Preliminarily screening the characteristic variables according to the first correlation coefficient between the characteristic variables and the target variable in the causal graph to obtain candidate characteristic variables;
[0011] Using multiple feature selection paths to screen the candidate feature variables to obtain a feature variable subset for each feature selection path, the multiple feature selection paths including a filtering path and a feature importance evaluation path;
[0012] A comprehensive evaluation is performed on the feature variable subsets screened out by multiple feature selection paths to obtain the final input feature variables, so as to facilitate the use of the input feature variables to train the prediction model of the target variable.
[0013] Furthermore, constructing a causal graph corresponding to the preprocessed data set further includes:
[0014] identifying target variables and independent variables in the preprocessed dataset;
[0015] Using variables other than the feature variables, target variables and independent variables in the preprocessed data set as latent variables;
[0016] A causal graph corresponding to the characteristic variables, independent variables, target variables and latent variables is constructed through a causal discovery method.
[0017] Furthermore, preliminarily screening the feature variables according to the first correlation coefficient between the feature variables and the target variable in the causal graph to obtain candidate feature variables further includes:
[0018] Extracting characteristic variables that have a direct or indirect causal relationship with the target variable from the causal graph;
[0019] If there is a direct causal relationship between the extracted characteristic variable and the target variable, directly calculating the first correlation coefficient between the characteristic variable and the target variable;
[0020] If there is an indirect causal relationship between the extracted characteristic variable and the target variable, determining a confounding variable according to the indirect causal relationship, and calculating a first correlation coefficient between the characteristic variable and the target variable under the condition of controlling the confounding variable;
[0021] The feature variable whose first correlation coefficient exceeds a first threshold is used as the candidate feature variable.
[0022] Furthermore, the filtering path includes:
[0023] Calculating a second correlation coefficient between the candidate feature variables;
[0024] The candidate feature variables whose second correlation coefficient is lower than a second threshold among the candidate feature variables are divided into the feature variable subset of the filtering path.
[0025] Furthermore, the feature importance evaluation path includes:
[0026] The importance of the candidate feature variables is evaluated by the XGBoost model to obtain the contribution of each candidate feature variable;
[0027] The candidate feature variables whose contribution is higher than a third threshold among the candidate feature variables are divided into the feature variable subset of the feature importance evaluation path.
[0028] Furthermore, a comprehensive evaluation is performed on the subsets of feature variables selected by multiple feature selection paths, and the final input feature variables include:
[0029] Calculate the frequency of each filtered feature variable being selected, the formula is:
[0030]
[0031] Among them, C j Represents the filtered feature variable f j The frequency of N represents the number of feature selection paths, I represents the exponential function, and S i Represents the i-th feature variable subset, when f j ∈S i When , the value is 1, otherwise it is 0;
[0032] Normalize the frequencies of each filtered feature variable using the formula:
[0033]
[0034] Among them, W j Represents the filtered feature variable f j The result after frequency normalization, M represents the total number of feature variables screened;
[0035] The input feature variables are determined from the screened feature variables according to the result of normalization of the frequencies of the screened feature variables.
[0036] Furthermore, determining the input feature variables from the screened feature variables according to the result of normalizing the frequencies of the screened feature variables includes:
[0037] The filtered feature variables whose frequency normalization results exceed the fourth threshold are used as the input feature variables; or
[0038] The results after frequency normalization are sorted in descending order, and a predetermined number of filtered feature variables ranked at the top are selected as the input feature variables.
[0039] Furthermore, identifying characteristic variables from the preprocessed data set includes:
[0040] The feature variable is identified from the preprocessed data set according to the identifier of the feature variable.
[0041] On the other hand, an embodiment of this specification further provides a multi-path routing feature selection device based on causal inference, the device comprising:
[0042] A data collection unit, used to collect target data and form a data set;
[0043] a characteristic variable identification unit, configured to preprocess the data set to obtain a preprocessed data set, and identify characteristic variables from the preprocessed data set;
[0044] A causal graph construction unit, configured to construct a causal graph corresponding to the preprocessed data set;
[0045] a feature variable preliminary screening unit, configured to perform preliminary screening on the feature variables according to a first correlation coefficient between the feature variables and the target variable in the causal graph to obtain candidate feature variables;
[0046] a feature selection path screening unit, configured to screen the candidate feature variables using a plurality of feature selection paths to obtain a feature variable subset for each feature selection path, wherein the plurality of feature selection paths include a filtering path and a feature importance assessment path;
[0047] The input feature variable selection unit is used to comprehensively evaluate the feature variable subsets screened out by multiple feature selection paths to obtain the final input feature variables, so as to facilitate the use of the input feature variables to train the prediction model of the target variable.
[0048] On the other hand, an embodiment of this specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor implements the above method when executing the computer program.
[0049] On the other hand, an embodiment of this specification further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0050] By using the embodiments of this specification, the interpretability of the screened feature variables is improved through the causal diagram, the core feature variables with causal relationships are retained, and multiple feature selection paths are used to screen the feature variables separately. Finally, a comprehensive evaluation is performed on the feature variable subsets screened by the multiple feature selection paths to obtain the final input feature variables. The input feature variables are used for model training, so that the model can maintain high prediction accuracy and interpretability while simplifying the complexity. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0052] Figure 1 FIG2 is a flow chart of a method for selecting multi-path routing features based on causal inference in an embodiment of this specification;
[0053] Figure 2 The figure shows a flow chart of constructing a causal graph corresponding to the preprocessed data set in an embodiment of this specification;
[0054] Figure 3 The figure shows a flow chart of performing a preliminary screening of the characteristic variables according to the first correlation coefficient between the characteristic variables and the target variable in the causal diagram to obtain candidate characteristic variables in an embodiment of the present specification;
[0055] Figure 4 The figure shows a flow chart of the filtering path in the embodiment of this specification;
[0056] Figure 5 The figure shows a flow chart of the feature importance evaluation path in the embodiment of this specification;
[0057] Figure 6 FIG2 is a schematic diagram showing the structure of a multi-path routing feature selection device based on causal inference in an embodiment of this specification;
[0058] Figure 7 The figure shows a schematic diagram of the structure of a computer device in an embodiment of this specification.
[0059]
Description of the accompanying drawings
[0060] 601, data collection unit;
[0061] 602. Feature variable identification unit;
[0062] 603. Cause-effect diagram construction unit;
[0063] 604. Characteristic variable initial screening unit;
[0064] 605. Feature selection path screening unit;
[0065] 606, input model feature variable selection unit;
[0066] 702. Computer equipment;
[0067] 704. Processing equipment;
[0068] 706. Storage resources;
[0069] 708, drive system;
[0070] 710, input / output module;
[0071] 712. Input devices;
[0072] 714. Output device;
[0073] 716. Presentation equipment;
[0074] 718. Graphical User Interface;
[0075] 720, network interface;
[0076] 722, communication link;
[0077] 724. Communication bus. DETAILED DESCRIPTION
[0078] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the embodiments described are only part of the embodiments of this specification, not all of them. Based on the embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the embodiments of this specification.
[0079] It should be noted that the terms "first", "second", etc. in the description and claims of the embodiments of this specification and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0080] It should be noted that the acquisition, storage, use, and processing of data in the technical solutions of the embodiments of this specification comply with the relevant provisions of national laws and regulations.
[0081] It should be noted that in the embodiments of this specification, certain software, components, models and other existing solutions in the industry may be mentioned. They should be regarded as exemplary and their purpose is only to illustrate the feasibility of implementing the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.
[0082] In order to solve the problems existing in the prior art, the embodiment of this specification provides a multi-path routing feature selection method based on causal inference, such as Figure 1 As shown, the method includes:
[0083] Step 101: Collect target data to form a data set;
[0084] Step 102: preprocessing the data set to obtain a preprocessed data set, and identifying characteristic variables from the preprocessed data set;
[0085] Step 103: constructing a causal graph corresponding to the preprocessed data set;
[0086] Step 104: Preliminarily screen the characteristic variables according to the first correlation coefficient between the characteristic variables and the target variable in the causal diagram to obtain candidate characteristic variables;
[0087] Step 105: screening the candidate feature variables using multiple feature selection paths to obtain a feature variable subset for each feature selection path, wherein the multiple feature selection paths include a filtering path and a feature importance evaluation path;
[0088] Step 106: Comprehensively evaluate the feature variable subsets screened out by multiple feature selection paths to obtain final input feature variables, so as to use the input feature variables to train the prediction model of the target variable.
[0089] In the embodiments of this specification, due to the different dimensions of the data, the data must first be feature engineered. The processing steps include: missing value processing, Pearson correlation coefficient to solve the correlation coefficient between variables, and data normalization. Considering that the variable data must conform to the actual scenario, the default value cannot be used when filling the missing values. Variables with a larger missing rate are deleted, and regression predictions are performed on data with less missing data.
[0090] Data cleaning: a. Handling missing values: Find and handle missing values. You can choose to delete samples containing missing values, fill missing values using interpolation methods, or use specific methods to handle missing values (such as mean filling, regression filling, etc.). b. Handling outliers: Detect and handle outliers. You can use outlier detection methods to identify outliers and then choose an appropriate method to handle them (such as repairing or removing outliers).
[0091] Data transformation: a. Feature encoding: Convert non-numeric features to numeric values. For example, categorical variables can be converted to numeric values using methods such as one-hot encoding and label encoding. b. Feature scaling: Scale features to ensure that the numerical ranges of different features are similar. Common methods include min-max scaling and standardization.
[0092] According to one embodiment of this specification, Figure 2 As shown, constructing the causal graph corresponding to the preprocessed data set further includes:
[0093] Step 201: Identify the target variable and independent variables in the preprocessed data set;
[0094] In this step, the staff can specify which variables are target variables and which variables are independent variables. The system can identify the target variables and independent variables in the dataset based on the form of labels. Similarly, the system can identify the feature variables in the dataset based on the form of labels.
[0095] In the embodiments of this specification, the target data may include the operating data of the server, the business data of the user, etc. The target variable is the data for building a model prediction. If the target data is the operating data of the server, the target variable may be the operating status of the server, such as normal operation, excessive load or downtime, etc. The independent variable (Treatment) refers to the strategy or control method adopted to control the target variable. Taking the target data as the operating data of the server as an example, the independent variable may be a load balancing strategy for controlling the operating status of the server. The load balancing strategy is used to control the operating status of the server, but the factors affecting the operating status of the server include not only the operating status of the server, but also environmental factors such as temperature and humidity. These environmental factors serve as feature variables. Therefore, in order to accurately predict the operating status of the server, it is necessary to select feature variables that have a strong causal relationship with the target variable from the feature variables as input feature variables, and use the input feature variables to train a prediction model for predicting the operating status of the server.
[0096] If the target data is user business data, for example, predicting the click-through rate of users on a product, a high click-through rate indicates a good user experience, while a low click-through rate indicates a need for product improvement and optimization. In this case, the target variable could be the click-through rate of users on the product, and the independent variable could be the action or display strategy taken to encourage users to click on the product. For example, the independent variable could be sending an email introducing the product to users, displaying an ad for the product on the homepage of the industry app, or notifying users of product promotions via text message. Independent variables are variables that the industry can actively control or change, aiming to influence user click behavior. However, in addition to the actions taken or displayed strategies to encourage users to click on the product, the factors that affect the click-through rate of users' products also include user personal information (such as age, gender, occupation), historical transaction records, browsing behavior (such as the number of times the product page is visited and the duration of stay), social media activities, geographic location, etc. User personal information, historical transaction records, browsing behavior, social media activities, and geographic location are used as feature variables. Therefore, in order to accurately predict the user's motivation for the product, it is necessary to select feature variables that have a strong causal relationship with the target variable from the feature variables as input feature variables, and use the input feature variables to train a prediction model for predicting the user's click-through rate for the product.
[0097] Step 202: Variables in the preprocessed data set other than the feature variables, target variables, and independent variables are used as latent variables;
[0098] In this step, latent variables are variables that cannot be directly observed in the model but may have an impact on the outcome (i.e., the dependent variable).
[0099] When predicting the operating status of a server, latent variables might include the types of transactions the server has historically processed. In the scenario of predicting the click-through rate of bank users for a product, latent variables might include users' interests, purchase intentions, financial status, and psychological state. Although these variables cannot be directly observed, they may indirectly influence the target variable through other observable variables.
[0100] Step 203: Construct a causal graph corresponding to the characteristic variables, independent variables, target variables and latent variables through a causal discovery method.
[0101] In the embodiment of this specification, the causal diagram constructed in step 203 can help understand how independent variables affect target variables, while considering latent variables and characteristic variables. Causal analysis provides interpretability, facilitating a better understanding of the causes and impacts behind the target variables, thereby optimizing decision-making and strategy customization.
[0102] According to one embodiment of this specification, Figure 3 As shown, preliminarily screening the feature variables according to the first correlation coefficient between the feature variables and the target variable in the causal graph to obtain candidate feature variables further includes:
[0103] Step 301: extracting characteristic variables that have a direct or indirect causal relationship with the target variable from the causal graph;
[0104] Step 302: If there is a direct causal relationship between the extracted characteristic variable and the target variable, directly calculate a first correlation coefficient between the characteristic variable and the target variable;
[0105] The formula for this step is:
[0106]
[0107] Where Corr(X,Y) represents the first correlation coefficient between variables X and Y, Cov(X,Y) represents the covariance between variables X and Y, Var[X] represents the variance of variable X, and Var[Y] represents the variance of variable Y.
[0108] Step 303: If there is an indirect causal relationship between the extracted characteristic variable and the target variable, a confounding variable is determined based on the indirect causal relationship, and a first correlation coefficient between the characteristic variable and the target variable is calculated while controlling for the confounding variable.
[0109] The formula for this step is:
[0110]
[0111] Wherein, Corr(X,Y|Z) represents the first correlation coefficient between variables X and Y calculated under the condition of controlling the confounding variable Z.
[0112] Step 304: taking the feature variable whose first correlation coefficient exceeds a first threshold as the candidate feature variable.
[0113] In this step, the first threshold can be set based on experience, and the embodiments of this specification do not limit this.
[0114] According to one embodiment of this specification, Figure 4 As shown, the filtering path includes:
[0115] Step 401: Calculate the second correlation coefficient between the candidate feature variables;
[0116] Step 402: Classify the candidate feature variables whose second correlation coefficient is lower than a second threshold among the candidate feature variables into the feature variable subset of the filtering path.
[0117] In the embodiment of this specification, the calculation formula of the second correlation coefficient between the candidate feature variables can refer to the formula for calculating the first correlation coefficient in step 302, and will not be repeated here.
[0118] If the second correlation coefficient is not lower than the second threshold, it means that the two candidate feature variables are highly correlated. In order to avoid increasing multicollinearity, the candidate feature variables whose second correlation coefficient is not lower than the second threshold are removed, and the candidate feature variables whose second correlation coefficient is lower than the second threshold are divided into the feature variable subset of the filtering path.
[0119] It should be noted that the second threshold can be set based on experience, which will not be described in detail here.
[0120] According to one embodiment of this specification, Figure 5 As shown, the feature importance evaluation path includes:
[0121] Step 501: performing importance evaluation on the candidate feature variables using the XGBoost model to obtain the contribution of each candidate feature variable;
[0122] The XGBoost model in this step is common knowledge in the field and will not be described here in detail.
[0123] Step 502: Divide the candidate feature variables whose contribution is higher than a third threshold among the candidate feature variables into a feature variable subset of the feature importance evaluation path.
[0124] In the embodiment of this specification, if the contribution is higher than the third threshold, it means that the candidate feature variable has a great influence on the target variable, so the candidate feature variable is classified into the feature variable subset of the feature importance evaluation path.
[0125] It should be noted that the third threshold can be set based on experience and will not be described in detail here.
[0126] According to one embodiment of the present specification, a comprehensive evaluation is performed on the feature variable subsets screened by multiple feature selection paths to obtain the final input feature variables, including:
[0127] Calculate the frequency of each filtered feature variable being selected, the formula is:
[0128]
[0129] Among them, C j Represents the filtered feature variable f j The frequency of N represents the number of feature selection paths, I represents the exponential function, and S i Represents the i-th feature variable subset, when f j ∈S i When , the value is 1, otherwise it is 0;
[0130] Normalize the frequencies of each filtered feature variable using the formula:
[0131]
[0132] Among them, W j Represents the filtered feature variable f j The result after frequency normalization, M represents the total number of feature variables screened;
[0133] The input feature variables are determined from the screened feature variables according to the result of normalization of the frequencies of the screened feature variables.
[0134] Furthermore, determining the input feature variables from the screened feature variables according to the result of normalizing the frequencies of the screened feature variables includes:
[0135] The filtered feature variables whose frequency normalization results exceed the fourth threshold are used as the input feature variables; or
[0136] The results after frequency normalization are sorted in descending order, and a predetermined number of filtered feature variables ranked at the top are selected as the input feature variables.
[0137] The fourth threshold or predetermined number can be set based on experience and will not be described in detail here.
[0138] After selecting the input and output feature variables, you can use the input feature variables as the training data set and the target variable as the label to train a model to predict the target variable.
[0139] Specifically, the model may be a classification or regression model, which is not limited in the embodiments of this specification. The process of training a classification and regression model is common knowledge in the art and will not be described in detail here.
[0140] Based on the same inventive concept, the embodiment of this specification also provides a multi-path routing feature selection device based on causal inference, such as Figure 6 Shown, including:
[0141] The data collection unit 601 is used to collect target data and form a data set;
[0142] A characteristic variable identification unit 602 is configured to preprocess the data set to obtain a preprocessed data set, and identify characteristic variables from the preprocessed data set;
[0143] A causal graph construction unit 603 is used to construct a causal graph corresponding to the preprocessed data set;
[0144] A feature variable preliminary screening unit 604 is configured to perform preliminary screening on the feature variables according to the first correlation coefficient between the feature variables and the target variable in the causal graph to obtain candidate feature variables;
[0145] A feature selection path screening unit 605 is configured to screen the candidate feature variables using multiple feature selection paths to obtain a feature variable subset for each feature selection path, wherein the multiple feature selection paths include a filtering path and a feature importance assessment path;
[0146] The input feature variable selection unit 606 is used to comprehensively evaluate the feature variable subsets screened out by multiple feature selection paths to obtain the final input feature variables, so as to facilitate the use of the input feature variables to train the prediction model of the target variable.
[0147] Furthermore, constructing a causal graph corresponding to the preprocessed data set further includes:
[0148] identifying target variables and independent variables in the preprocessed dataset;
[0149] Using variables other than the feature variables, target variables and independent variables in the preprocessed data set as latent variables;
[0150] A causal graph corresponding to the characteristic variables, independent variables, target variables and latent variables is constructed through a causal discovery method.
[0151] Furthermore, preliminarily screening the feature variables according to the first correlation coefficient between the feature variables and the target variable in the causal graph to obtain candidate feature variables further includes:
[0152] Extracting characteristic variables that have a direct or indirect causal relationship with the target variable from the causal graph;
[0153] If there is a direct causal relationship between the extracted characteristic variable and the target variable, directly calculating the first correlation coefficient between the characteristic variable and the target variable;
[0154] If there is an indirect causal relationship between the extracted characteristic variable and the target variable, determining a confounding variable according to the indirect causal relationship, and calculating a first correlation coefficient between the characteristic variable and the target variable under the condition of controlling the confounding variable;
[0155] The feature variable whose first correlation coefficient exceeds a first threshold is used as the candidate feature variable.
[0156] Furthermore, the filtering path includes:
[0157] Calculating a second correlation coefficient between the candidate feature variables;
[0158] The candidate feature variables whose second correlation coefficient is lower than a second threshold among the candidate feature variables are divided into the feature variable subset of the filtering path.
[0159] Furthermore, the feature importance evaluation path includes:
[0160] The importance of the candidate feature variables is evaluated by the XGBoost model to obtain the contribution of each candidate feature variable;
[0161] The candidate feature variables whose contribution is higher than a third threshold among the candidate feature variables are divided into the feature variable subset of the feature importance evaluation path.
[0162] Furthermore, a comprehensive evaluation is performed on the subsets of feature variables selected by multiple feature selection paths, and the final input feature variables include:
[0163] Calculate the frequency of each filtered feature variable being selected, the formula is:
[0164]
[0165] Among them, C j Represents the filtered feature variable f j The frequency of N represents the number of feature selection paths, I represents the exponential function, and S i Represents the i-th feature variable subset, when fj ∈S i When , the value is 1, otherwise it is 0;
[0166] Normalize the frequencies of each filtered feature variable using the formula:
[0167]
[0168] Among them, W j Represents the filtered feature variable f j The result after frequency normalization, M represents the total number of feature variables screened;
[0169] The input feature variables are determined from the screened feature variables according to the result of normalization of the frequencies of the screened feature variables.
[0170] Furthermore, determining the input feature variables from the screened feature variables according to the result of normalizing the frequencies of the screened feature variables includes:
[0171] The filtered feature variables whose frequency normalization results exceed the fourth threshold are used as the input feature variables; or
[0172] The results after frequency normalization are sorted in descending order, and a predetermined number of filtered feature variables ranked at the top are selected as the input feature variables.
[0173] Furthermore, identifying characteristic variables from the preprocessed data set includes:
[0174] The feature variable is identified from the preprocessed data set according to the identifier of the feature variable.
[0175] The beneficial effects achieved by the above-mentioned device are consistent with the beneficial effects achieved by the above-mentioned method, and will not be described in detail in the embodiments of this specification.
[0176] like Figure 7Schematic diagram of the structure of a computer device according to an embodiment of the present specification. The computer device according to this embodiment is capable of executing the methods of the embodiments of the present specification described above. Computer device 702 may include one or more processing devices 704, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. Computer device 702 may also include any storage resources 706 for storing any type of information, such as code, settings, data, etc. For example, and without limitation, storage resources 706 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory devices, hard disks, optical disks, etc. More generally, any storage resource may use any technology to store information. Furthermore, any storage resource may provide volatile or non-volatile retention of information. Furthermore, any storage resource may represent a fixed or removable component of computer device 702. In one embodiment, when processing device 704 executes associated instructions stored in any storage resource or combination of storage resources, computer device 702 may perform any operation of the associated instructions. The computer device 702 also includes one or more drive systems 708 for interacting with any storage resources, such as a hard disk drive system, an optical disk drive system, and the like.
[0177] The computer device 702 may also include an input / output module 710 (I / O) for receiving various inputs (via input devices 712) and for providing various outputs (via output devices 714). A specific output mechanism may include a presentation device 716 and an associated graphical user interface (GUI) 718. In other embodiments, the input / output module 710 (I / O), input devices 712, and output devices 714 may not be included, and the computer device 702 may simply be a computer device in a network. The computer device 702 may also include one or more network interfaces 720 for exchanging data with other devices via one or more communication links 722. One or more communication buses 724 couple the components described above together.
[0178] The communication link 722 may be implemented in any manner, for example, via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 722 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0179] The embodiments of this specification also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above method when executed by a processor.
[0180] The embodiments of this specification also provide a computer-readable instruction, wherein when a processor executes the instruction, the program therein causes the processor to execute the above method.
[0181] It should be understood that in the various embodiments of the present specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present specification.
[0182] It should also be understood that in the embodiments of this specification, the term "and / or" is merely a description of the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can represent three situations: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, in the embodiments of this specification, the character " / " generally indicates that the associated objects are in an "or" relationship.
[0183] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. 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 embodiments of this specification.
[0184] Those skilled in the art will 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.
[0185] In the several embodiments provided in the embodiments of this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or can be electrical, mechanical or other forms of connection.
[0186] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.
[0187] In addition, the functional units in each embodiment of the present specification may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0188] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of this specification is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the embodiment of this specification. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0189] The embodiments of this specification use specific embodiments to illustrate the principles and implementation methods of the embodiments of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of the embodiments of this specification. At the same time, for those skilled in the art, based on the ideas of the embodiments of this specification, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the embodiments of this specification.
Claims
1. A multi-path routing feature selection method based on causal inference, characterized in that: The method comprises: Collect target data and form a data set; Preprocessing the data set to obtain a preprocessed data set, and identifying characteristic variables from the preprocessed data set; Constructing a causal graph corresponding to the preprocessed data set; Preliminarily screening the characteristic variables according to the first correlation coefficient between the characteristic variables and the target variable in the causal graph to obtain candidate characteristic variables; Using multiple feature selection paths to screen the candidate feature variables to obtain a feature variable subset for each feature selection path, the multiple feature selection paths including a filtering path and a feature importance evaluation path; A comprehensive evaluation is performed on the feature variable subsets screened out by multiple feature selection paths to obtain the final input feature variables, so as to facilitate the use of the input feature variables to train the prediction model of the target variable.
2. The method according to claim 1, characterized in that Constructing a causal graph corresponding to the preprocessed data set further includes: identifying target variables and independent variables in the preprocessed dataset; Using variables other than the feature variables, target variables and independent variables in the preprocessed data set as latent variables; A causal graph corresponding to the characteristic variables, independent variables, target variables and latent variables is constructed through a causal discovery method.
3. The method according to claim 1, characterized in that Preliminarily screening the feature variables according to the first correlation coefficient between the feature variables and the target variable in the causal graph to obtain candidate feature variables further includes: Extracting characteristic variables that have a direct or indirect causal relationship with the target variable from the causal graph; If there is a direct causal relationship between the extracted characteristic variable and the target variable, directly calculating the first correlation coefficient between the characteristic variable and the target variable; If there is an indirect causal relationship between the extracted characteristic variable and the target variable, determining a confounding variable according to the indirect causal relationship, and calculating a first correlation coefficient between the characteristic variable and the target variable under the condition of controlling the confounding variable; The feature variable whose first correlation coefficient exceeds a first threshold is used as the candidate feature variable.
4. The method according to claim 2, characterized in that The filtering path includes: Calculating a second correlation coefficient between the candidate feature variables; The candidate feature variables whose second correlation coefficient is lower than a second threshold among the candidate feature variables are divided into the feature variable subset of the filtering path.
5. The method according to claim 2, characterized in that The feature importance evaluation path includes: The importance of the candidate feature variables is evaluated by the XGBoost model to obtain the contribution of each candidate feature variable; The candidate feature variables whose contribution is higher than a third threshold among the candidate feature variables are divided into the feature variable subset of the feature importance evaluation path.
6. The method according to claim 1, wherein Comprehensively evaluate the subsets of feature variables selected by multiple feature selection paths, and obtain the final input feature variables including: Calculate the frequency of each filtered feature variable being selected, the formula is: Among them, C j Represents the filtered feature variable f j The frequency of N represents the number of feature selection paths, I represents the exponential function, and S i Represents the i-th feature variable subset, when f j ∈S i When , the value is 1, otherwise it is 0; Normalize the frequencies of each filtered feature variable using the formula: Among them, W j Represents the filtered feature variable f j The result after frequency normalization, M represents the total number of feature variables screened; The input feature variables are determined from the screened feature variables according to the result of normalization of the frequencies of the screened feature variables.
7. The method according to claim 6, characterized in that Determining the input feature variables from the screened feature variables according to the result of normalizing the frequencies of the screened feature variables includes: The filtered feature variables whose frequency normalization results exceed the fourth threshold are used as the input feature variables; or The results after frequency normalization are sorted in descending order, and a predetermined number of filtered feature variables ranked at the top are selected as the input feature variables.
8. The method according to claim 1, characterized in that Identifying feature variables from the preprocessed data set includes: The feature variable is identified from the preprocessed data set according to the identifier of the feature variable.
9. A multi-path routing feature selection device based on causal inference, characterized in that: The device comprises: A data collection unit, used to collect target data and form a data set; a characteristic variable identification unit, configured to preprocess the data set to obtain a preprocessed data set, and identify characteristic variables from the preprocessed data set; A causal graph construction unit, configured to construct a causal graph corresponding to the preprocessed data set; a feature variable preliminary screening unit, configured to perform preliminary screening on the feature variables according to a first correlation coefficient between the feature variables and the target variable in the causal graph to obtain candidate feature variables; a feature selection path screening unit, configured to screen the candidate feature variables using a plurality of feature selection paths to obtain a feature variable subset for each feature selection path, wherein the plurality of feature selection paths include a filtering path and a feature importance assessment path; The input feature variable selection unit is used to comprehensively evaluate the feature variable subsets screened out by multiple feature selection paths to obtain the final input feature variables, so as to facilitate the use of the input feature variables to train the prediction model of the target variable.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.
11. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
A method for dimensionality reduction of EEG signal features based on weighted principal component analysis
CN110390272B
Meteorological environment factor and agricultural drought causal inference method
CN115879634A
Industrial data feature dimension reduction method based on causal inference
CN116226648A
Cited By
A risk control variable intelligent mining and identification method based on causal inference and feature importance fusion
CN122434646A