A bayesian network modeling method and device for disease outcome prediction

CN122599085APending Publication Date: 2026-08-18NANJING BRAIN HOSPITAL +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610729757.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-26
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0003]虽然现有贝叶斯网络技术已经为复杂医学问题建模提供了一定基础,但在网络结构如何合理生成、如何兼顾数据规律与临床逻辑、如何保证模型稳定性、以及如何形成可复用的模板体系等方面,仍然存在明显不足,尚不能很好满足复杂临床结局预测和系统化部署的需求

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122599085A_ABST
    Figure CN122599085A_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a kind of bayesian network modeling methods and devices for disease outcome prediction, the method includes: receiving clinical data and pre-processing;Around target outcome, programmatic screening is performed on candidate variables, forming candidate variable set.Afterwards, system node is divided into four layers according to the clinical time sequence relationship of variable, and direction constraint matrix directly called by structure learning algorithm is automatically generated.Based on constraint matrix, system calls multiple structure learning algorithms and score configuration to generate candidate network set, and then forms robust consensus template, performance priority template etc. by Bootstrap edge strength statistics, cross-configuration support rate statistics, cross-validation performance evaluation and directed ring check.This method truly combines clinical knowledge constraint and data-driven learning, avoids learning network that violates medical logic.The technology is no longer dependent on single algorithm, and finally obtains stable, reproducible and interpretable network structure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This solution relates to the field of medical technology, and in particular to a Bayesian network modeling method and apparatus for predicting disease outcomes. Background Technology

[0002] Stroke, especially hemorrhagic stroke, progresses rapidly, and outcomes are influenced by a multitude of factors, including baseline demographic characteristics, imaging findings, laboratory indicators, lifestyle factors, treatment interventions, and clinical phenotypic information at different levels. These factors are often not independent but exhibit clear hierarchical and interdependent relationships. For example, anatomical damage characteristics can affect clinical phenotype, which in turn influences short-term outcomes, while treatment factors can have varying degrees of influence on different outcomes. Therefore, expressing the complex relationships among these multiple factors and using this information to predict outcomes remains a key challenge in medical data analysis and clinical decision support.

[0003] Although existing Bayesian network technology has provided a certain foundation for modeling complex medical problems, there are still significant shortcomings in areas such as how to reasonably generate network structures, how to balance data patterns and clinical logic, how to ensure model stability, and how to form a reusable template system. These shortcomings cannot yet fully meet the needs of predicting complex clinical outcomes and systematic deployment. Summary of the Invention

[0004] This solution aims to at least address the technical problems existing in the prior art. To this end, the first aspect of this invention proposes a Bayesian network modeling method for disease outcome prediction, the method comprising: The raw clinical data of multiple individuals with the target disease are obtained, the raw clinical data are preprocessed, and binary outcome variables are generated for each patient according to the preset outcome determination rules. Using the outcome variable as the target, penalized regression screening and information gain screening are performed on the variables in the preprocessed data; the selected variables are subjected to association screening to remove redundant information, and combined with clinical knowledge, a set of candidate variables for modeling is determined. Based on clinical temporal or logical relationships, the variables in the candidate variable set are divided into exogenous variables, first-level variables, second-level variables, or third-level variables; wherein, the random grouping variable is designated as the exogenous variable, the variable characterizing baseline exposure and individual characteristics is designated as the first-level variable, the variable characterizing disease severity, imaging features, or intermediate phenotype is designated as the second-level variable, and the outcome variable is designated as the third-level variable; Based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables, a blacklist constraint matrix is ​​generated. The blacklist constraint matrix is ​​used to prohibit the occurrence of arcs in a specific direction; the arc is a directed connection between variables. Based on the candidate variable set and the blacklist constraint matrix, structure learning is performed using various preset configuration schemes to generate a candidate network set; wherein, each configuration scheme uniquely specifies a structure learning method, the parameter settings corresponding to the structure learning method, and the blacklist constraint matrix; For each of the configuration schemes, the predictive performance of the learned network structure on the outcome variable is evaluated by cross-validation. The configuration scheme with the best predictive performance is selected, and the network is refitted using all variables and the best-performing configuration scheme to obtain a directed acyclic graph as a performance-priority template. For each of the configuration schemes, the Bootstrap resampling technique is used to repeatedly draw samples with replacement from the original data. A candidate network structure is learned on each sample, and the frequency of each possible arc learned in all Bootstrap samples is counted as the strength of the arc under the configuration scheme. For each configuration scheme, only arcs with a strength not lower than a preset strength threshold are retained to obtain candidate arcs; all candidate arcs are aggregated, and the cross-configuration support rate, average strength, and direction probability are calculated for each candidate arc; all candidate arcs are sorted in descending order of priority based on the support rate, average strength, and direction probability to obtain a sorting result; starting from an empty graph, arcs are added one by one according to the sorting result, and directed cycle checks are performed, adding only arcs that will not form directed cycles, finally obtaining a directed acyclic graph as a robust consensus template; the empty graph refers to an initial directed acyclic graph that contains all involved nodes, but there are currently no arcs connecting the nodes; At least the robust consensus template and the performance-priority template are output as selectable Bayesian network structure templates; Based on the Bayesian structure template, holistic scenario inference and individualized prediction are performed on individual samples.

[0005] Optionally, the penalized regression screening includes: constructing a design matrix for the outcome variables, and running Lasso regression and Elastic Net regression respectively; for each variable, aggregating all the dummy variable coefficients to obtain the total contribution value of the variable, and marking the variable as selected if any of its contribution values ​​is non-zero; The information gain screening includes: calculating the entropy of the outcome variable itself to obtain the initial uncertainty entropy; introducing a variable and calculating the conditional entropy under the condition that the value of the variable is known to obtain the residual uncertainty entropy; taking the difference between the initial uncertainty entropy and the residual uncertainty entropy to obtain the information gain, and calculating the standardized information gain; sorting all variables from largest to smallest according to the standardized information gain, and marking the top N variables as selected. The association screening includes: determining the type of any two variables; if both variables are numerical, calculating the Spearman correlation coefficient; if both variables are categorical, calculating Cramer's V coefficient; if one variable is numerical and the other is categorical, calculating the Eta correlation ratio; when the calculated correlation coefficient is greater than a preset threshold, marking the two variables as an information redundancy pair and marking one of the two variables as to be removed. The process of combining clinical knowledge to determine the set of candidate variables for modeling includes: A variable is retained in the candidate variable set if and only if it satisfies at least one of the following conditions: The variables mentioned have been shown to be associated with prognosis in existing studies of hemorrhagic stroke, or have been deemed clinically important by experts. The variable is marked as selected in at least one of the penalized regression screening and information gain screening methods; The variable does not have a high degree of information overlap with the variables ranked higher and has not been marked for removal, meaning that its correlation coefficient with any of the selected variables is lower than the coefficient threshold.

[0006] Optionally, generating the blacklist constraint matrix based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables includes: Based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables, a two-column table is generated, with the first column named "from" and the second column named "to". Each row in the two columns represents a forbidden directed arc, where the "from" column records the starting variable of the arc and the "to" column records the ending variable of the arc. The direction of the directed arc is from the starting variable to the ending variable. Convert the two lists into a directed edge list matrix; According to the preset hierarchical prohibition rules, the directed edge list matrix is ​​expanded by Cartesian product to generate the blacklist constraint matrix; the hierarchical prohibition rules include: prohibiting any variable from pointing to the exogenous variable, prohibiting the second-level variable from pointing to the first-level variable, and prohibiting the third-level variable from pointing to the first-level variable or the second-level variable.

[0007] Optionally, the direction probability is calculated for each of the candidate arcs, including: For a node pair A and B that are connected, the proportion of samples with the direction "A→B" in all Bootstrap samples that support the connection is used as the probability of the direction "A→B".

[0008] Optionally, evaluating the predictive performance of the learned network structure on the outcome variable through cross-validation includes: The predictive performance of the learned network structure on the outcome variable was evaluated by five-fold cross-validation, and the evaluation metrics for the five-fold cross-validation included: average AUC and average Brier score. The selection of the configuration scheme with the best prediction performance includes: The configuration scheme with the highest average AUC value is selected first. If the average AUC values ​​are the same, the configuration scheme with the lowest average Brier score is selected. If the average AUC value and the average Brier score are the same, the configuration scheme with the fewest edges in the learned network structure is selected.

[0009] Optionally, after obtaining a directed acyclic graph as a performance-priority template, the following are also included: Using the performance-priority template as the initial network, extract all arcs and sort them from low to high intensity; Try deleting one arc at a time, and then perform cross-validation evaluation on the new network after the deletion; If the average AUC of the new network is not lower than 98% of the average AUC of the performance-priority template, and the average Brier of the new network is not higher than 101% of the average Brier of the performance-priority template, then the candidate arc is permanently deleted; otherwise, the candidate arc is restored; repeat this process until no arc can be deleted, obtain the minimum structure template, and output the directed acyclic graph of the minimum structure template.

[0010] Optionally, after obtaining a directed acyclic graph as a performance-priority template, the following are also included: Using the performance-first template as the base network, the robust consensus template generation function is called to obtain the candidate arc set explored by it, which serves as a scalable arc pool; Each existing arc and its reverse arc in the basic network are marked as a prohibited node pair. The arcs corresponding to the prohibited node pairs are removed from the scalable arc pool to obtain the remaining candidate arc set. According to the priority order of the support rate, the average strength, and the direction probability from high to low, each candidate arc in the remaining candidate arc set is sorted to obtain the sorting result; According to the sorting results, candidate arcs are added to the base network one by one. For each candidate arc, it is checked whether adding the candidate arc will form a directed cycle in the current network. If no directed cycle is formed, five-fold cross-validation is performed on the new network after adding the candidate arc to calculate the average AUC and average Brier score of the new network. If the average AUC of the new network is not lower than the average AUC of the base network minus a first tolerance threshold, and the average Brier score of the new network is not higher than the average Brier score of the base network plus a second tolerance threshold, then the candidate arc is accepted and permanently added to the network; otherwise, the candidate arc is abandoned. After traversing all candidate arcs, the maximum structure template is obtained, and the directed acyclic graph of the maximum structure template is output.

[0011] Optionally, after determining the set of candidate variables for modeling by incorporating clinical knowledge, the process may also include: For the variables in the candidate variable set, calculate the correlation coefficient between each variable; When the correlation coefficient between two variables is greater than a preset threshold, one of the variables is removed. Specifically, this includes: when the correlation coefficient between the baseline Rankin score and the baseline Glasgow prognostic score is greater than a preset threshold, the baseline Rankin score is removed; when the correlation coefficient between the stroke diagnosis score and the baseline Glasgow prognostic score is greater than a preset threshold, the stroke diagnosis score is removed; the baseline Rankin score, the baseline Glasgow prognostic score, and the stroke diagnosis score are variables in the candidate variable set. Based on the variables remaining after elimination, consensus templates and performance-priority templates were generated sequentially, with comprehensive efficacy and Glasgow Outcome Score as the target outcomes, respectively. Based on literature evidence and expert experience, the consensus template and performance-priority template were reviewed and approved, resulting in a directed acyclic graph consisting of seven core nodes, which serves as a medical knowledge template.

[0012] Optionally, after outputting at least the robust consensus template and the performance-priority template as alternative Bayesian network structure templates, the method further includes: Based on the Bayesian network structure and the preprocessed data, for each node in the Bayesian network structure, the conditional probability distribution of the node under different combinations of states of all its parent nodes is estimated, and a conditional probability table corresponding to the node is generated; the conditional probability table is used to characterize: when the set of parent nodes of the node takes a specific combination of states, the conditional probability value of the node takes each possible state. Output a full network conditional probability table containing conditional probability tables for all nodes.

[0013] A second aspect of this invention provides a Bayesian network modeling device for disease outcome prediction, the device comprising: The data acquisition module is used to acquire raw clinical data from multiple individuals suffering from the target disease, perform preprocessing on the raw clinical data, and generate binary outcome variables for each patient according to preset outcome determination rules. The screening module is used to perform penalized regression screening and information gain screening on the variables in the preprocessed data with the outcome variable as the target; to perform association screening on the selected variables, remove redundant information, and determine the candidate variable set for modeling by combining clinical knowledge; The variable designation module is used to divide the variables in the candidate variable set into exogenous variables, first-level variables, second-level variables, or third-level variables according to clinical time sequence relationships or clinical logical relationships; wherein, the random grouping variable is designated as the exogenous variable, the variable characterizing baseline exposure and individual characteristics is designated as the first-level variable, the variable characterizing disease severity, imaging features, or intermediate phenotype is designated as the second-level variable, and the outcome variable is designated as the third-level variable; The constraint matrix generation module is used to generate a blacklist constraint matrix based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables. The blacklist constraint matrix is ​​used to prohibit the occurrence of arcs in a specific direction; the arc is a directed connection between variables. The structure learning module is used to perform structure learning based on the candidate variable set and the blacklist constraint matrix, using multiple preset configuration schemes to generate a candidate network set; wherein, each configuration scheme uniquely specifies a structure learning method, the parameter settings corresponding to the structure learning method, and the blacklist constraint matrix; The performance-priority template generation module is used to evaluate the predictive performance of the learned network structure on the outcome variable for each configuration scheme through cross-validation, select the configuration scheme with the best predictive performance, and refit the network using all variables and the best-performing configuration scheme to obtain a directed acyclic graph as the performance-priority template. The extraction module is used to repeatedly extract samples with replacement from the original data for each configuration scheme using Bootstrap resampling technology, learn a candidate network structure on each sample, and count the frequency of each possible arc learned in all Bootstrap samples as the intensity of the arc under the configuration scheme. A robust consensus template generation module is used to, for each configuration scheme, retain only arcs with a strength not lower than a preset strength threshold to obtain candidate arcs; summarize all candidate arcs and calculate the cross-configuration support rate, average strength, and direction probability for each candidate arc; sort all candidate arcs according to the priority order of the support rate, average strength, and direction probability from high to low to obtain a sorting result; starting from an empty graph, try to add arcs one by one according to the sorting result and perform directed cycle checks, only adding arcs that will not form directed cycles, and finally obtain a directed acyclic graph as a robust consensus template; the empty graph refers to an initial directed acyclic graph that has contained all the involved nodes, but there are no arcs connecting the nodes for the time being; The output module is used to output at least the robust consensus template and the performance-priority template as selectable Bayesian network structure templates. The prediction module is used to perform overall scenario inference and individual prediction on individual samples based on the Bayesian structure template.

[0014] A third aspect of the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by the processor to implement the Bayesian network modeling method for disease outcome prediction as described in the first aspect.

[0015] A fourth aspect of the present invention provides a computer-readable storage medium storing at least one instruction, at least one program, a code set, or an instruction set, wherein the at least one instruction, the at least one program, the code set, or the instruction set is loaded and executed by a processor to implement the Bayesian network modeling method for disease outcome prediction as described in the first aspect.

[0016] The embodiments of the present invention have the following beneficial effects: The Bayesian network modeling method for disease outcome prediction provided in this invention first receives clinical data collected according to a preset research protocol and performs standardization, missing data handling, discretization, and outcome construction on the raw data. Then, it performs a procedural screening of candidate variables around the target outcome, forming a candidate variable set. Next, the system divides the nodes into four layers based on the clinical temporal relationships of the variables and automatically generates a directional constraint matrix that can be directly invoked by the structure learning algorithm. Based on the constraint matrix, the system invokes various structure learning algorithms and scoring configurations to generate a candidate network set. Then, through Bootstrap edge strength statistics, cross-configuration support rate statistics, cross-validation performance evaluation, and directed cycle checking, it automatically forms robust consensus templates, performance-priority templates, etc. This method truly combines clinical knowledge constraints and data-driven learning, first performing a procedural screening of pre-treatment variables, and then writing the clinical causal relationships of the disease into executable structural constraints, avoiding the learning of networks that violate medical logic. This technology no longer relies on a single algorithm, but integrates the learning results of multiple structures such as hc, tabu, mmhc, gs, and iamb, and combines Bootstrap edge strength, cross-configuration occurrence rate, conditional independence verification, and performance indicators such as AUC / Brier to retain, reduce, and supplement edges, ultimately obtaining a stable, reproducible, and interpretable network structure. Attached Figure Description

[0017] Figure 1 A flowchart illustrating the steps of a Bayesian network modeling method for disease outcome prediction provided in this embodiment of the invention; Figure 2 This is a structural block diagram of a Bayesian network modeling device for disease outcome prediction provided in an embodiment of the present invention. Detailed Implementation

[0018] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present solution, and not all embodiments. Based on the embodiments of the present solution, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present solution.

[0019] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of this disclosure, unless otherwise stated, "a plurality of" means two or more. Furthermore, the use of "based on" or "according to" implies openness and inclusiveness, because processes, steps, calculations, or other actions "based on" or "according to" one or more of the stated conditions or values ​​may in practice be based on additional conditions or beyond the stated values.

[0020] During their research, the inventors discovered that common outcome prediction methods primarily include traditional regression models, machine learning prediction models, and Bayesian network models. Traditional regression models, such as Logistic regression, typically estimate risk by pre-defining the functional relationship between independent and outcome variables. While these methods offer advantages such as clear form and easily interpretable results, they struggle to simultaneously express multi-level dependencies between variables and are not conducive to a holistic presentation of intermediate phenotypes, path relationships, and conditional inference processes. When clinical problems possess a clear hierarchical structure, these methods often require the construction of additional interaction terms or hierarchical analysis, resulting in high modeling complexity and limited expressive power. Machine learning models, such as ensemble learning models and neural network models, generally offer advantages in predictive performance, capable of handling nonlinear relationships and high-dimensional variable inputs. These methods tend to prioritize predictive accuracy but lack interpretability in expressing relationships between variables; the model's inference process is a "black box" and not intuitive. In clinical applications, especially when it's necessary to explain why a prediction result was generated and which factors influence the outcome through which pathways, these models exhibit significant limitations. Furthermore, different machine learning models produce significantly different results on different datasets, making it difficult to directly convert them into knowledge structures that are easy to review and reuse.

[0021] Another type of technology uses Bayesian networks for disease outcome prediction or clinical decision support. This type of technology describes the conditional dependencies between variables using directed acyclic graphs and combines them with conditional probability tables for inference and prediction, possessing both probabilistic expressiveness and interpretability. Formally, Bayesian networks are better suited than traditional regression models for expressing hierarchical dependencies in complex systems and are easier to interpret clinically than typical black-box machine learning models. They are currently used in some disease risk assessment, prognosis, and decision support scenarios. However, existing Bayesian network modeling techniques still have significant shortcomings in exploring the crucial aspect of network structure. First, in existing technologies, determining the network structure typically follows two paths: one is fully data-driven automated structure learning, and the other is entirely manual specification of the network structure based on expert experience. The former has a higher degree of automation, but often results in inconsistencies with clinical temporal relationships, conflicts with medical common sense, or difficult-to-interpret connections. This leads to networks that, while statistically fit the data, lack sufficient clinical rationality in application. While the latter approach can ensure a certain level of professional knowledge integration, it heavily relies on the experience of individual experts, is highly subjective, and struggles to establish a unified, verifiable, and transferable modeling process. Furthermore, existing technologies typically lack a complete technical process that organically integrates prior constraints, variable selection, structure learning, stability testing, and edge selection. In actual modeling, it often simply involves calling a particular structure learning algorithm to generate a network, or making empirical modifications after obtaining the initial network. Existing technologies lack clear and repeatable technical rules regarding whether edges should be retained, whether certain edges are merely due to data perturbations, and how to determine inconsistencies between different algorithms. This results in insufficient stability of the final network structure, leading to fluctuations in results during repeated modeling and hindering subsequent standardized deployment.

[0022] Therefore, although existing Bayesian network technology has provided a certain foundation for modeling complex medical problems, there are still significant shortcomings in areas such as how to reasonably generate network structures, how to balance data patterns and clinical logic, how to ensure model stability, and how to form a reusable template system. It cannot yet fully meet the needs of predicting complex clinical outcomes and systematic deployment.

[0023] To address the aforementioned shortcomings, a Bayesian network structure template modeling method and software implementation for predicting hemorrhagic stroke outcomes was developed. This method truly combines clinical knowledge constraints and data-driven learning. First, pre-treatment variables are procedurally screened. Then, the clinical causal relationships of hemorrhagic stroke (such as the hierarchical relationships between variables like treatment group, bleeding site, hematoma volume, syndrome type, and outcome) are written as executable structural constraints, avoiding the learning of networks that violate medical logic. This technique no longer relies on a single algorithm but integrates the results of multiple structure learning methods, including hc, tabu, mmhc, gs, and iamb, and combines Bootstrap edge strength, cross-configuration occurrence rate, conditional independence verification, and performance metrics such as AUC / Brier to retain, reduce, and supplement edges, ultimately obtaining a stable, reproducible, and interpretable network structure.

[0024] The key feature of this invention is that the final output is not a one-time model, but rather five directly callable recommended templates: the "expert knowledge template" is the core and the only static template; the other four are dynamic templates, used to satisfy different modeling requirements such as robustness priority, performance priority, minimum structure, and maximum structure. Thus, the application of Bayesian networks in hemorrhagic stroke and related clinical prediction problems changes from requiring ad-hoc modeling each time and applying the model only to a single dataset, to using a standardized, reusable, generalizable template library for direct deployment in software. In summary, the core technical problem solved by this invention is: how to establish a Bayesian network modeling method and system for hemorrhagic stroke, a disease scenario with a clear clinical hierarchy, using expert knowledge templates as the core, multiple dynamic templates as extensions, and considering clinical rationality, statistical stability, and engineering usability.

[0025] Figure 1 A flowchart illustrating the steps of a Bayesian network modeling method for disease outcome prediction provided in an embodiment of the present invention.

[0026] like Figure 1 As shown, the method includes the following steps: Step 101: Obtain raw clinical data from multiple individuals with the target disease, perform preprocessing on the raw clinical data, and generate binary outcome variables for each patient according to preset outcome determination rules.

[0027] Multiple individuals suffering from a target disease refers to a collection of individuals suffering from the same disease. The target disease can be one of the diseases whose outcome is influenced by multiple factors and whose variables have hierarchical or temporal dependencies, such as acute hemorrhagic stroke, pneumonia, liver cancer, and breast cancer.

[0028] This invention takes the actual scenario of a clinical trial of the blood-cooling and stasis-removing formula for treating acute hemorrhagic stroke as an example, that is, the target disease is acute hemorrhagic stroke.

[0029] First, raw clinical data needs to be collected according to the pre-established research protocol, including baseline variables before treatment, randomization information, laboratory tests, imaging, TCM syndromes, and outcome variables on day 21 after admission. The system will read the uploaded data file and identify its data objects. The system supports formats such as csv, txt, xlsx, xls, rds, and rdata. After reading, the system will perform variable naming standardization, converting original variable names into legal and unique program variable names when necessary. Simultaneously, it can automatically derive the necessary intermediate variables based on the original fields for structure learning. For example, the code will automatically generate `bleed_site` based on variables related to the bleeding site and encode it as a three-category variable of "basal ganglia / brainstem / other". Subsequently, the system will generate data overview information, including sample size, number of variables, number of missing units, number of candidate outcome variables, variable type, number of missing values, number of unique values, and level preview. This step will yield a standardized dataset.

[0030] The standardized data table obtained from the aforementioned steps is then preprocessed.

[0031] For the outcome, discretization is performed based on preset rules to generate binary outcome variables for each patient.

[0032] As an optional embodiment, the preprocessing of the raw clinical data includes: Step 1011: Determine the missing rate of the original clinical data other than the outcome variable, and impute the data with a missing rate of less than 20% to obtain complete clinical data; Step 1012: Classify the complete clinical data according to variable type to obtain factor variables, numerical variables, character variables, logical variables, and outcome variables, and discretize each variable according to the variable type.

[0033] In steps 1011-1012, for clinical data other than outcome variables, predictor variables with a missing rate of less than 20% are imputed using bagged trees, while missing outcome variables are not imputed. Then, the variables are discretized according to their type.

[0034] As an optional embodiment, the outcome variables include the Glasgow Outcome Score improvement outcome variable and the overall efficacy improvement outcome variable. Step 1012 involves discretizing each variable according to its type, including: Step 10121: For the factor variable, check its number of levels and remove empty levels; Step 10122: For the character type variable or logical type variable, convert it to factor type; Step 10123: For the numerical variables, convert them into ordinal categorical variables according to the quartiles; Step 10124: For the Glasgow Prognostic Score improvement outcome variable, a sliding discrete rule is used for binary classification transformation: if the patient's baseline score is good prognosis and maintains that level after 21 days, or the baseline score is moderate disability or worse and improves by at least one level after 21 days, it is judged as "improved"; otherwise, it is "no improvement". Step 10125: For the comprehensive efficacy improvement outcome variable, calculate the improvement rate R according to the preset standard. R ≥ 56% is judged as "improvement", otherwise it is "no improvement".

[0035] In steps 10121-10125, for variables already in factor form, their actual number of levels needs to be checked and empty levels containing no observations removed to avoid meaningless categories in the model. Character or logistic variables are uniformly converted to factor form for subsequent grouping or statistical modeling. Numerical variables are discretized by binning according to quartiles (i.e., divided into four groups, this parameter is adjustable), thus converting continuous variables into ordinal factors. After this processing, all variables are uniformly factor-type, facilitating direct use for analysis or modeling.

[0036] For the outcome variable, discretization is performed based on the following rules: (1) For Glasgow prognostic score outcome variables, a sliding discrete rule was used for binary classification transformation. That is, if the patient’s baseline score level is good prognosis and the level is maintained after 21 days, it is considered an improvement; if the baseline is moderate disability or worse and the level improves by at least one grade after 21 days, it is considered an improvement; otherwise, it is considered no improvement.

[0037] (2) For the overall efficacy improvement outcome variable, the improvement rate R is calculated according to the "Diagnosis and Efficacy Evaluation Criteria for Stroke". Then, it is divided into two categories: categories 1 and 2 are counted as improvement, and categories 3-6 are counted as no improvement. This step will yield the processed candidate dataset.

[0038] The improvement rate was evaluated according to national standards. The improvement rate (R) was calculated as: (pre-treatment score - post-treatment score) / pre-treatment score.

[0039] The standard categorizes overall clinical efficacy into six classes based on the improvement rate (R): (1) Basic recovery: R ≥ 81%, P ≤ 6; (2) Significant improvement: 56% ≤ R < 81%; (3) Moderate improvement: 36% ≤ R < 56%; (4) Slight improvement: 11% ≤ R < 36%; (5) No change: 0 ≤ R < 11%; (6) Worsening (including death): R < 0. In this study, for the sake of conservatism, we divided the above six outcomes into two categories, where (1) and (2) are defined as improved prognosis, and (3)-(6) are defined as no improved prognosis.

[0040] Step 102: Using the outcome variable as the target, perform penalized regression screening and information gain screening on the variables in the preprocessed data; perform association screening on the associations between candidate variables, and combine clinical knowledge to determine the set of candidate variables for modeling.

[0041] Based on the preprocessed dataset, the system performs three types of variable screening with the two pre-set outcomes of the aforementioned process as the target: penalized regression screening, information gain screening, and association screening.

[0042] This step yields a set of candidate variables for modeling.

[0043] As an optional embodiment, the penalized regression screening includes: constructing a design matrix for the outcome variable, and running Lasso regression and Elastic Net regression respectively; if any of its contribution values ​​is non-zero, then the variable is marked as selected; The information gain screening includes: calculating the entropy of the outcome variable itself to obtain the initial uncertainty entropy; introducing a certain variable and calculating the conditional entropy under the condition that the value of the variable is known to obtain the residual uncertainty entropy; taking the difference between the initial uncertainty entropy and the residual uncertainty entropy to obtain the information gain, and calculating the standardized information gain; sorting all variables from largest to smallest according to the standardized information gain, and marking the top N variables as selected. The association screening includes: determining the type of any two variables; if both variables are numerical, calculating the Spearman correlation coefficient; if both variables are categorical, calculating Cramer's V coefficient; if one variable is numerical and the other is categorical, calculating the Eta correlation ratio; when the calculated correlation coefficient is greater than a preset threshold, marking the two variables as an information redundancy pair and marking one of the two variables as to be removed. The process of combining clinical knowledge to determine the set of candidate variables for modeling includes: A variable is retained in the candidate variable set if and only if it satisfies at least one of the following conditions: The variables mentioned have been shown to be associated with prognosis in existing studies of hemorrhagic stroke, or have been deemed clinically important by experts. The variable is marked as selected in at least one of the penalized regression screening or information gain screening methods; The variable does not have a high degree of information overlap with the variables ranked higher and has not been marked for removal, meaning that its correlation coefficient with any of the selected variables is lower than the coefficient threshold.

[0044] Step 103: Based on clinical temporal relationships or clinical logical relationships, divide the variables in the candidate variable set into exogenous variables, first-level variables, second-level variables, or third-level variables; wherein, the random grouping variable is designated as the exogenous variable, the variable characterizing baseline exposure and individual characteristics is designated as the first-level variable, the variable characterizing disease severity, imaging features, or intermediate phenotype is designated as the second-level variable, and the outcome variable is designated as the third-level variable.

[0045] Based on the candidate variable set generated by the aforementioned steps, each variable is divided into exogenous variables, first-level variables, second-level variables, and third-level variables according to clinical time sequence or clinical logic.

[0046] The first-level variables represent baseline exposure and individual characteristics; the second-level variables represent disease severity, radiological features, or intermediate phenotypes; and the third-level variables represent clinical outcomes. The randomization variable is designated as an exogenous variable.

[0047] There were two groups in total, and the study data came from a randomized controlled trial. Patients were randomly assigned to two predefined groups on the random number table in a 1:1 ratio before enrollment, and then the subjects were assigned to the two groups on the table in the order of enrollment.

[0048] Step 104: Based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables, generate a blacklist constraint matrix. The blacklist constraint matrix is ​​used to prohibit the occurrence of arcs in a specific direction, where the arc is a directed connection between variables.

[0049] The rules for generating the blacklist constraint matrix are as follows: Any variable is prohibited from pointing to the exogenous variable, the second-level variable is prohibited from pointing to the first-level variable, and the third-level variable is prohibited from pointing to either the first-level variable or the second-level variable.

[0050] Simultaneously, the system allows additional blacklist text to be input and merged with the automatically generated time-level blacklist to form the set of directional constraints used in the structure learning phase. This step will generate the blacklist constraint matrix required for structure learning.

[0051] The blacklist constraint matrix is ​​used to prohibit arcs in a specific direction. Here, "arc" refers to a directed edge, that is, a directed connection from one node to another. For example, "treatment group → GOS ending" is an arc. If the direction is ignored and only whether two nodes are connected is considered, they are called a node pair.

[0052] As an optional embodiment, generating the blacklist constraint matrix based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables includes: Step 1041: Based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables, generate a two-column table, where the first column of the two-column table is named "from" and the second column is named "to". Step 1042: Each row in the two columns represents a prohibited directed arc, where the "from" column records the starting point variable of the arc and the "to" column records the ending point variable of the arc. The direction of the directed arc is from the starting point variable to the ending point variable. Step 1043: Convert the two lists into a directed edge list matrix; Step 1044: According to the preset hierarchical prohibition rules, perform Cartesian product expansion on the directed edge list matrix to generate the blacklist constraint matrix; the hierarchical prohibition rules include: prohibiting any variable from pointing to the exogenous variable, prohibiting the second-level variable from pointing to the first-level variable, and prohibiting the third-level variable from pointing to the first-level variable or the second-level variable.

[0053] In steps 1041-1044, a two-column table is generated based on the variables corresponding to the hierarchical relationship, with columns named "from" and "to". Each row in the table represents a directed arc, i.e., from→to. The system then converts this two-column table into a directed edge list matrix, and then expands it using a Cartesian product according to the hierarchical prohibition rules to generate a blacklist constraint matrix.

[0054] In addition, a whitelist constraint matrix can be generated, and the generation method is similar to that of a blacklist constraint matrix.

[0055] Step 105: Based on the candidate variable set and the blacklist constraint matrix, perform structure learning using multiple preset configuration schemes to generate a candidate network set; wherein, each configuration scheme uniquely specifies a structure learning method, the parameter settings corresponding to the structure learning method, and the blacklist constraint matrix.

[0056] Based on the aforementioned candidate variable set and structural constraint matrix, multiple configuration schemes are invoked for structure learning to generate a candidate network set. Each configuration scheme refers to a structure learning approach used to generate the network graph, including a structure learning method, a corresponding scoring-driven algorithm or testing rule, and a blacklist constraint matrix. For example, hc+BIC, tabu+AIC, mmhc+BDe, gs+mutual information test, and iamb+mutual information test are all different configurations. Each configuration independently performs structure learning under the same candidate variable set and the same structural constraint matrix, and further obtains the intensity results of each arc under that configuration through repeated sampling via bootstrap.

[0057] The scoring-driven algorithm can use AIC, BIC, or BDe scoring-driven algorithms.

[0058] Step 106: For each configuration scheme, evaluate the predictive performance of the learned network structure on the outcome variable through cross-validation, select the configuration scheme with the best predictive performance, and refit the network using all variables and the best-performing configuration scheme to obtain a directed acyclic graph as a performance-priority template.

[0059] Based on the aforementioned candidate variable set and structural constraint matrix, the network with the best prediction performance for the specified target outcome is selected from the configuration schemes. Specifically, cross-validation is performed once for each configuration scheme, and the configuration scheme with the best prediction performance is selected.

[0060] After selecting the configuration scheme, refit the network with all the data and the configuration scheme to obtain the final performance-priority template. As an optional embodiment, evaluating the predictive performance of the learned network structure on the outcome variable through cross-validation includes: The predictive performance of the learned network structure on the outcome variable was evaluated by five-fold cross-validation, and the evaluation metrics for the five-fold cross-validation included: average AUC and average Brier score. As an optional embodiment, selecting the configuration scheme with optimal prediction performance includes: The configuration scheme with the highest average AUC value is selected first. If the average AUC values ​​are the same, the configuration scheme with the lowest average Brier score is selected. If the average AUC value and the average Brier score are the same, the configuration scheme with the fewest edges in the learned network structure is selected.

[0061] Specifically, a five-fold cross-validation is performed for each candidate structure configuration, and in each fold, a Bayesian network is refitted on the training set, and the probability of the target outcome being a positive event is predicted on the validation set.

[0062] In the five-fold cross-validation, the predicted probability of the target outcome being a positive event (improvement) is calculated for each patient in each validation fold. A probability >= 0.5 is considered positive, and a probability < 0.5 is considered negative. The predicted probability is then compared with the actual outcome to calculate the AUC and Brier score for each fold.

[0063] Then, the average AUC, average Brier score, and number of edges for each candidate network architecture configuration are summarized. Finally, the configurations are sorted in the following order: higher average AUC, lower average Brier score, and fewer edges, to select the best configuration. After selecting the configuration, the network is refitted with all data using the same configuration to obtain the final performance-priority template. Step 107: For each configuration scheme, Bootstrap resampling technique is used to repeatedly draw samples with replacement from the original data. A candidate network structure is learned on each sample, and the frequency of each possible arc learned in all Bootstrap samples is counted as the intensity of the arc under the configuration scheme.

[0064] The system uses the bootstrap algorithm to learn the arc strength. If the strength is greater than 0, structural strength estimation is performed after learning the initial network to obtain the selection frequency and direction probability of each edge. This step yields candidate network graphs under various algorithms and scoring configurations, as well as the arc strength information in each candidate network.

[0065] Specifically, 10,000 bootstrap resampling operations are performed. Each sampling algorithm is as follows: a sample is obtained by sampling with replacement from the original data; on this sample, a DAG (Directed Acyclic Graph) is learned using the same algorithm, the same scoring-driven algorithm or validation rules, and the same blacklist and whitelist; then, the presence and direction of each arc are recorded in each sampling result. Finally, all bootstrap results are summarized to obtain the frequency of each arc and the ratio of its two directions. The frequency of each arc is used as the strength of the candidate arc under this configuration scheme.

[0066] Step 108: For each configuration scheme, retain only arcs with a strength not lower than a preset strength threshold to obtain candidate arcs; summarize all candidate arcs and calculate the cross-configuration support rate, average strength, and direction probability for each candidate arc; sort all candidate arcs according to the priority order of the support rate, average strength, and direction probability from high to low to obtain the sorting result; starting from an empty graph, try to add arcs one by one according to the sorting result and perform directed cycle checks, only adding arcs that will not form directed cycles, and finally obtain a directed acyclic graph as a robust consensus template; the empty graph refers to an initial directed acyclic graph that has contained all the involved nodes, but there are no arcs connecting the nodes for the time being.

[0067] Based on the arc strength results and other information obtained from the aforementioned steps for each configuration, the system first performs a threshold filtering within each configuration. Specifically, for all arcs generated by that configuration, only arcs with an intensity not lower than a preset intensity threshold are retained to obtain candidate arcs; arcs with an intensity lower than the threshold are considered insufficiently supported under that configuration and are not included in subsequent consensus statistics. Specifically, the intensity threshold can be set to 0.6.

[0068] This results in a preliminary table of candidate arcs, where each row includes: the arc's starting point (from), ending point (to), intensity, direction probability, and the configuration from which the candidate arc comes.

[0069] Next, the system merges all candidate arc tables into a single master table and performs cross-configuration aggregation on identical arcs. During aggregation, the system first treats directed arcs as the basic objects; for example, it considers "hematoma volume → stroke type" and "stroke type → hematoma volume" as two different arcs. However, the system also records that these two arcs correspond to the same undirected node pair for subsequent handling of directional competition. Based on this, the system calculates the following statistics for each directed arc: (1) Number of cross-configuration support: This refers to how many different configuration schemes the directed arc is retained in. For example, if an arc satisfies "strength ≥ 0.6" in all 4 configuration schemes, then its number of cross-configuration support is 4. (2) Cross-configuration support rate: This refers to the number of times the candidate arc is supported across configurations divided by the total number of configuration schemes. For example, if there are 7 configuration schemes and an arc is retained by 4 configuration schemes, then its support rate is 4 / 7. The support rate reflects the consistency of the candidate arc under different algorithms or scoring rules. (3) Average strength: refers to the average boostrap strength of the candidate arc across all supporting configurations. For example, if an arc appears in four configurations with strengths of 0.8, 0.7, 0.5, and 0.6 respectively, its average strength is 0.65. The average strength reflects the overall stability of the candidate arc when it is supported.

[0070] (4) Directional probability: refers to the average directional probability of the candidate arc across all configurations that support it. The higher the directional probability, the more likely the node pair will form a connection in the current direction rather than the opposite direction. Based on the above summary, the system generates a comprehensive record for each candidate arc, thereby obtaining a candidate arc statistics table, including the start point, end point, cross-configuration support rate, average strength, and direction probability of each arc.

[0071] Since the same undirected node pair may simultaneously have two arcs in opposite directions, such as "A→B" or "B→A", the system also needs to filter the directions. Specifically, for the same pair of nodes, the overall support for both directions is compared, and the direction with stronger support is retained first.

[0072] After obtaining the aforementioned candidate arc statistics table, the system sorts all candidate arcs according to a preset priority. The sorting rules are as follows: first, the support rates are compared, with higher support rates taking precedence; if the support rates are the same, the average strength is compared, with higher average strength taking precedence; if the average strengths are still the same, the directional probabilities are compared, with higher directional probabilities taking precedence. After this sorting, the system obtains a list of candidate arcs arranged from strongest to weakest based on the comprehensive stability evidence.

[0073] Subsequently, the system constructs a graph by adding edges one by one, starting from an empty graph, based on the sorting result. An empty graph here refers to an initial directed acyclic graph that already contains all the nodes involved in this step, but there are currently no arcs connecting the nodes. The process of adding edges one by one involves the system, according to the aforementioned sorting result, starting with the highest-ranked candidate arc, and attempting to add it to the current graph sequentially. For each arc attempt, the system immediately checks: if adding the candidate arc will not form a directed cycle, then the candidate arc is retained; if adding it will form a directed cycle, then the candidate arc is discarded, and the system continues to check the next candidate arc. The formation of a directed cycle represents a closed path in the graph that returns to the original node along the direction of the arrow. Directed cycles violate the directed acyclic structure required by Bayesian networks and must therefore be prohibited.

[0074] Finally, this step yields a directed acyclic graph, named the robust consensus template; the system will also output the final list of arcs contained in the template.

[0075] The role of robust consensus templates is to extract the most stable, consistent, and directed acyclic structural relationships among different algorithms, scoring rules, and bootstrap resampling results, thereby providing a structural evidence basis for the construction of subsequent performance-priority templates, maximum structure templates, and medical knowledge templates.

[0076] As an optional embodiment, calculating the direction probability for each of the candidate arcs includes: For a node pair A and B that are connected, the proportion of samples with the direction "A→B" in all Bootstrap samples that support the connection is used as the probability of the direction "A→B".

[0077] Step 109: Output at least the robust consensus template and the performance-priority template as selectable Bayesian network structure templates.

[0078] Even automatically learned Bayesian network structures may contain a few statistically acceptable but clinically interpretable edges. Therefore, a rationality correction function has been added to the software. The system allows researchers to manually edit the current network, thereby manually reviewing the network structure and making clinically appropriate corrections. Corrections include adding, deleting, and reversing edges. After each edit, the program immediately checks whether the new structure forms a directed cycle; if a cycle is formed, the operation is not accepted. If the edit is valid, the system can refit the current network and update the visualization results.

[0079] Step 1010: Perform holistic scenario inference and individualized prediction on individual samples based on the Bayesian structure template.

[0080] Based on the aforementioned constructed and validated network structure, inferences can be made about the overall scenario or predictions can be made about a specific individual sample.

[0081] Scenario inference is used to analyze how the probability of a target outcome changes under certain clinical conditions. The system receives the target outcome, evidence variables, and their values ​​specified by the user. The target outcome here refers to the outcome node whose probability needs to be queried, such as the 21-day Glasgow prognostic score outcome or the overall efficacy improvement outcome; the evidence variables and their values ​​refer to the known conditions set by the user, such as: treatment group = treatment group, stroke syndrome type = stasis and heat type, etc. Subsequently, the system performs conditional probability queries on positive events of the target outcome based on the currently fitted Bayesian network. The positive event referred to here is the state of the research interest event predefined in the target outcome, such as "improvement". During the query, the system calculates two types of probabilities: (1) baseline probability: the marginal probability of the target positive event without any additional evidence conditions; (2) updated probability: the conditional probability of the target positive event after the evidence variables and their values ​​are given. For example, if the target outcome is Glasgow prognostic improvement, the baseline probability represents the probability that the overall Glasgow prognosis is improved; the updated probability represents the probability that the Glasgow prognosis is improved under the specified evidence conditions. The system further calculates: (1) absolute probability difference: updated probability minus baseline probability; (2) relative change: the ratio of absolute probability difference to baseline probability. This quantifies the increase or decrease in the probability of the target outcome caused by a specific clinical scenario relative to the overall baseline state. In terms of algorithm implementation, an approximate conditional probability query method based on likelihood weighting is used. The system performs repeated bootstrap resampling on the original data, relearns the parameters on each resampled data, and repeats the above probability query to obtain the bootstrap distribution of baseline probability, updated probability, absolute difference, and relative change, and finally outputs the interval estimates of each indicator.

[0082] Personalized prediction refers to comparing the change in the probability of the target outcome between a specific patient sample in an already entered dataset and the patient's "original state" and "state after local variable modification," while keeping the network structure and parameters unchanged. The system first receives the sample number specified by the user, such as patient number 25. Then, the system retrieves a complete row of observations corresponding to that patient from the dataset used by the current model, forming the patient's original state record. This record includes all variables involved in the current model, such as treatment group, high-salt diet, bleeding site, and overall efficacy outcome. For example, suppose patient number 25's state in the original data is: treatment group = control group; high-salt diet = yes; bleeding site = basal ganglia. The system first reads these original values ​​as the patient's baseline state. Then, based on the current network structure, it automatically identifies the local variables most directly related to the target outcome. If, in the current network, the aforementioned three nodes are the direct parent nodes of the Glasgow Outcome Scale improvement, the system lists these three variables as modifiable variables. At this point, one or more items in the patient's original state can be changed to new values, forming a hypothetical scenario. For example, if the treatment group is changed from the control group to the treatment group, while other variables remain unchanged, the system inputs the patient's original state record and the modified state record after the local variables are changed into the same fitted Bayesian network object, and performs probability prediction on the target outcome. For the original state record, the system calculates the patient's original positive probability; for the modified state record, the system calculates the patient's updated positive probability; then, the difference between these two probabilities is calculated to reflect how the probability of the outcome changes under the change of local variables. This step can output the posterior probability of the outcome under different scenarios, the posterior distribution of unobserved nodes, and individualized prediction results.

[0083] This system supports exporting the results of each step and module, including the final deployment network, conditional probability tables, performance comparison results, prediction results, etc.

[0084] As an optional embodiment, after step 108, the method further includes: Step 201: Using the performance-priority template as the initial network, extract all arcs and sort them from low to high intensity; Step 202: Try deleting one arc at a time, and perform cross-validation evaluation on the new network after deletion; Step 203: If the average AUC of the new network is not lower than the average AUC of the performance-priority template minus the first tolerance threshold, and the average Brier of the new network is not higher than the average Brier of the performance-priority template plus the second tolerance threshold, then the candidate arc is permanently deleted; otherwise, the candidate arc is restored; repeat this process until no arc can be deleted, and the minimum structure template is obtained.

[0085] In steps 201-203, a minimum structure template is further constructed based on the aforementioned performance-priority template. The goal of this template is to remove as many edges as possible without sacrificing performance, making the network simpler and easier to interpret.

[0086] Based on the performance-first template, the average AUC and average Brier score of the performance-first template are extracted as the baseline AUC and baseline Brier score. All arcs in the current network are extracted and sorted from low to high edge strength.

[0087] Try deleting edges one by one: For each edge deleted, treat the resulting DAG (Directed Acyclic Graph) as a fixed structure and re-evaluate it in the five-fold cross-validation.

[0088] The first and second tolerance thresholds can be preset according to requirements. If the first tolerance threshold is set to 0.02 and the second tolerance threshold is set to 0.01, then if the average AUC after edge deletion is not lower than 98% of the baseline AUC and the average Bridging is not higher than 101% of the baseline Bridging, then the edge deletion is accepted; otherwise, the edge is restored. The system continuously repeats this process until no edge can be safely deleted. This step yields the minimum structure template.

[0089] In addition, we obtained a performance comparison before and after edge deletion (i.e., average AUC before edge deletion vs. average AUC after edge deletion; average Brier before edge deletion vs. average Brier after edge deletion) and the final number of edges deleted.

[0090] As an optional embodiment, after obtaining a directed acyclic graph as a performance-priority template, the method further includes: Step 301: Using the performance-first template as the base network, call the robust consensus template generation function to obtain the candidate arc set explored by it, which serves as a scalable arc pool; Step 302: Mark each existing arc and its reverse arc in the basic network as a prohibited node pair, remove the arcs corresponding to the prohibited node pairs from the scalable arc pool, and obtain the remaining candidate arc set; Step 303: Sort each candidate arc in the remaining candidate arc set according to the priority order of the support rate, the average strength, and the direction probability from high to low, and obtain the sorting result; Step 304: According to the sorting results, try adding candidate arcs to the base network one by one. For each candidate arc being tried: check whether adding the candidate arc will form a directed cycle in the current network; if no directed cycle is formed, perform five-fold cross-validation based on the new network after adding the candidate arc, and calculate the average AUC and average Brier score of the new network; if the average AUC of the new network is not lower than the average AUC of the base network minus the first tolerance threshold, and the average Brier score of the new network is not higher than the average Brier score of the base network plus the second tolerance threshold, then accept the candidate arc and permanently add it to the network; otherwise, abandon adding the candidate arc. Step 305: After traversing all candidate arcs, the maximum structure template is obtained, and the directed acyclic graph of the maximum structure template is output.

[0091] In steps 301-305, based on the aforementioned performance-priority template, a controlled expansion is performed to construct the maximum structure template. Its objective, unlike the minimum structure template, is to retain as many reliable structural relationships as possible within the performance tolerance range.

[0092] It still uses the performance-first template as a foundation, calls the robust consensus template generation function, and uses the candidate arc set explored therein as a scalable arc pool. Here, the candidate arc set refers to the aforementioned candidate arc statistics table, including the start point, end point, cross-configuration support rate, average strength, and direction probability of each arc.

[0093] Subsequently, existing arcs in the current network and their reverse arcs are listed as prohibited node pairs to avoid adding duplicate edges or edges that conflict with existing directions. The remaining candidate edges are sorted by support rate, strength, and direction probability, with the following sorting rules: first, support rates are compared, with higher support rates taking precedence; if support rates are the same, average strength is compared, with higher average strength taking precedence; if average strength is still the same, direction probability is compared, with higher direction probability taking precedence.

[0094] The program attempts to add arcs (i.e., edges) one by one. Each time an edge is added, it first checks for loops, then evaluates the new graph using five-fold cross-validation. If the AUC and Bridge after adding the edge are within the aforementioned tolerance range (average AUC not less than 0.02 of the baseline AUC, and average Bridge not more than 0.01 of the baseline Bridge), the edge is accepted; otherwise, it is not added. This gradual expansion yields the maximum structural template. This step provides the DAG of the maximum structural template, along with a performance comparison before and after edge addition and the final number of newly added edges.

[0095] As an optional embodiment, after step 102, the method further includes: Step 401: Calculate the correlation coefficients between the variables in the candidate variable set; Step 402: When the correlation coefficient between two variables is greater than a preset relationship threshold, one of the variables is removed; specifically, this includes: when the correlation coefficient between the baseline Rankin score and the baseline Glasgow prognostic score is greater than a preset coefficient threshold, the baseline Rankin score is removed; when the correlation coefficient between the stroke diagnosis score and the baseline Glasgow prognostic score is greater than a preset coefficient threshold, the stroke diagnosis score is removed; the baseline Rankin score, the baseline Glasgow prognostic score, and the stroke diagnosis score are variables in the candidate variable set; Step 403: Based on the variables remaining after elimination, take the overall efficacy and Glasgow Outcome Score as the target outcomes, and generate the document consensus template and performance-first template in sequence. Step 404: Based on comprehensive literature evidence and expert experience, the consensus template and performance priority template are reviewed and approved, and a directed acyclic graph consisting of seven core nodes is solidified as a medical knowledge template.

[0096] In steps 401-404, the variables in the candidate variable set include: stroke type, stroke diagnosis score, high-salt food, bleeding site, baseline Rankin score, treatment group, percentage of neutrophils, prothrombin time, age, baseline cerebral edema grade, high-density lipoprotein, family history, diastolic blood pressure, baseline Glasgow Outcome Scale score, and baseline hemorrhage volume.

[0097] Calculate the correlation coefficient between the two variables, and remove variables whose correlation coefficient between the baseline Rankin score and the baseline Glasgow Prognostic Score is greater than a preset threshold, as well as variables whose correlation coefficient between the stroke diagnosis score and the baseline Glasgow Prognostic Score is greater than a preset threshold. The preset threshold can be set to 0.6.

[0098] Based on the above variables, with the 21-day comprehensive efficacy and Glasgow prognostic score as the target outcomes, consensus documents and performance-priority templates were generated in sequence. By integrating literature evidence and expert experience, a DAG consisting of seven core nodes was solidified.

[0099] The seven core nodes include treatment group, high-salt diet, bleeding site, hematoma volume, stroke syndrome, TCM efficacy outcome, and Glasgow Outcome Score (GOS) outcome. The arc relationships are as follows: bleeding site → hematoma volume, hematoma volume → stroke syndrome, treatment group → TCM efficacy outcome, treatment group → GOS outcome, high-salt diet → GOS outcome, stroke syndrome → Glasgow Outcome Score.

[0100] This step, by summarizing the aforementioned steps, forms a fixed medical knowledge template that can be reused over a long period of time.

[0101] As an optional embodiment, after step 109, the method further includes: Step 501: Based on the Bayesian network structure and the preprocessed data, for each node in the Bayesian network structure, estimate the conditional probability distribution of the node under different combinations of states of all its parent nodes, and generate the conditional probability table corresponding to the node; the conditional probability table is used to characterize: when the set of parent nodes of the node takes a specific combination of states, the node takes the conditional probability value of each possible state. Step 502: Output the full network conditional probability table containing the conditional probability tables of all nodes.

[0102] In steps 501-502, parameter learning is performed based on the network structure determined in the preceding steps to estimate the conditional probability distribution of each node under different combinations of states of its parent node. The probability of a certain state occurring given that the nodes are already connected is calculated, and the conditional probability table for each node is obtained. This step outputs the conditional probability table for the entire network.

[0103] A conditional probability table is a probability distribution of different outcomes under different combinations of nodes. If a node has no parent node (no node points to it), its conditional probability table degenerates into the marginal probability distribution of that node itself.

[0104] This invention is a Bayesian network template-based modeling method for disease outcome prediction, executed by an electronic device. The method first receives clinical data collected according to a pre-defined research protocol and performs standardization, missing data handling, discretization, and outcome construction on the raw data. Then, it performs a procedural screening of candidate variables around the target outcome, forming a candidate variable set. Next, the system divides nodes into four layers based on the clinical temporal relationships of the variables and automatically generates a directional constraint matrix that can be directly invoked by structure learning algorithms. Based on the constraint matrix, the system invokes various structure learning algorithms and scoring configurations to generate a candidate network set. Then, through Bootstrap edge strength statistics, cross-configuration support rate statistics, cross-validation performance evaluation, and directed cycle checking, it automatically forms robust consensus templates, performance-priority templates, minimal structure templates, and maximum structure templates. The core network, after comprehensive review, is solidified as a medical knowledge template. Finally, this invention outputs a recommended template library consisting of one fixed template (medical knowledge template) and four dynamic templates (robust consensus template, performance-priority template, minimal structure template, and maximum structure template). The system can automatically or manually select one of the templates as the currently deployed network based on a preset objective function, performance indicators, or application scenario. It then performs parameter learning on the selected template to generate a conditional probability table for individualized prediction, scenario inference, and clinical decision support. The innovation of this method lies in constructing a reproducible, complete process from clinical constraints to multi-algorithm joint evaluation and finally to template library output.

[0105] Compared with the prior art, the present invention has at least the following beneficial effects: (1) This invention transforms clinical knowledge constraints from empirical verbal judgments into executable structural constraint rules. Specifically, by hierarchically dividing candidate variables and automatically generating blacklist constraints and optional whitelist constraints accordingly, the structural learning process is constrained by clinical temporal relationships and medical logic from the initial stage, thereby improving the interpretability and verifiability of the network structure.

[0106] (2) This invention does not rely on a single structure learning algorithm to generate the final network. Instead, it uses multiple structure learning algorithms, multiple scoring or testing configurations, and bootstrap resampling stability analysis to form arc support evidence across configurations. By comprehensively statistically analyzing the number of support events, support rate, strength, and direction probability of the arcs, it is possible to distinguish between stable structural relationships that recur under different configurations and low-stability relationships that only appear under a few configurations, thereby improving the robustness of the network structure results.

[0107] (3) This invention constructs a network template generation mechanism oriented towards different objectives, which can simultaneously take into account structural stability, prediction performance, network simplicity, and deployment convenience. Specifically, the robust consensus template is used to extract structural relationships with high consistency across algorithms, the performance-priority template is used to select the better-performing network structure under preset evaluation indicators, the minimum structure template is used to compress redundant connections within the performance tolerance range, the maximum structure template is used to retain more reliable relationships within the performance tolerance range, and the medical knowledge template is used to form a core network suitable for fixed implementation and standardized deployment. Thus, this invention transforms the Bayesian network construction process from a one-time analysis into a reusable template generation and invocation mechanism, improving the engineering implementation capability and application scalability of the method.

[0108] In summary, the Bayesian network modeling method for disease outcome prediction provided in this invention first receives clinical data collected according to a preset research protocol and performs standardization, missing data handling, discretization, and outcome construction on the raw data. Then, it performs a procedural screening of candidate variables around the target outcome, forming a candidate variable set. Next, the system divides the nodes into four layers based on the clinical temporal relationships of the variables and automatically generates a directional constraint matrix that can be directly invoked by the structure learning algorithm. Based on the constraint matrix, the system invokes various structure learning algorithms and scoring configurations to generate a candidate network set. Then, through Bootstrap edge strength statistics, cross-configuration support rate statistics, cross-validation performance evaluation, and directed cycle checking, it automatically forms robust consensus templates, performance-priority templates, etc. This method truly combines clinical knowledge constraints and data-driven learning, first performing a procedural screening of pre-treatment variables, and then writing the clinical causal relationships of the disease into executable structural constraints, avoiding the learning of networks that violate medical logic. This technique no longer relies on a single algorithm, but integrates the learning results of multiple structures such as hc, tabu, mmhc, gs, and iamb, and combines Bootstrap edge strength, cross-configuration occurrence rate, conditional independence verification, and performance indicators such as AUC / Brier to retain, reduce, and supplement edges, ultimately obtaining a stable, reproducible, and interpretable network structure.

[0109] Figure 2 This is a structural block diagram of a Bayesian network modeling device for disease outcome prediction provided in an embodiment of the present invention. Figure 2 As shown, the device 600 includes: The data acquisition module 601 is used to acquire raw clinical data of multiple individuals suffering from the target disease, perform preprocessing on the raw clinical data, and generate binary outcome variables for each patient according to preset outcome determination rules. The screening module 602 is used to perform penalized regression screening and information gain screening on the variables in the preprocessed data with the outcome variable as the target; to perform association screening on the selected variables, remove redundant information, and combine clinical knowledge to determine the set of candidate variables for modeling; The variable designation module 603 is used to divide the variables in the candidate variable set into exogenous variables, first-level variables, second-level variables, or third-level variables according to clinical time sequence relationships or clinical logical relationships; wherein, the random grouping variable is designated as the exogenous variable, the variable characterizing baseline exposure and individual characteristics is designated as the first-level variable, the variable characterizing disease severity, imaging characteristics, or intermediate phenotype is designated as the second-level variable, and the outcome variable is designated as the third-level variable; The constraint matrix generation module 604 is used to generate a blacklist constraint matrix based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables. The blacklist constraint matrix is ​​used to prohibit the occurrence of arcs in a specific direction; the arc is a directed connection between variables. The structure learning module 605 is used to perform structure learning based on the candidate variable set and the blacklist constraint matrix, using a variety of preset configuration schemes to generate a candidate network set; wherein, each configuration scheme uniquely specifies a structure learning method, the parameter settings corresponding to the method, and the blacklist constraint matrix; The performance-priority template generation module 606 is used to evaluate the predictive performance of the learned network structure on the outcome variable for each configuration scheme through cross-validation, select the configuration scheme with the best predictive performance, and refit the network using all variables and the best-performing configuration scheme to obtain a directed acyclic graph as a performance-priority template. The extraction module 607 is used to repeatedly extract samples with replacement from the original data for each configuration scheme using Bootstrap resampling technology, learn a candidate network structure on each sample, and count the frequency of each possible arc learned in all Bootstrap samples as the intensity of the arc under the configuration scheme. The robust consensus template generation module 608 is used to, for each configuration scheme, retain only arcs with a strength not lower than a preset strength threshold to obtain candidate arcs; summarize all candidate arcs, calculate the cross-configuration support rate, average strength, and direction probability for each candidate arc; sort all candidate arcs according to the priority order of the support rate, average strength, and direction probability from high to low to obtain a sorting result; starting from an empty graph, attempt to add arcs one by one according to the sorting result, and perform directed cycle checks, only adding arcs that will not form directed cycles, and finally obtain a directed acyclic graph as a robust consensus template; the empty graph refers to an initial directed acyclic graph that has contained all the involved nodes, but there are no arcs connecting the nodes for the time being; Output module 609 is used to output at least the robust consensus template and the performance-priority template as selectable Bayesian network structure templates; The prediction module 610 is used to perform holistic scenario inference and individualized prediction based on the Bayesian structure template.

[0110] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0111] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.

[0112] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that comply with the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0113] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A Bayesian network modeling method for disease outcome prediction, characterized in that, The method includes: The raw clinical data of multiple individuals with the target disease are obtained, the raw clinical data are preprocessed, and binary outcome variables are generated for each patient according to the preset outcome determination rules. Using the outcome variable as the target, penalized regression screening and information gain screening are performed on the variables in the preprocessed data; the selected variables are subjected to association screening to remove redundant information, and combined with clinical knowledge, a set of candidate variables for modeling is determined. Based on clinical temporal or logical relationships, the variables in the candidate variable set are divided into exogenous variables, first-level variables, second-level variables, or third-level variables; wherein, the random grouping variable is designated as the exogenous variable, the variable characterizing baseline exposure and individual characteristics is designated as the first-level variable, the variable characterizing disease severity, imaging features, or intermediate phenotype is designated as the second-level variable, and the outcome variable is designated as the third-level variable; Based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables, a blacklist constraint matrix is ​​generated. The blacklist constraint matrix is ​​used to prohibit the occurrence of arcs in a specific direction; the arc is a directed connection between variables. Based on the candidate variable set and the blacklist constraint matrix, structure learning is performed using various preset configuration schemes to generate a candidate network set; wherein, each configuration scheme uniquely specifies a structure learning method, the parameter settings corresponding to the structure learning method, and the blacklist constraint matrix; For each of the configuration schemes, the predictive performance of the learned network structure on the outcome variable is evaluated by cross-validation. The configuration scheme with the best predictive performance is selected, and the network is refitted using all variables and the best-performing configuration scheme to obtain a directed acyclic graph as a performance-priority template. For each of the configuration schemes, the Bootstrap resampling technique is used to repeatedly draw samples with replacement from the original data. A candidate network structure is learned on each sample, and the frequency of each possible arc learned in all Bootstrap samples is counted as the strength of the arc under the configuration scheme. For each configuration scheme, only arcs with a strength not lower than a preset strength threshold are retained to obtain candidate arcs; all candidate arcs are aggregated, and the cross-configuration support rate, average strength, and direction probability are calculated for each candidate arc; all candidate arcs are sorted in descending order of priority based on the support rate, average strength, and direction probability to obtain a sorting result; starting from an empty graph, arcs are added one by one according to the sorting result, and directed cycle checks are performed, adding only arcs that will not form directed cycles, finally obtaining a directed acyclic graph as a robust consensus template; the empty graph refers to an initial directed acyclic graph that contains all involved nodes, but there are currently no arcs connecting the nodes; At least the robust consensus template and the performance-priority template are output as selectable Bayesian network structure templates; Based on the Bayesian structure template, holistic scenario inference and individualized prediction are performed on individual samples.

2. The method according to claim 1, characterized in that: The penalized regression screening includes: constructing a design matrix for the outcome variables, and running Lasso regression and Elastic Net regression respectively; for each variable, if any of its contribution values ​​is non-zero, then the variable is marked as selected; The information gain screening includes: calculating the entropy of the outcome variable itself to obtain the initial uncertainty entropy; introducing a variable and calculating the conditional entropy under the condition that the value of the variable is known to obtain the residual uncertainty entropy; taking the difference between the initial uncertainty entropy and the residual uncertainty entropy to obtain the information gain, and calculating the standardized information gain; sorting all variables from largest to smallest according to the standardized information gain, and marking the top N variables as selected. The association screening includes: determining the type of any two variables; if both variables are numerical, calculating the Spearman correlation coefficient; if both variables are categorical, calculating Cramer's V coefficient; if one variable is numerical and the other is categorical, calculating the Eta correlation ratio; when the calculated correlation coefficient is greater than a preset threshold, marking the two variables as an information redundancy pair and marking one of the two variables as to be removed. The process of combining clinical knowledge to determine the set of candidate variables for modeling includes: A variable shall be retained in the set of candidate variables if and only if it satisfies at least one of the following conditions: The variables mentioned have been shown to be associated with prognosis in existing studies of hemorrhagic stroke, or have been deemed clinically important by experts. The variable is marked as selected in at least one of the penalized regression screening and information gain screening methods; The variable does not have a high degree of information overlap with the variables ranked higher and has not been marked for removal, meaning that its correlation coefficient with any of the selected variables is lower than the coefficient threshold.

3. The method according to claim 1, characterized in that, The generation of the blacklist constraint matrix based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables includes: Based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables, a two-column table is generated, with the first column named "from" and the second column named "to". Each row in the two columns represents a forbidden directed arc, where the "from" column records the starting point variable of the arc and the "to" column records the ending point variable of the arc. The direction of the directed arc is from the starting point variable to the ending point variable. Convert the two lists into a directed edge list matrix; According to the preset hierarchical prohibition rules, the directed edge list matrix is ​​expanded by Cartesian product to generate the blacklist constraint matrix; the hierarchical prohibition rules include: prohibiting any variable from pointing to the exogenous variable, prohibiting the second-level variable from pointing to the first-level variable, and prohibiting the third-level variable from pointing to the first-level variable or the second-level variable.

4. The method according to claim 1, characterized in that, Calculate the direction probability for each of the candidate arcs, including: For a node pair A and B that are connected, the proportion of samples with the direction "A→B" in all Bootstrap samples that support the connection is used as the probability of the direction "A→B".

5. The method according to claim 1, characterized in that, The step of evaluating the predictive performance of the learned network structure for the outcome variable through cross-validation includes: The predictive performance of the learned network structure on the outcome variable was evaluated by five-fold cross-validation, and the evaluation metrics for the five-fold cross-validation included: average AUC and average Brier score. The selection of the configuration scheme with the best prediction performance includes: The configuration scheme with the highest average AUC value is selected first. If the average AUC values ​​are the same, the configuration scheme with the lowest average Brier score is selected. If the average AUC value and the average Brier score are the same, the configuration scheme with the fewest edges in the learned network structure is selected.

6. The method according to claim 1, characterized in that, After obtaining a directed acyclic graph as a performance-priority template, the following is also included: Using the performance-priority template as the initial network, extract all arcs and sort them from low to high intensity; Try deleting one arc at a time, and then perform cross-validation evaluation on the new network after the deletion; If the average AUC of the new network is not lower than 98% of the average AUC of the performance-priority template, and the average Brier of the new network is not higher than 101% of the average Brier of the performance-priority template, then the candidate arc is permanently deleted; otherwise, the candidate arc is restored; repeat this process until no arc can be deleted, obtain the minimum structure template, and output the directed acyclic graph of the minimum structure template.

7. The method according to claim 1, characterized in that, After obtaining a directed acyclic graph as a performance-priority template, the following is also included: Using the performance-first template as the base network, the robust consensus template generation function is called to obtain the candidate arc set explored by it, which serves as a scalable arc pool; Each existing arc and its reverse arc in the basic network are marked as a prohibited node pair. The arcs corresponding to the prohibited node pairs are removed from the scalable arc pool to obtain the remaining candidate arc set. According to the priority order of the support rate, the average strength, and the direction probability from high to low, each candidate arc in the remaining candidate arc set is sorted to obtain the sorting result; According to the sorting results, candidate arcs are added to the base network one by one. For each candidate arc, it is checked whether adding the candidate arc will form a directed cycle in the current network. If no directed cycle is formed, five-fold cross-validation is performed on the new network after adding the candidate arc to calculate the average AUC and average Brier score of the new network. If the average AUC of the new network is not lower than the average AUC of the base network minus a first tolerance threshold, and the average Brier score of the new network is not higher than the average Brier score of the base network plus a second tolerance threshold, then the candidate arc is accepted and permanently added to the network; otherwise, the candidate arc is abandoned. After traversing all candidate arcs, the maximum structure template is obtained, and the directed acyclic graph of the maximum structure template is output.

8. The method according to claim 1, characterized in that, After identifying the set of candidate variables for modeling by incorporating clinical knowledge, the process also includes: For the variables in the candidate variable set, calculate the correlation coefficient between each variable; When the correlation coefficient between two variables is greater than a preset threshold, one of the variables is removed. Specifically, this includes: when the correlation coefficient between the baseline Rankin score and the baseline Glasgow prognostic score is greater than a preset threshold, the baseline Rankin score is removed; when the correlation coefficient between the stroke diagnosis score and the baseline Glasgow prognostic score is greater than a preset threshold, the stroke diagnosis score is removed; the baseline Rankin score, the baseline Glasgow prognostic score, and the stroke diagnosis score are variables in the candidate variable set. Based on the variables remaining after elimination, consensus templates and performance-priority templates were generated sequentially, with comprehensive efficacy and Glasgow Outcome Score as the target outcomes, respectively. Based on literature evidence and expert experience, the consensus template and performance-priority template were reviewed and approved, resulting in a directed acyclic graph consisting of seven core nodes, which serves as a medical knowledge template.

9. The method according to claim 1, characterized in that, After outputting at least the robust consensus template and the performance-priority template as alternative Bayesian network structure templates, the method further includes: Based on the Bayesian network structure and the preprocessed data, for each node in the Bayesian network structure, the conditional probability distribution of the node under different combinations of states of all its parent nodes is estimated, and a conditional probability table corresponding to the node is generated; the conditional probability table is used to characterize: when the set of parent nodes of the node takes a specific combination of states, the conditional probability value of the node takes each possible state. Output a full network conditional probability table containing conditional probability tables for all nodes.

10. A Bayesian network modeling device for disease outcome prediction, characterized in that, The device includes: The data acquisition module is used to acquire raw clinical data from multiple individuals suffering from the target disease, perform preprocessing on the raw clinical data, and generate binary outcome variables for each patient according to preset outcome determination rules. The screening module is used to perform penalized regression screening and information gain screening on the variables in the preprocessed data with the outcome variable as the target; to perform association screening on the selected variables, remove redundant information, and combine clinical knowledge to determine the set of candidate variables for modeling; The variable designation module is used to divide the variables in the candidate variable set into exogenous variables, first-level variables, second-level variables, or third-level variables according to clinical time sequence relationships or clinical logical relationships; wherein, the random grouping variable is designated as the exogenous variable, the variable characterizing baseline exposure and individual characteristics is designated as the first-level variable, the variable characterizing disease severity, imaging features, or intermediate phenotype is designated as the second-level variable, and the outcome variable is designated as the third-level variable; The constraint matrix generation module is used to generate a blacklist constraint matrix based on the hierarchical relationship between the exogenous variables, the first-level variables, the second-level variables, and the third-level variables. The blacklist constraint matrix is ​​used to prohibit the occurrence of arcs in a specific direction; the arc is a directed connection between variables. The structure learning module is used to perform structure learning based on the candidate variable set and the blacklist constraint matrix, using multiple preset configuration schemes to generate a candidate network set; wherein, each configuration scheme uniquely specifies a structure learning method, the parameter settings corresponding to the structure learning method, and the blacklist constraint matrix; The performance-priority template generation module is used to evaluate the predictive performance of the learned network structure on the outcome variable for each configuration scheme through cross-validation, select the configuration scheme with the best predictive performance, and refit the network using all variables and the best-performing configuration scheme to obtain a directed acyclic graph as the performance-priority template. The extraction module is used to repeatedly extract samples with replacement from the original data for each configuration scheme using Bootstrap resampling technology, learn a candidate network structure on each sample, and count the frequency of each possible arc learned in all Bootstrap samples as the intensity of the arc under the configuration scheme. A robust consensus template generation module is used to, for each configuration scheme, retain only arcs with a strength not lower than a preset strength threshold to obtain candidate arcs; summarize all candidate arcs and calculate the cross-configuration support rate, average strength, and direction probability for each candidate arc; sort all candidate arcs according to the priority order of the support rate, average strength, and direction probability from high to low to obtain a sorting result; starting from an empty graph, try to add arcs one by one according to the sorting result and perform directed cycle checks, only adding arcs that will not form directed cycles, and finally obtain a directed acyclic graph as a robust consensus template; the empty graph refers to an initial directed acyclic graph that has contained all the involved nodes, but there are no arcs connecting the nodes for the time being; The output module is used to output at least the robust consensus template and the performance-priority template as selectable Bayesian network structure templates. The prediction module is used to perform overall scenario inference and individualized prediction based on the Bayesian structure template.