API Reference
Complete API documentation for all CAIS modules, classes, and functions. This reference provides detailed information about parameters, return values, and usage examples for every public interface.
API Documentation
API Overview
The CAIS API is organized into several key modules:
Causal Agent - Automated Causal Inference with Large Language Models. |
- Core Components
causal_agent.agent.CausalAgent: Main interface for causal analysiscausal_agent.components.dataset_analyzer.DatasetAnalyzer: Data validation and preprocessingcausal_agent.components.decision_tree.DecisionTree: Automatic method selection logiccausal_agent.components.explanation_generator.ExplanationGenerator: Result formatting and explanation
- Causal Methods
causal_agent.methods.diff_in_means: Simple difference in means estimationcausal_agent.methods.difference_in_differences: Difference-in-differences implementationcausal_agent.methods.instrumental_variable: Instrumental variable methodscausal_agent.methods.regression_discontinuity: Regression discontinuity designcausal_agent.methods.propensity_score: Propensity score matching and weightingcausal_agent.methods.backdoor_adjustment: Backdoor adjustment methodscausal_agent.methods.linear_regression: Linear regression for causal inference
- Tools and Utilities
causal_agent.tools: Analysis tools and method executioncausal_agent.utils: Helper functions and utilitiescausal_agent.synthetic: Synthetic data generationcausal_agent.prompts: LLM prompt templates
Quick Reference
Basic Usage
from causal_agent import CausalAgent
agent = CausalAgent()
result = agent.analyze(data, treatment, outcome)
Method-Specific Analysis
from causal_agent.methods import DifferenceInDifferences
did = DifferenceInDifferences()
result = did.estimate(data, treatment, outcome, time_var)
Custom Configuration
from causal_agent import CausalAgent, Config
config = Config(llm_provider="openai", model="gpt-4")
agent = CausalAgent(config=config)
Cross-References and Links
Related Documentation Sections:
Getting Started - Get started with CAIS
User Guide - Comprehensive usage guide
Causal Inference Methods - Causal inference method details
Tutorials & Examples - Interactive tutorials and examples
External References:
DoWhy Documentation - Related causal inference library
Scikit-learn API - Machine learning API reference
Pandas API - Data manipulation reference