# reubebe/econml architecture

> Architecture diagram of the GitHub repository reubebe/econml, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/reubebe/econml
- Repository: https://github.com/reubebe/econml

## Overview

EconML is a Python toolkit for estimating heterogeneous treatment effects from observational data. The principal workflow is to provide outcomes, treatments and covariates to a CATE estimator, fit its causal model, then inspect effects and—where supported—uncertainty. Estimator families cover orthogonal/DML, doubly robust, instrumental-variable, forest and meta-learner approaches; separate capabilities support interpretation, validation, policy learning and model selection. Shared orthogonal-learning, estimator, inference and sklearn-extension layers underpin this surface. Some feature branches are documented or indexed but their implementation was not sampled, so their internal links are omitted.

Main entry points: [`econml/_ortho_learner.py`](https://github.com/reubebe/econml/blob/main/econml/_ortho_learner.py) (Orthogonal learner), [`econml/_cate_estimator.py`](https://github.com/reubebe/econml/blob/main/econml/_cate_estimator.py) (CATE interface), [`econml/dml/dml.py`](https://github.com/reubebe/econml/blob/main/econml/dml/dml.py) (DML estimators), [`econml/dr/_drlearner.py`](https://github.com/reubebe/econml/blob/main/econml/dr/_drlearner.py) (DR estimators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_estimation["Causal estimation"]
  node_dml["DML estimators<br/>[dml.py]"]
  node_dr["DR estimators<br/>[_drlearner.py]"]
  node_iv["IV estimators"]
  node_forests["Forest estimators<br/>[classes.py]"]
  node_meta["Meta-learners<br/>[_metalearners.py]"]
end

subgraph group_shared["Shared modeling"]
  node_ortho["Orthogonal learner<br/>[_ortho_learner.py]"]
  node_cate["CATE interface<br/>[_cate_estimator.py]"]
  node_linear["Linear models<br/>[linear_model.py]"]
  node_selection["Model selection<br/>[model_selection.py]"]
  node_utilities["Model utilities<br/>[utilities.py]"]
end

subgraph group_analysis["Inference and interpretation"]
  node_inference["Inference results<br/>[_inference.py]"]
  node_bootstrap["Bootstrap inference<br/>[_bootstrap.py]"]
  node_shap["SHAP explanations<br/>[_shap.py]"]
  node_interpreter["CATE interpreter<br/>[_interpreters.py]"]
  node_validation["Effect validation<br/>[drtester.py]"]
  node_sensitivity["Sensitivity analysis"]
end

subgraph group_decision["Validation and decisions"]
  node_policy["Policy learning<br/>[_drlearner.py]"]
  node_causal_analysis["Causal analysis"]
  node_scoring["Causal scoring<br/>[rscorer.py]"]
end

node_analyst(("Analyst"))
node_observations["Observed data"]

node_analyst -->|"provides"| node_observations
node_observations -->|"fits from"| node_dml
node_observations -->|"fits from"| node_dr
node_observations -->|"fits from"| node_iv
node_observations -->|"fits from"| node_forests
node_observations -->|"fits from"| node_meta
node_dml -->|"uses"| node_ortho
node_dr -->|"uses"| node_ortho
node_iv -->|"uses"| node_ortho
node_forests -->|"uses"| node_utilities
node_dml -->|"uses"| node_linear
node_dr -->|"uses"| node_linear
node_ortho -->|"extends"| node_cate
node_ortho -->|"uses"| node_selection
node_dml -->|"implements"| node_cate
node_dr -->|"implements"| node_cate
node_cate -->|"produces"| node_inference
node_analyst -->|"requests intervals"| node_inference
node_analyst -->|"requests explanations"| node_shap
node_analyst -->|"interprets effects"| node_interpreter
node_analyst -->|"validates effects"| node_validation
node_analyst -->|"checks sensitivity"| node_sensitivity
node_analyst -->|"learns policies"| node_policy
node_analyst -->|"runs analysis"| node_causal_analysis
node_analyst -->|"selects models"| node_scoring
node_cate -->|"explains effects"| node_shap
node_validation -.->|"shares validation"| node_sensitivity

click node_dml "https://github.com/reubebe/econml/blob/main/econml/dml/dml.py"
click node_dr "https://github.com/reubebe/econml/blob/main/econml/dr/_drlearner.py"
click node_iv "https://github.com/reubebe/econml/tree/main/econml/iv"
click node_forests "https://github.com/reubebe/econml/blob/main/econml/grf/classes.py"
click node_meta "https://github.com/reubebe/econml/blob/main/econml/metalearners/_metalearners.py"
click node_ortho "https://github.com/reubebe/econml/blob/main/econml/_ortho_learner.py"
click node_cate "https://github.com/reubebe/econml/blob/main/econml/_cate_estimator.py"
click node_linear "https://github.com/reubebe/econml/blob/main/econml/sklearn_extensions/linear_model.py"
click node_selection "https://github.com/reubebe/econml/blob/main/econml/sklearn_extensions/model_selection.py"
click node_utilities "https://github.com/reubebe/econml/blob/main/econml/utilities.py"
click node_inference "https://github.com/reubebe/econml/blob/main/econml/inference/_inference.py"
click node_bootstrap "https://github.com/reubebe/econml/blob/main/econml/inference/_bootstrap.py"
click node_shap "https://github.com/reubebe/econml/blob/main/econml/_shap.py"
click node_interpreter "https://github.com/reubebe/econml/blob/main/econml/cate_interpreter/_interpreters.py"
click node_validation "https://github.com/reubebe/econml/blob/main/econml/validate/drtester.py"
click node_sensitivity "https://github.com/reubebe/econml/blob/main/econml/validate/sensitivity_analysis.py"
click node_policy "https://github.com/reubebe/econml/blob/main/econml/policy/_drlearner.py"
click node_causal_analysis "https://github.com/reubebe/econml/blob/main/econml/solutions/causal_analysis/_causal_analysis.py"
click node_scoring "https://github.com/reubebe/econml/blob/main/econml/score/rscorer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dml,node_dr,node_iv,node_forests,node_meta toneBlue
class node_ortho,node_cate,node_linear,node_selection,node_utilities toneAmber
class node_inference,node_bootstrap,node_shap,node_interpreter,node_validation,node_sensitivity toneMint
class node_policy,node_causal_analysis,node_scoring toneRose
class node_analyst,node_observations toneIndigo
```

## Components

### Causal estimation

- [DML estimators](https://github.com/reubebe/econml/blob/main/econml/dml/dml.py): `econml/dml/dml.py`
- [DR estimators](https://github.com/reubebe/econml/blob/main/econml/dr/_drlearner.py): `econml/dr/_drlearner.py`
- [IV estimators](https://github.com/reubebe/econml/tree/main/econml/iv): `econml/iv`
- [Forest estimators](https://github.com/reubebe/econml/blob/main/econml/grf/classes.py): `econml/grf/classes.py`
- [Meta-learners](https://github.com/reubebe/econml/blob/main/econml/metalearners/_metalearners.py): `econml/metalearners/_metalearners.py`

### Shared modeling

- [Orthogonal learner](https://github.com/reubebe/econml/blob/main/econml/_ortho_learner.py): `econml/_ortho_learner.py`
- [CATE interface](https://github.com/reubebe/econml/blob/main/econml/_cate_estimator.py): `econml/_cate_estimator.py`
- [Linear models](https://github.com/reubebe/econml/blob/main/econml/sklearn_extensions/linear_model.py): `econml/sklearn_extensions/linear_model.py`
- [Model selection](https://github.com/reubebe/econml/blob/main/econml/sklearn_extensions/model_selection.py): `econml/sklearn_extensions/model_selection.py`
- [Model utilities](https://github.com/reubebe/econml/blob/main/econml/utilities.py): `econml/utilities.py`

### Inference and interpretation

- [Inference results](https://github.com/reubebe/econml/blob/main/econml/inference/_inference.py): `econml/inference/_inference.py`
- [Bootstrap inference](https://github.com/reubebe/econml/blob/main/econml/inference/_bootstrap.py): `econml/inference/_bootstrap.py`
- [SHAP explanations](https://github.com/reubebe/econml/blob/main/econml/_shap.py): `econml/_shap.py`
- [CATE interpreter](https://github.com/reubebe/econml/blob/main/econml/cate_interpreter/_interpreters.py): `econml/cate_interpreter/_interpreters.py`
- [Effect validation](https://github.com/reubebe/econml/blob/main/econml/validate/drtester.py): `econml/validate/drtester.py`
- [Sensitivity analysis](https://github.com/reubebe/econml/blob/main/econml/validate/sensitivity_analysis.py): `econml/validate/sensitivity_analysis.py`

### Validation and decisions

- [Policy learning](https://github.com/reubebe/econml/blob/main/econml/policy/_drlearner.py): `econml/policy/_drlearner.py`
- [Causal analysis](https://github.com/reubebe/econml/blob/main/econml/solutions/causal_analysis/_causal_analysis.py): `econml/solutions/causal_analysis/_causal_analysis.py`
- [Causal scoring](https://github.com/reubebe/econml/blob/main/econml/score/rscorer.py): `econml/score/rscorer.py`

### Other components

- **Analyst**
- **Observed data**

## Connections

- Analyst → Observed data: provides (evidence: `README.md`)
- Observed data → DML estimators: fits from (evidence: `README.md`)
- Observed data → DR estimators: fits from (evidence: `README.md`)
- Observed data → IV estimators: fits from (evidence: `README.md`)
- Observed data → Forest estimators: fits from (evidence: `README.md`)
- Observed data → Meta-learners: fits from (evidence: `README.md`)
- DML estimators → Orthogonal learner: uses (evidence: `econml/dml/dml.py`)
- DR estimators → Orthogonal learner: uses (evidence: `econml/dr/_drlearner.py`)
- IV estimators → Orthogonal learner: uses (evidence: `econml/iv/dr/_dr.py`)
- Forest estimators → Model utilities: uses (evidence: `econml/grf/classes.py`)
- DML estimators → Linear models: uses (evidence: `econml/dml/dml.py`)
- DR estimators → Linear models: uses (evidence: `econml/dr/_drlearner.py`)
- Orthogonal learner → CATE interface: extends (evidence: `econml/_ortho_learner.py`)
- Orthogonal learner → Model selection: uses (evidence: `econml/_ortho_learner.py`)
- DML estimators → CATE interface: implements (evidence: `econml/dml/dml.py`)
- DR estimators → CATE interface: implements (evidence: `econml/dr/_drlearner.py`)
- CATE interface → Inference results: produces (evidence: `econml/_cate_estimator.py`)
- Analyst → Inference results: requests intervals (evidence: `README.md`)
- Analyst → SHAP explanations: requests explanations (evidence: `README.md`)
- Analyst → CATE interpreter: interprets effects (evidence: `README.md`)
- Analyst → Effect validation: validates effects (evidence: `README.md`)
- Analyst → Sensitivity analysis: checks sensitivity
- Analyst → Policy learning: learns policies (evidence: `README.md`)
- Analyst → Causal analysis: runs analysis (evidence: `econml/solutions/causal_analysis/_causal_analysis.py`)
- Analyst → Causal scoring: selects models (evidence: `README.md`)
- CATE interface → SHAP explanations: explains effects (evidence: `econml/_cate_estimator.py`)
- Effect validation → Sensitivity analysis: shares validation
