Adaptive causal discovery method and device based on Monte Carlo tree

Through the adaptive causal discovery method based on Monte Carlo tree, the proxy model is used to predict path performance scores and select the best causal structure, which solves the problem of causal inference being difficult in the existing technology when processing complex data, and achieves higher accuracy and applicability of causal discovery.

CN119539041AInactive Publication Date: 2025-02-28NINGXIA UNIVERSITY
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411728173.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-02-28
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The accuracy and applicability of existing causal discovery technologies are limited when dealing with high-dimensional, nonlinear, time series and dynamic data, especially when multivariate interactions and confounding factors exist, it is difficult to effectively infer causal structures.

Method used

Adaptive causal discovery method based on Monte Carlo tree is adopted to narrow the search space of possible graphs through constraints, and use the proxy model to predict path performance scores and select the best causal structure, thereby improving the accuracy of causal discovery.

Benefits of technology

Improve the accuracy and applicability of causal discovery, especially when dealing with complex data scenarios, it can more effectively identify causal relationships and deal with cyclic causal relationships and unobserved confounders.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure BDA0005159684370000043
    Figure BDA0005159684370000043
  • Figure BDA0005159684370000044
    Figure BDA0005159684370000044
  • Figure BDA0005159684370000045
    Figure BDA0005159684370000045
Patent Text Reader

Abstract

The invention provides an adaptive causal discovery method and device based on a Monte Carlo tree, and belongs to the technical field of causal discovery data processing. Comprising the steps of obtaining an observation data set and a statistical information set, and dividing the observation data set into a training set and a verification set; constructing a causal discovery algorithm set A, and training the gradient boosting tree model by using the training set and the path combination to obtain an agent model Fb; establishing a Monte Carlo tree, selecting child nodes of root nodes according to performance expectation and exploration rewards, and expanding the child nodes to leaf nodes layer by layer; running the Monte Carlo tree, and obtaining a causal graph G * and a performance score by using a voting mode according to all causal relationships in the causal graph obtained by each node; calculating an exploration reward and a performance expectation of each node in a complete algorithm path, and returning the exploration reward and the performance expectation upwards to a root node from a leaf node along the path; updating Fb based on the searched path; and processing a causal discovery task by using a Monte Carlo tree and Fb, and finding a causal discovery algorithm path with the highest performance score.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of causal discovery data processing, and in particular to an adaptive causal discovery method and device based on a Monte Carlo tree. Background Art

[0002] Causal discovery technology is to discover causal relationships from observational data. Currently, causal discovery technologies mainly use a series of statistical tests, Markov blankets for identifying variables, and information theory measurement methods. There are great limitations on the type of data that each causal discovery method can handle. The causal relationship of high-dimensional and nonlinear data is difficult to identify, and the causal inference of time series and dynamic data is more complex, while multivariate interactions and confounding factors further increase the difficulty of causal inference. These factors limit the accuracy and applicability of causal discovery technology.

[0003] Score-based and constraint-based causal discovery methods have limitations on complex observational data sets (such as high-dimensional, nonlinear, and noisy data). Score-based methods rely on specific model assumptions, have high computational complexity, and are sensitive to noise and unobserved confounding factors; while constraint-based methods are limited by the accuracy of conditional independence tests on small samples and complex data, the amount of computation increases exponentially with the number of variables, and it is difficult to handle circular causality and unobserved confounding factors. The limitations of these methods make it difficult to accurately infer causal structures in complex data scenarios. Summary of the invention

[0004] In view of this, the present invention provides a method and device for adaptive causal discovery based on Monte Carlo trees, which uses constraints to narrow the search space of possible graphs, and then selects the best causal structure through scoring, thereby improving the accuracy of causal discovery.

[0005] The technical solution adopted by the embodiment of the present invention to solve the technical problem is:

[0006] A method for adaptive causal discovery based on Monte Carlo trees, comprising:

[0007] An adaptive causal discovery method based on Monte Carlo tree, comprising:

[0008] Step S1, obtain the preprocessed observation data set D = {D m} and the statistical information set θ = {θ m}, where m∈[1,M], θ m is the element set D m Statistical information of m Includes the element set D mThe number of samples, number of variables, mean, standard deviation, variance, frequency and quartile in the data set D are calculated, and the observed data set D is divided into non-overlapping training sets D train and validation set D vectify ;

[0009] Step S2, training the proxy model F b : Construct the causal discovery algorithm set A and the gradient boosting tree model, using the training set D train And the path combination {x n} Train the gradient boosting tree model to obtain the proxy model F b ;

[0010] Step S3, establish a Monte Carlo tree, select a root node from the causal discovery algorithm set A, and use the proxy model F b Predict the performance score of the path to be expanded, select child nodes based on the performance expectations and exploration rewards of the path expanded to the node, and expand to the leaf node layer by layer;

[0011] Step S4, run the Monte Carlo tree, and use voting to obtain the final causal graph G according to all the causal relationships in the causal graph obtained from each node. * , and using the proxy model F b Prediction G * The performance score of the path that produces the result;

[0012] Step S5, calculating the exploration reward and performance expectation of each node in the complete algorithm path, and transmitting the exploration reward and the performance expectation from the leaf node along the path upward to the root node;

[0013] Step S6: Update the proxy model F based on all paths searched by the Monte Carlo tree. b ;

[0014] Step S7, using the Monte Carlo tree and the proxy model F b Processing a causal discovery task, selecting a causal discovery algorithm path with the highest performance score, and exploring the causal discovery task using a causal algorithm combination consisting of nodes in the path.

[0015] Preferably, before step S1, the observation data set D is also preprocessed, and the preprocessing process includes:

[0016] Step S11, detecting each element set D m Null values ​​and outliers in the list, delete the rows with null values ​​and outliers;

[0017] Step S11: If the element set D m If each element in the equation is continuous, then the element set D is defined as mThe type is continuous;

[0018] Step S12: If the element set D m If each element in the equation is discrete, then the element set D is defined as m The type is discrete.

[0019] Preferably, the step S2 comprises:

[0020] Step S21, construct the causal discovery algorithm set A, and divide the set A according to the type of observation data that the causal discovery algorithm can process, to obtain the algorithm set A i , i∈{continuous,discrete}, where the algorithm set A continuous Represents a set of causal discovery algorithms for processing continuous data sets, algorithm set A discrete Represents a collection of causal discovery algorithms for processing discrete data sets;

[0021] Step S22, dividing the training set D according to the set type train , we get two training sets D train-i , i∈{continuous, discrete};

[0022] Step S23, establish the gradient boosting tree model and train it to obtain the proxy model F b , the implementation steps include:

[0023] Step S231: Generate a set of random path combinations {x n}, n∈[1,N], in the training data set D train-i Run the set A for each path i Causal discovery algorithm in a ij , generate a causal graph and calculate the performance score F(x n ):

[0024] F(x n )=w1·SHD(x n )+w2·AUPRC(x n )+w3·TPR(x n )-w4·FDR(x n )

[0025] In the formula, w1, w2, w3, w4 are weights, SHD(x n ) represents the path x n The structural Hamming distance of AUPRC(x n ) represents the path x n The precision recall rate, TPR(xn ) represents the path x n The true positive rate, FDR(x n ) represents the path x n False discovery rate;

[0026] Step S232, for each path x n Extract features in, Contains path structure, algorithm selection a ij And the dataset features θ train-i ;

[0027] Step S233, establish a training set Using the training set Train the proxy model F b , the proxy model F b The goal is to minimize the error between the predicted value and the true score, the formula is:

[0028]

[0029] When the maximum number of training times is reached or the Loss converges, the proxy model F b The training is over.

[0030] Preferably, the step S3 comprises:

[0031] Step S31, based on the observation data set D train-i The statistical information set θ train-i , from the set A i Randomly select A i (S0) is the initial node of the Monte Carlo tree;

[0032] Step S32, using the proxy model F b Predict the performance of the current path s in the Monte Carlo tree by extending to the candidate node a and obtain the predicted performance score F b (sa), a∈A i , calculate the expected performance Q(s,a) of the current path s after it is extended to the candidate node a:

[0033]

[0034] Among them, Q(s,a) represents the average performance prediction value after the current path s is selected and extended to the candidate node a, X(sa) represents the set of complete paths generated by extending the path sa; x represents a complete path generated from sa, F(x) represents the performance score of the complete path x, and β represents the weight factor;

[0035] Step S33, during the training process, n(s,a) and n(s) are updated after each calculation of Q(s,a), where n(s,a) represents the number of visits from the current path s to the candidate node a, and n(s) represents the number of visits from the current path s to the candidate node a;

[0036] Step S34, calculate and update the exploration reward U(s,a) of path sa:

[0037]

[0038] Among them, C is a positive constant that controls the degree of exploration;

[0039] Step S35, construct a probability selection strategy π based on the performance expectation Q(s,a) and the exploration reward U(s,a):

[0040] Score(s,a)=Q(s,a)+U(s,a)

[0041]

[0042] Among them, Score(s,a) represents the selection score of candidate node a, ∑ b∈A(s) exp(Score(s,b)) means calculating the exponential sum of the scores of all a algorithms to be expanded in the s path, and A(s) is the set of candidate nodes;

[0043] Step S36, based on the AlphaGoZero strategy, the node expansion selection strategy is:

[0044]

[0045] When the expansion reaches the preset maximum depth, the expansion stops and the current complete causal discovery algorithm path is returned.

[0046] Preferably, the step S4 comprises:

[0047] Step S41: Run all algorithm nodes on the returned algorithm path and obtain the causal graph G obtained by each node. z * , z∈[1,Z], Z is the total number of Monte Carlo tree nodes; each causal graph G z * All causal relationships in are processed by voting to obtain the final causal graph G * ;

[0048] Step S42, according to D train The corresponding real causal graph G evaluates the causal graph G * , and get G * The path x that produces the result *The comprehensive performance score F(x * ).

[0049] Preferably, the step S5 comprises:

[0050] Step S51, calculate the exploration reward U(s,a) of each node of the current complete algorithm path x, and transmit it back from the leaf node along the path upward as the reward value;

[0051] Step S52, for each node sa on the path x, increase the number of node visits n(sa);

[0052] Step S53: Update the performance expectation Q(sa), the update formula is:

[0053]

[0054] Among them, F(x) is the performance score of the new path, Q new (sa) is the expected performance value after update, Q old (sa) is the expected performance value before updating; n new (sa) is the number of visits after update, n old (sa) is the number of visits before the update;

[0055] Step S54, repeating steps S52 and S53 to transmit U(s,a) and Q(sa) upward layer by layer until reaching the root node S0.

[0056] Step S55, using the validation set D vectify Verify the performance of Monte Carlo trees.

[0057] Preferably, the step S6 comprises:

[0058] Step S61, path x * Establish φ(x * ), and φ(x * ) and F(x * ) is added to the training set {(φ(x n ),F(x n ))}middle;

[0059] Step S62, from the training set {(φ(x n ),F(x n ))} select N1 elements to generate a path validation set to verify the proxy model F b , N1<N, use the mean square error Loss and determination coefficient to evaluate the proxy model to predict the proxy model F b performance data and record them;

[0060] Step S63: determine whether the proxy model F needs to be updated. b When the obtained Loss value is higher than the previous Loss value, or the prediction result of the determination coefficient evaluation proxy model exceeds the determination coefficient threshold, it is considered that the F needs to be updated. b , adjust the proxy model F b After the parameters are obtained, the process returns to step S62;

[0061] Step S64: When the recorded performance data reaches N2, the agent model F is triggered. b Update, the updating method is to implement the training process of step S2 based on the training set of step S61.

[0062] It can be seen from the above technical scheme that the method for adaptive causal discovery based on Monte Carlo tree provided by the embodiment of the present invention mainly describes the steps of optimizing the causal discovery algorithm based on the observed data set. First, data preprocessing is performed by obtaining the statistical information of the observed data set; a set of causal discovery algorithms is constructed and trained, candidate causal graphs are generated and the performance is evaluated, and the preferred algorithm is used as the search starting point; when a leaf node is searched, the child node is expanded according to the performance of the current algorithm configuration, and the entire causal discovery process is completed through the sampling strategy and its performance is evaluated; the performance index of the entire configuration is calculated and returned as a reward value; adaptive causal discovery configuration optimization is achieved through Monte Carlo tree search and online integration strategy, thereby improving the overall prediction performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 Flowchart for performing the operations of the Monte Carlo tree based adaptive causal discovery method.

[0064] Figure 2 This is the architecture diagram of the Monte Carlo tree-based adaptive causal discovery algorithm.

[0065] Figure 3 Taking a continuous observation data set containing five variables as an example, ensemble learning is used on the optimal algorithm configuration to predict the final causal graph process. DETAILED DESCRIPTION

[0066] The technical scheme and technical effects of the present invention are further elaborated in detail below in conjunction with the accompanying drawings of the present invention.

[0067] The method of adaptive causal discovery based on Monte Carlo tree provided by the present invention is used to optimize and improve the accuracy of causal discovery. Figure 1 The flowchart shown in the figure includes:

[0068] Step S1, obtain the preprocessed observation data set D = {D m} and the statistical information set θ = {θm}, where m∈[1,M], θ m is the element set D m Statistical information of m Includes the element set D m The number of samples, number of variables, mean, standard deviation, variance, frequency and quartile in the dataset D are divided into non-overlapping training sets D train and validation set D vectify ;

[0069] Step S2, training the proxy model F b : Construct a causal discovery algorithm set A and a gradient boosting tree model, using the training set D train And the path combination {x n} Train the gradient boosting tree model to obtain the proxy model F b ;

[0070] Step S3, establish a Monte Carlo tree, select the root node from the causal discovery algorithm set A, and use the proxy model F b Predict the performance score of the path to be expanded, select child nodes based on the performance expectations and exploration rewards of the path expanded to the node, and expand to the leaf node layer by layer;

[0071] Step S4, run the Monte Carlo tree, and use voting to obtain the final causal graph G according to all the causal relationships in the causal graph obtained from each node. * , and using the proxy model F b Prediction G * The performance score of the path that produces the result;

[0072] Step S5, calculating the exploration reward and performance expectation of each node in the complete algorithm path, and transmitting the exploration reward and performance expectation from the leaf node along the path upward to the root node;

[0073] Step S6: Update the proxy model F based on all paths searched by the Monte Carlo tree b ;

[0074] Step S7, using the Monte Carlo tree and the proxy model F b Processing causal discovery tasks, selecting the causal discovery algorithm path with the highest performance score, and exploring causal discovery tasks using the causal algorithm combination composed of each node in the path. Combining the Monte Carlo tree search framework with the surrogate model to achieve efficient adaptive causal discovery algorithm optimization, and using the online integration strategy to combine multiple models generated during the search process into a composite model to improve the final prediction performance.

[0075] Preferably, before step S1, the observation data set D is also preprocessed, and the preprocessing process includes:

[0076] Step S11, detecting each element set D m Null values ​​and outliers in the list, delete the rows with null values ​​and outliers;

[0077] Step S11: If the element set D m If each element in is continuous, then define the element set D m The type is continuous;

[0078] Step S12: If the element set D m If each element in is discrete, then define the element set D m The type is discrete.

[0079] Preprocessing can also be done by filling in empty values ​​and replacing outliers. m For the continuous type, detect the null values ​​and outliers in the data set and fill or replace them according to the distribution of the data. For the discrete type, detect the null values ​​and outliers in the data set and decide whether to delete or fill them according to the frequency and category of the null values ​​and outliers.

[0080] Preferably, the specific implementation of step S2 includes:

[0081] Step S21, construct a causal discovery algorithm set A, and divide the set A according to the type of observation data that the causal discovery algorithm can process, to obtain an algorithm set A i , i∈{continuous,discrete}, algorithm set A i As the search space of Monte Carlo tree; among them, the algorithm set A continuous Represents a set of causal discovery algorithms for processing continuous data sets, algorithm set A discrete Represents a collection of causal discovery algorithms for processing discrete data sets;

[0082] Step S22, dividing the training set D according to the set type train , we get two training sets D train-i , i∈{continuous, discrete};

[0083] Step S23: Establish a gradient boosting tree model and train it to obtain a proxy model F b , the implementation steps include:

[0084] Step S231: Generate a set of random path combinations {x n}, n∈[1,N], in the training data set D train-iRun the set A for each path i Causal discovery algorithm in a ij , generate a causal graph and calculate the performance score F(x n ):

[0085] F(x n )=w1·SHD(x n )+w2·AUPRC(x n )+w3·TPR(x n )-w4·FDR(x n )

[0086] In the formula, w1, w2, w3, w4 are weights, SHD(x n ) represents the path x n The structural Hamming distance of AUPRC(x n ) represents the path x n The precision recall rate, TPR(x n ) represents the path x n The true positive rate, FDR(x n ) represents the path x n False discovery rate;

[0087] SHD (Structural Hamming Distance): Measures the number of structural differences between the causal graph and the true causal graph. Calculates the number of differences between the edges predicted by the algorithm and the actual edges. The smaller the SHD, the closer the structure of the predicted graph is to the true graph.

[0088] FDR (False Discovery Rate): It is used to determine how many of the causal relationships identified by the algorithm are incorrect. Specifically, it is calculated by dividing the number of incorrect causal relationships by the total number of discoveries. A low FDR means that the algorithm has a low false recognition rate.

[0089] TPR (True Positive Rate): The proportion of causal relationships that are correctly identified in reality. The higher the TPR, the stronger the detection ability of the algorithm.

[0090] Precision-Recall Rate (AUPRC): used to evaluate the overall prediction effect of the algorithm. Precision is the proportion of causal edges that are truly causal, and recall is the proportion of all true causal edges that are predicted.

[0091] Step S232, for each path x n Extract features in, Contains path structure, algorithm selection a ij And the dataset features θtrain-i ;

[0092] Step S233, establish a training set Using the training set Train the agent model F b , proxy model F b The goal is to minimize the error between the predicted value and the true score, the formula is:

[0093]

[0094] Among them, when the maximum number of training times is reached or Loss converges, the proxy model F b The training is over.

[0095] Preferably, step S3 includes:

[0096] Step S31, based on the observation data set D train-i The statistical information set θ train-i , from the set A i Randomly select A i (S0) is used as the initial node of the Monte Carlo tree; according to the training observation data set D train The data set type is randomly sampled from the corresponding algorithm set, and the sampled causal discovery algorithm is selected as the initial algorithm node;

[0097] Step S32: Since the number of visits to each node is not determined during the initial training process, it is necessary to use the proxy model F b Predict the performance of the current path s in the Monte Carlo tree by extending to the candidate node a and obtain the predicted performance score F b (sa), a∈A i , assist in exploring nodes with better performance first (the better performance is reflected by F b (the difference between sa) and F(x) is small), calculate the expected performance Q(s,a) after the current path s is selected and extended to the candidate node a:

[0098]

[0099] Where Q(s,a) represents the average performance prediction value after the current path s is selected and extended to the candidate node a, X(sa) represents the set of complete paths generated by extending the path sa; x represents a complete path generated from sa, and F(x) represents the performance score of the complete path x; F b(sa) The performance value of path Sa predicted by the proxy model is used to supplement the situation where the real evaluation data is insufficient, especially in the initial stage; β represents the weight factor, which controls the influence of the proxy model prediction value on Q(s,a). In the initial stage, β can be set higher and gradually decrease as the number of evaluations increases, so that Q(s,a) relies more on the real evaluation value.

[0100] Step S33, during the training process, n(s,a) and n(s) are updated after each calculation of Q(s,a), where n(s,a) represents the number of visits from the current path s to the candidate node a, and n(s) represents the number of visits from the current path s to the candidate node a;

[0101] Step S34, calculate and update the exploration reward U(s,a) of path sa:

[0102]

[0103] Among them, C is a positive constant that controls the degree of exploration;

[0104] Step S35, construct a probability selection strategy π based on the performance expectation Q(s,a) and the exploration reward U(s,a):

[0105] Score(s,a)=Q(s,a)+U(s,a) (4)

[0106]

[0107] Among them, Score(s,a) represents the selection score of candidate node a, ∑ b∈A(s) exp(Score(s,b)) means calculating the exponential sum of the scores of all a algorithms (called candidate nodes) to be expanded in the path s, ensuring that the selection probability meets the probability distribution requirements and amplifies the difference between high-scoring nodes and low-scoring nodes. A(s) is the set of candidate nodes that can be selected in the current path s.

[0108] Step S36, based on the AlphaGoZero strategy, the node expansion selection strategy is:

[0109]

[0110] When the expansion reaches the preset maximum depth, the expansion stops and the current complete causal discovery algorithm path is returned.

[0111] Preferably, step S4 includes:

[0112] Step S41: Run all algorithm nodes on the returned algorithm path and obtain the causal graph G obtained by each node. z *, z∈[1,Z], Z is the total number of Monte Carlo tree nodes; each causal graph G z * All causal relationships in are processed by voting to obtain the final causal graph G * ;

[0113] Step S42, according to D train The corresponding real causal graph G evaluates the causal graph G * , and get G * The path x that produces the result * The comprehensive performance score F(x * ). train The corresponding real causal graph G is the preset data.

[0114] Preferably, step S5 includes:

[0115] Step S51, calculate the exploration reward U(s,a) of each node of the current complete algorithm path x, and transmit it back from the leaf node along the path upward as the reward value;

[0116] Step S52, for each node sa on the path x, increase the number of node visits n(sa);

[0117] Step S53: Update the performance expectation Q(sa), the update formula is:

[0118]

[0119] Among them, F(x) is the performance score of the new path, Q new (sa) is the expected performance value after update, Q old (sa) is the expected performance value before updating; n new (sa) is the number of visits after update, n old (sa) is the number of visits before the update;

[0120] Step S54, repeating steps S52 and S53 to transmit U(s,a) and Q(sa) upward layer by layer until reaching the root node S0.

[0121] Step S55, using the validation set D vectify Verify the performance of Monte Carlo trees.

[0122] Preferably, step S6 comprises:

[0123] Step S61, path x * Establish And will and F(x * ) is added to the training set middle;

[0124] Step S62, from the training set Select N1 elements from the path validation set to validate the proxy model F b ,N1<N,Use mean square error Loss and determination coefficient to evaluate the proxy model prediction proxy model F b performance data and record them;

[0125] Step S63: determine whether the proxy model F needs to be updated. b When the obtained Loss value is higher than the previous Loss value, or the prediction result of the determination coefficient evaluation proxy model exceeds the determination coefficient threshold, it is considered that F needs to be updated. b , adjust the proxy model F b After the parameters are obtained, the process returns to step S62;

[0126] Step S64: When the recorded performance data reaches N2, the agent model F is triggered. b Update, the updating method is to implement the training process of step S2 based on the training set of step S61.

[0127] The present invention provides a device for an adaptive causal discovery method, referring to Figure 2 As shown, it includes an algorithm configuration module 21, an agent model module 22, a causal discovery algorithm search module 23, and an algorithm online integration module 24.

[0128] An algorithm configuration module 21, used to integrate different types of causal discovery methods and generate a corresponding search space of a Monte Carlo tree search algorithm;

[0129] An agent model module 22, used to assist the initial node selection and the extended node selection of the Monte Carlo tree search algorithm based on the historical causal discovery algorithm performance data;

[0130] A causal discovery algorithm search module 23 allows the Monte Carlo tree search algorithm to expand and simulate in the constructed search space to find the optimal causal discovery algorithm combination;

[0131] The algorithm online integration module 24 uses an online integration strategy to combine the better causal algorithms found based on Monte Carlo tree search to complete the prediction task for a given causal discovery task.

[0132] The following is explained by an example: the existing continuous and discrete observation data set set {D continuous ,D discrete}, where D continuous Contains {D c1 ,D c2 ,...,D ck}, k∈[1,2,3,…], similarly D discrete Contains {D d1 ,D d2 ...D dm}, m∈[1,2,3,…], and the set of causal discovery algorithms {A continuous ,A discrete}, where A continuous Contains c1 ,A c2 ,...,A ck}, k∈[1,2,3,…,6], similarly A discrete Contains: d1 ,A d2 ,...,A dm}, m∈[1,2,3,…,6].

[0133] According to the above configuration and the technical solution, the implementation steps of the corresponding examples are given.

[0134] First, preprocess each D in the set of observed data sets to obtain the statistical information θ of each data set;

[0135] Second, 30% of D is divided as the training set of F, and F is trained. Then, the remaining candidate data set and the corresponding statistical information θ are run in the corresponding causal algorithm integration environment, and the initial algorithm performance set {A k ,θ,{SHD,FDR,TPR,AUPRC},Time};

[0136] Third, in D continuous With D discrete Based on and combining θ in two different types of data sets, the optimal root node is predicted according to F and used as the starting point of Monte Carlo tree search;

[0137] Fourth, based on the selected root node, a phase of node expansion is performed according to the prediction results of F, gradually forming a complete algorithm configuration Pip, and performing simulation evaluation to obtain the actual performance Q F The reward value is calculated and the real performance data is transmitted back to the root node along the path and then to the training data set of F. Then, the value of the probability selection model π(a|Pip) is calculated according to the above scheme to assist the Monte Carlo tree in selecting and expanding new nodes for different data scenarios.

[0138] Fifth, based on the above steps, complete the Monte Carlo tree search to obtain the causal discovery algorithm configuration Pip that performs best on different data sets: discrete On d1 ,A d5 ,A d6,A d2}, in D continuous On c2 ,A c3 ,A c6 ,A c1}, each algorithm on each data set is weightedly combined using an ensemble learning method, and then the causal graph G* predicted based on the observed data set is output. Specifically, for example, in the D continuous The causal diagram obtained by each algorithm configuration (taking five variables as an example) is referenced Figure 3 As shown. discrete The algorithm configuration above uses ensemble learning Figure 3 The process obtains the final predicted causal diagram.

[0139] According to the embodiments disclosed in the present invention, the present invention also discloses an electronic device, a readable storage medium and a computer program product. The electronic device is intended to represent various forms of digital computers, including a computing unit, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for the operation of the device can also be stored. The computing unit, ROM and RAM are connected to each other via a bus. The input / output (I / O) interface is also connected to the bus.

[0140] Multiple components in the device are connected to the I / O interface, including: input unit, output unit, storage unit, and communication unit. The communication unit allows the device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0141] The computing unit may be various general and / or special processing components with processing and computing capabilities, and executes the various methods and processes described above, such as the adaptive causal discovery method based on the Monte Carlo tree.

[0142] What is disclosed above is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. A person skilled in the art can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.

Claims

1. An adaptive causal discovery method based on Monte Carlo tree, characterized in that: include: Step S1, obtain the preprocessed observation data set D = {D m } and the statistical information set θ = {θ m }, where m∈[1,M], θ m is the element set D m Statistical information of m Includes the element set D m The number of samples, number of variables, mean, standard deviation, variance, frequency and quartile in the data set D are calculated, and the observed data set D is divided into non-overlapping training sets D train and validation set D vectify ; Step S2, training the proxy model F b : Construct the causal discovery algorithm set A and the gradient boosting tree model, using the training set D train And the path combination {x n } Train the gradient boosting tree model to obtain the proxy model F b ; Step S3, establish a Monte Carlo tree, select a root node from the causal discovery algorithm set A, and use the proxy model F b Predict the performance score of the path to be expanded, select child nodes based on the performance expectations and exploration rewards of the path expanded to the node, and expand to the leaf node layer by layer; Step S4, run the Monte Carlo tree, and use voting to obtain the final causal graph G according to all the causal relationships in the causal graph obtained from each node. * , and using the proxy model F b Prediction G * The performance score of the path that produces the result; Step S5, calculating the exploration reward and performance expectation of each node in the complete algorithm path, and transmitting the exploration reward and the performance expectation from the leaf node along the path upward to the root node; Step S6: Update the proxy model F based on all paths searched by the Monte Carlo tree. b ; Step S7, using the Monte Carlo tree and the proxy model F b Processing a causal discovery task, selecting a causal discovery algorithm path with the highest performance score, and exploring the causal discovery task using a causal algorithm combination consisting of nodes in the path.

2. The Monte Carlo tree-based adaptive causal discovery method according to claim 1, characterized in that: Before step S1, the observation data set D is also preprocessed, and the preprocessing process includes: Step S11, detecting each element set D m Null values ​​and outliers in the list, delete the rows with null values ​​and outliers; Step S11: If the element set D m If each element in the equation is continuous, then the element set D is defined as m The type is continuous; Step S12: If the element set D m If each element in the equation is discrete, then the element set D is defined as m The type is discrete.

3. The Monte Carlo tree-based adaptive causal discovery method according to claim 2, characterized in that: The step S2 comprises: Step S21, construct the causal discovery algorithm set A, and divide the set A according to the type of observation data that the causal discovery algorithm can process, to obtain the algorithm set A i , i∈{continuous,discrete}, where the algorithm set A continuous Represents a set of causal discovery algorithms for processing continuous data sets, algorithm set A discrete Represents a collection of causal discovery algorithms for processing discrete data sets; Step S22, dividing the training set D according to the set type train , we get two training sets D train-i , i∈{continuous, discrete}; Step S23, establish the gradient boosting tree model and train it to obtain the proxy model F b , the implementation steps include: Step S231: Generate a set of random path combinations {x n }, n∈[1,N], in the training data set D train-i Run the set A for each path i Causal discovery algorithm in ij , generate a causal graph and calculate the performance score F(x n ): F(x n )=w1·SHD(x n )+w2·AUPRC(x n )+w3·TPR(x n )-w4·FDR(x n ) where w1, w2, w3, w4 are weights, SHD(x n ) represents the path x n The structural Hamming distance of AUPRC(x n ) represents the path x n The precision recall rate, TPR(x n ) represents the path x n The true positive rate, FDR(x n ) represents the path x n False discovery rate; Step S232, for each path x n Extract features in, Contains path structure, algorithm selection a ij And the dataset features θ train-i ; Step S233, establish a training set Using the training set Train the proxy model F b , the proxy model F b The goal is to minimize the error between the predicted value and the true score, the formula is: When the maximum number of training times is reached or the Loss converges, the proxy model F b The training is over.

4. The Monte Carlo tree-based adaptive causal discovery method according to claim 3, characterized in that: The step S3 comprises: Step S31, based on the observation data set D train-i The statistical information set θ train-i , from the set A i Randomly select A i (S0) is the initial node of the Monte Carlo tree; Step S32, using the proxy model F b Predict the performance of the current path s in the Monte Carlo tree by extending to the candidate node a and obtain the predicted performance score F b (sa), a∈A i , calculate the expected performance Q(s,a) of the current path s after it is extended to the candidate node a: Among them, Q(s,a) represents the average performance prediction value after the current path s is selected and extended to the candidate node a, X(sa) represents the set of complete paths generated by extending the path sa; x represents a complete path generated from sa, F(x) represents the performance score of the complete path x, and β represents the weight factor; Step S33, during the training process, n(s,a) and n(s) are updated after each calculation of Q(s,a), where n(s,a) represents the number of visits from the current path s to the candidate node a, and n(s) represents the number of visits from the current path s to the candidate node a; Step S34, calculate and update the exploration reward U(s,a) of path sa: Among them, C is a positive constant that controls the degree of exploration; Step S35, construct a probability selection strategy π based on the performance expectation Q(s,a) and the exploration reward U(s,a): Score(s,a)=Q(s,a)+U(s,a) Among them, Score(s,a) represents the selection score of candidate node a, ∑ b∈A(s) exp(Score(s,b)) means calculating the exponential sum of the scores of all a algorithms to be expanded in the s path, and A(s) is the set of candidate nodes that can be selected in the current path s; Step S36, based on the AlphaGoZero strategy, the node expansion selection strategy is: When the expansion reaches the preset maximum depth, the expansion stops and the current complete causal discovery algorithm path is returned.

5. The Monte Carlo tree-based adaptive causal discovery method according to claim 4, characterized in that: The step S4 comprises: Step S41: Run all algorithm nodes on the returned algorithm path and obtain the causal graph G obtained by each node. z * , z∈[1,Z], Z is the total number of Monte Carlo tree nodes; each causal graph G z * All causal relationships in are processed by voting to obtain the final causal graph G * ; Step S42, according to D train The corresponding real causal graph G evaluates the causal graph G * , and get G * The path x that produces the result * The comprehensive performance score F(x * ).

6. The Monte Carlo tree-based adaptive causal discovery method according to claim 5, characterized in that: The step S5 comprises: Step S51, calculate the exploration reward U(s,a) of each node of the current complete algorithm path x, and transmit it back from the leaf node along the path upward as the reward value; Step S52, for each node sa on the path x, increase the number of node visits n(sa); Step S53: Update the performance expectation Q(sa), the update formula is: Among them, F(x) is the performance score of the new path, Q new (sa) is the expected performance value after update, Q old (sa) is the expected performance value before updating; n new (sa) is the number of visits after update, n old (sa) is the number of visits before the update; Step S54, repeating steps S52 and S53 to transmit U(s,a) and Q(sa) upward layer by layer until reaching the root node S0; Step S55, using the validation set D vectify Verify the performance of Monte Carlo trees.

7. The Monte Carlo tree-based adaptive causal discovery method according to claim 6, characterized in that: The step S6 comprises: Step S61, path x * Establish And will and F(x * ) is added to the training set middle; Step S62, from the training set Select N1 elements from the generated path validation set to validate the proxy model F b , N1<N, use the mean square error Loss and determination coefficient to evaluate the proxy model to predict the proxy model F b performance data and record them; Step S63: determine whether the proxy model F needs to be updated. b When the obtained Loss value is higher than the previous Loss value, or the prediction result of the determination coefficient evaluation proxy model exceeds the determination coefficient threshold, it is considered that the F needs to be updated. b , adjust the proxy model F b After the parameters are obtained, the process returns to step S62; Step S64: When the recorded performance data reaches N2, the agent model F is triggered. b Update, the updating method is to implement the training process of step S2 based on the training set of step S61.

8. An electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method according to any one of claims 1 to 7.

9. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.

10. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Large-scale data generation method, device and equipment

    CN119883657A

  • Multi-node secure communication method and system based on quantum key distribution

    CN120128524A

  • Multi-mode error information detection method and device

    CN120851146A