Spaces:
Running
Running
| """ | |
| Causal Analysis and Relationship Inference | |
| This module handles the fifth stage of the agent monitoring pipeline: | |
| - Causal analysis of knowledge graphs and perturbation test results | |
| - Component analysis and influence measurement | |
| - Confounder detection and analysis | |
| - DoWhy-based causal inference | |
| - Graph-based causal reasoning | |
| Functional Organization: | |
| - causal_interface: Main interface for causal analysis | |
| - component_analysis: Component-level causal analysis methods | |
| - influence_analysis: Influence measurement and analysis | |
| - dowhy_analysis: DoWhy-based causal inference | |
| - graph_analysis: Graph-based causal reasoning | |
| - confounders: Confounder detection methods | |
| - utils: Utility functions for causal analysis | |
| Usage: | |
| from agentgraph.causal import CausalAnalysisInterface | |
| from agentgraph.causal import calculate_average_treatment_effect | |
| from agentgraph.causal import detect_confounders | |
| """ | |
| # Main interface (pure functions) | |
| from .causal_interface import analyze_causal_effects, enrich_knowledge_graph, generate_report | |
| # Core analysis methods | |
| from .component_analysis import ( | |
| calculate_average_treatment_effect, | |
| granger_causality_test, | |
| compute_causal_effect_strength | |
| ) | |
| from .influence_analysis import ( | |
| analyze_component_influence, | |
| evaluate_model, | |
| identify_key_components | |
| ) | |
| from .dowhy_analysis import ( | |
| run_dowhy_analysis, | |
| analyze_components_with_dowhy, | |
| generate_simple_causal_graph | |
| ) | |
| from .graph_analysis import ( | |
| CausalGraph, | |
| CausalAnalyzer, | |
| enrich_knowledge_graph, | |
| generate_summary_report | |
| ) | |
| # Subdirectories | |
| from . import confounders | |
| from . import utils | |
| __all__ = [ | |
| # Main interface (pure functions) | |
| 'analyze_causal_effects', | |
| 'enrich_knowledge_graph', | |
| 'generate_report', | |
| # Component analysis | |
| 'calculate_average_treatment_effect', | |
| 'granger_causality_test', | |
| 'compute_causal_effect_strength', | |
| # Influence analysis | |
| 'analyze_component_influence', | |
| 'evaluate_model', | |
| 'identify_key_components', | |
| # DoWhy analysis | |
| 'run_dowhy_analysis', | |
| 'analyze_components_with_dowhy', | |
| 'generate_simple_causal_graph', | |
| # Graph analysis | |
| 'CausalGraph', | |
| 'CausalAnalyzer', | |
| 'generate_summary_report', | |
| # Submodules | |
| 'confounders', | |
| 'utils' | |
| ] |