# kmsvishnu11/causal-inference-uplift-modeling-framework architecture

> Architecture diagram of the GitHub repository kmsvishnu11/causal-inference-uplift-modeling-framework, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kmsvishnu11/causal-inference-uplift-modeling-framework
- Repository: https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework

## Overview

Causal Inference System is a Streamlit dashboard for estimating intervention effects and exploring causal methods. Users choose built-in examples or supply a CSV; the dashboard obtains data, invokes the relevant analysis engine, and presents estimates and diagnostics. Its major capabilities include propensity-based adjustment, panel and policy analysis, threshold-based RDD, and customer-level uplift modeling. The excerpts show selected dashboard calls and engine internals; other links are included only where the README explicitly documents the workflow.

Main entry points: [`app.py`](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/app.py) (Streamlit dashboard), [`src/propensity.py`](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py) (Propensity methods), [`src/did.py`](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/did.py) (Difference-in-Differences), [`src/uplift.py`](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/uplift.py) (Uplift learners)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Streamlit dashboard<br/>[app.py]"]
end

subgraph group_data["Data"]
  node_dataset_builder["Dataset generation<br/>[data_generator.py]"]
  node_cached_data["Cached datasets"]
end

subgraph group_cross_sectional["Cross-sectional"]
  node_propensity_engine["Propensity methods<br/>[propensity.py]"]
  node_naive_estimate["Naive comparison<br/>[propensity.py]"]
  node_propensity_score["Propensity estimation<br/>[propensity.py]"]
  node_matching_balance["Matching and balance<br/>[propensity.py]"]
  node_robustness["Effect and robustness<br/>[propensity.py]"]
end

subgraph group_panel_threshold["Panel and threshold"]
  node_did_engine["Difference-in-Differences<br/>[did.py]"]
  node_did_diagnostics["Trends and event study<br/>[did.py]"]
  node_synthetic_control["Synthetic control<br/>[did.py]"]
  node_rdd_engine["Regression discontinuity<br/>[rdd.py]"]
  node_rdd_diagnostics["RDD diagnostics<br/>[rdd.py]"]
end

subgraph group_targeting["Uplift targeting"]
  node_uplift_models["Uplift learners<br/>[uplift.py]"]
  node_uplift_evaluation["Uplift evaluation<br/>[uplift.py]"]
  node_targeting_value["Targeting and budget<br/>[uplift.py]"]
end

node_analyst(("Analyst"))

node_analyst -->|"uses"| node_dashboard_app
node_dashboard_app -->|"requests data"| node_dataset_builder
node_dataset_builder -->|"builds and caches"| node_cached_data
node_dashboard_app -->|"runs analyses"| node_propensity_engine
node_dashboard_app -->|"runs analyses"| node_did_engine
node_dashboard_app -->|"runs analyses"| node_rdd_engine
node_dashboard_app -->|"fits learners"| node_uplift_models
node_propensity_engine -->|"compares"| node_naive_estimate
node_propensity_engine -->|"estimates"| node_propensity_score
node_propensity_engine -.->|"matches and checks"| node_matching_balance
node_propensity_engine -.->|"estimates and tests"| node_robustness
node_did_engine -.->|"supports with"| node_did_diagnostics
node_did_engine -.->|"also offers"| node_synthetic_control
node_rdd_engine -->|"checks robustness"| node_rdd_diagnostics
node_uplift_models -.->|"evaluates scores"| node_uplift_evaluation
node_uplift_models -.->|"informs targeting"| node_targeting_value

click node_dashboard_app "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/app.py"
click node_dataset_builder "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/data_generator.py"
click node_cached_data "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/tree/main/data"
click node_propensity_engine "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py"
click node_naive_estimate "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py"
click node_propensity_score "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py"
click node_matching_balance "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py"
click node_robustness "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py"
click node_did_engine "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/did.py"
click node_did_diagnostics "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/did.py"
click node_synthetic_control "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/did.py"
click node_rdd_engine "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/rdd.py"
click node_rdd_diagnostics "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/rdd.py"
click node_uplift_models "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/uplift.py"
click node_uplift_evaluation "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/uplift.py"
click node_targeting_value "https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/uplift.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_dashboard_app toneBlue
class node_dataset_builder,node_cached_data toneAmber
class node_propensity_engine,node_naive_estimate,node_propensity_score,node_matching_balance,node_robustness toneMint
class node_did_engine,node_did_diagnostics,node_synthetic_control,node_rdd_engine,node_rdd_diagnostics toneRose
class node_uplift_models,node_uplift_evaluation,node_targeting_value,node_analyst toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/app.py): `app.py`

### Data

- [Dataset generation](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/data_generator.py): `src/data_generator.py`
- [Cached datasets](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/tree/main/data): `data`

### Cross-sectional

- [Propensity methods](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py): `src/propensity.py`
- [Naive comparison](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py): `src/propensity.py`
- [Propensity estimation](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py): `src/propensity.py`
- [Matching and balance](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py): `src/propensity.py`
- [Effect and robustness](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/propensity.py): `src/propensity.py`

### Panel and threshold

- [Difference-in-Differences](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/did.py): `src/did.py`
- [Trends and event study](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/did.py): `src/did.py`
- [Synthetic control](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/did.py): `src/did.py`
- [Regression discontinuity](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/rdd.py): `src/rdd.py`
- [RDD diagnostics](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/rdd.py): `src/rdd.py`

### Uplift targeting

- [Uplift learners](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/uplift.py): `src/uplift.py`
- [Uplift evaluation](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/uplift.py): `src/uplift.py`
- [Targeting and budget](https://github.com/kmsvishnu11/causal-inference-uplift-modeling-framework/blob/main/src/uplift.py): `src/uplift.py`

### Other components

- **Analyst**

## Connections

- Analyst → Streamlit dashboard: uses (evidence: `app.py`)
- Streamlit dashboard → Dataset generation: requests data (evidence: `app.py`)
- Dataset generation → Cached datasets: builds and caches (evidence: `src/data_generator.py`)
- Streamlit dashboard → Propensity methods: runs analyses (evidence: `app.py`)
- Streamlit dashboard → Difference-in-Differences: runs analyses (evidence: `app.py`)
- Streamlit dashboard → Regression discontinuity: runs analyses (evidence: `app.py`)
- Streamlit dashboard → Uplift learners: fits learners (evidence: `app.py`)
- Propensity methods → Naive comparison: compares (evidence: `src/propensity.py`)
- Propensity methods → Propensity estimation: estimates (evidence: `src/propensity.py`)
- Propensity methods → Matching and balance: matches and checks (evidence: `README.md`)
- Propensity methods → Effect and robustness: estimates and tests (evidence: `README.md`)
- Difference-in-Differences → Trends and event study: supports with (evidence: `README.md`)
- Difference-in-Differences → Synthetic control: also offers (evidence: `README.md`)
- Regression discontinuity → RDD diagnostics: checks robustness (evidence: `app.py`)
- Uplift learners → Uplift evaluation: evaluates scores (evidence: `src/uplift.py`)
- Uplift learners → Targeting and budget: informs targeting (evidence: `src/uplift.py`)
