# akhil-preetham/cardio-diag-updated architecture

> Architecture diagram of the GitHub repository akhil-preetham/cardio-diag-updated, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akhil-preetham/cardio-diag-updated
- Repository: https://github.com/akhil-preetham/cardio-diag-updated

## Overview

CARDIODIAG is a retrospective coronary artery disease research implementation, with a guarded five-feature tool for producing research scores as its clearest user-facing workflow. Its broader runtime supports dataset preparation, frozen-partition experiments, model comparison, validation and transport analysis, and evidence/report generation. The graph preserves those research stages and the sampled portable scoring path. Several experiment modules are present in the tree but were not excerpted; their connections are omitted unless documented or indexed.

Main entry points: [`tools/portable_predict.py`](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/tools/portable_predict.py) (Portable scoring), [`CARDIODIAG_FRESH/runner/primary_research_v2/run.py`](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/primary_research_v2/run.py) (Primary benchmark), [`CARDIODIAG_FRESH/runner/phase6_1_audit/audit.py`](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase6_1_audit/audit.py) (Phase audit), [`CARDIODIAG_FRESH/runner/phase4_validation_audit/run.py`](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase4_validation_audit/run.py) (Validation experiments)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_research["Research experiments"]
  node_acquisition["Dataset acquisition"]
  node_split["Frozen partitions<br/>[split_manifest.py]"]
  node_benchmark["Primary benchmark<br/>[run.py]"]
  node_phase4["Validation experiments<br/>[run.py]"]
  node_phase6["ZAS selection<br/>[run.py]"]
  node_transport["Cohort transport<br/>[transport.py]"]
end

subgraph group_analysis["Evaluation and audits"]
  node_audit["Phase audit<br/>[audit.py]"]
  node_paired["Paired statistics<br/>[paired.py]"]
  node_dataquality["Data quality<br/>[quality.py]"]
  node_calibration["Calibration metrics<br/>[metrics.py]"]
  node_fairness["Subgroup fairness<br/>[subgroups.py]"]
  node_explainability["LIME explanations<br/>[lime_workflow.py]"]
end

subgraph group_scoring["Portable scoring"]
  node_portable["Portable scoring"]
  node_predict["Input validation"]
  node_release["Runtime and model gate"]
end

subgraph group_evidence["Evidence and reporting"]
  node_manuscript["Evidence manuscript"]
  node_report["Research report<br/>[build_report.py]"]
end

node_researcher(("Research user"))
node_dataset[("Clinical datasets")]
node_input["Scoring input"]
node_scores["Research scores"]

node_dataset -.->|"supplies data"| node_acquisition
node_acquisition -.->|"prepares inputs"| node_benchmark
node_split -->|"defines partitions"| node_benchmark
node_phase6 -->|"reconciles results"| node_audit
node_phase4 -.->|"supports audit"| node_audit
node_researcher -->|"requests scoring"| node_portable
node_input -->|"provides rows"| node_portable
node_portable -->|"checks runtime"| node_release
node_portable -->|"validates and scores"| node_predict
node_predict -->|"uses normalization"| node_transport
node_portable -->|"writes scores"| node_scores
node_benchmark -.->|"informs reporting"| node_manuscript
node_audit -.->|"informs reporting"| node_report
node_manuscript -->|"imports statistics interface"| node_paired
node_phase4 -.->|"uses comparisons"| node_paired

click node_acquisition "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/data/collect_clinical_datasets_v2.py"
click node_split "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/methodology_corrections_v2/split_manifest.py"
click node_benchmark "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/primary_research_v2/run.py"
click node_phase4 "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase4_validation_audit/run.py"
click node_phase6 "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase6_zas_selection/run.py"
click node_audit "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase6_1_audit/audit.py"
click node_paired "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/statistics/paired.py"
click node_dataquality "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/data/quality.py"
click node_calibration "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/calibration/metrics.py"
click node_fairness "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/fairness/subgroups.py"
click node_explainability "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/explainability/lime_workflow.py"
click node_transport "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/research_extension_v1/transport.py"
click node_portable "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/tools/portable_predict.py"
click node_predict "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/research_extension_v1/predict_research.py"
click node_release "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/tools/portable_release.py"
click node_manuscript "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/research_publication_plan/build_manuscript.py"
click node_report "https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/paper/research_extension_v1/build_report.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_acquisition,node_split,node_benchmark,node_phase4,node_phase6,node_transport,node_researcher toneBlue
class node_audit,node_paired,node_dataquality,node_calibration,node_fairness,node_explainability,node_dataset toneAmber
class node_portable,node_predict,node_release toneMint
class node_manuscript,node_report toneRose
class node_input,node_scores toneIndigo
```

## Components

### Research experiments

- [Dataset acquisition](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/data/collect_clinical_datasets_v2.py): `CARDIODIAG_FRESH/runner/data/collect_clinical_datasets_v2.py`
- [Frozen partitions](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/methodology_corrections_v2/split_manifest.py): `CARDIODIAG_FRESH/runner/methodology_corrections_v2/split_manifest.py`
- [Primary benchmark](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/primary_research_v2/run.py): `CARDIODIAG_FRESH/runner/primary_research_v2/run.py`
- [Validation experiments](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase4_validation_audit/run.py): `CARDIODIAG_FRESH/runner/phase4_validation_audit/run.py`
- [ZAS selection](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase6_zas_selection/run.py): `CARDIODIAG_FRESH/runner/phase6_zas_selection/run.py`
- [Cohort transport](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/research_extension_v1/transport.py): `CARDIODIAG_FRESH/runner/research_extension_v1/transport.py`

### Evaluation and audits

- [Phase audit](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/phase6_1_audit/audit.py): `CARDIODIAG_FRESH/runner/phase6_1_audit/audit.py`
- [Paired statistics](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/statistics/paired.py): `CARDIODIAG_FRESH/src/cardiodiag/statistics/paired.py`
- [Data quality](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/data/quality.py): `CARDIODIAG_FRESH/src/cardiodiag/data/quality.py`
- [Calibration metrics](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/calibration/metrics.py): `CARDIODIAG_FRESH/src/cardiodiag/calibration/metrics.py`
- [Subgroup fairness](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/fairness/subgroups.py): `CARDIODIAG_FRESH/src/cardiodiag/fairness/subgroups.py`
- [LIME explanations](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/src/cardiodiag/explainability/lime_workflow.py): `CARDIODIAG_FRESH/src/cardiodiag/explainability/lime_workflow.py`

### Portable scoring

- [Portable scoring](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/tools/portable_predict.py): `tools/portable_predict.py`
- [Input validation](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/runner/research_extension_v1/predict_research.py): `CARDIODIAG_FRESH/runner/research_extension_v1/predict_research.py`
- [Runtime and model gate](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/tools/portable_release.py): `tools/portable_release.py`

### Evidence and reporting

- [Evidence manuscript](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/research_publication_plan/build_manuscript.py): `research_publication_plan/build_manuscript.py`
- [Research report](https://github.com/akhil-preetham/cardio-diag-updated/blob/main/CARDIODIAG_FRESH/paper/research_extension_v1/build_report.py): `CARDIODIAG_FRESH/paper/research_extension_v1/build_report.py`

### Other components

- **Research user**
- **Clinical datasets**
- **Scoring input**
- **Research scores**

## Connections

- Clinical datasets → Dataset acquisition: supplies data
- Dataset acquisition → Primary benchmark: prepares inputs
- Frozen partitions → Primary benchmark: defines partitions (evidence: `CARDIODIAG_FRESH/runner/primary_research_v2/run.py`)
- ZAS selection → Phase audit: reconciles results (evidence: `CARDIODIAG_FRESH/runner/phase6_1_audit/audit.py`)
- Validation experiments → Phase audit: supports audit
- Research user → Portable scoring: requests scoring (evidence: `README.md`)
- Scoring input → Portable scoring: provides rows (evidence: `README.md`)
- Portable scoring → Runtime and model gate: checks runtime (evidence: `tools/portable_predict.py`)
- Portable scoring → Input validation: validates and scores (evidence: `tools/portable_predict.py`)
- Input validation → Cohort transport: uses normalization (evidence: `CARDIODIAG_FRESH/runner/research_extension_v1/predict_research.py`)
- Portable scoring → Research scores: writes scores (evidence: `README.md`)
- Primary benchmark → Evidence manuscript: informs reporting
- Phase audit → Research report: informs reporting
- Evidence manuscript → Paired statistics: imports statistics interface (evidence: `research_publication_plan/build_manuscript.py`)
- Validation experiments → Paired statistics: uses comparisons
