# ranuth-nanvidu/cancer-ml-leakage-demo architecture

> Architecture diagram of the GitHub repository ranuth-nanvidu/cancer-ml-leakage-demo, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ranuth-nanvidu/cancer-ml-leakage-demo
- Repository: https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo

## Overview

This is a reproducible cancer-classification data-leakage experiment, not a deployed prediction service. Users explore WDBC, compare duplicate-before-split and split-before-duplicate experiments, then inspect mean, maximum, and minimum accuracy results. The notebooks are the documented user workflow; the importable package supplies data loading, split strategies, classifiers, and experiment metrics. Edges follow README descriptions or shown source calls; notebook internals were not sampled, so their connections reflect documented behavior only.

Main entry points: [`notebooks/02_leaky_pipeline.ipynb`](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/02_leaky_pipeline.ipynb) (Leaky experiment), [`notebooks/03_correct_pipeline.ipynb`](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/03_correct_pipeline.ipynb) (Correct experiment), [`results`](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/tree/main/results) (Tables and figures), [`notebooks/04_max_vs_min_accuracy.ipynb`](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/04_max_vs_min_accuracy.ipynb) (Accuracy comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_notebooks["Notebook workflow"]
  node_eda["Dataset exploration<br/>[01_eda.ipynb]"]
  node_leaky_nb["Leaky experiment"]
  node_correct_nb["Correct experiment"]
  node_compare_nb["Accuracy comparison"]
end

subgraph group_experiment["Experiment logic"]
  node_data["WDBC loading and split<br/>[data.py]"]
  node_leakage["Duplicate split strategies<br/>[leakage.py]"]
  node_metrics["Repeated evaluation<br/>[metrics.py]"]
  node_models["Seven classifiers<br/>[models.py]"]
end

subgraph group_results["Analysis outputs"]
  node_outputs["Tables and figures"]
end

node_user(("Researcher"))

node_user -->|"explores data"| node_eda
node_user -->|"runs experiment"| node_leaky_nb
node_user -->|"runs experiment"| node_correct_nb
node_user -->|"reviews comparison"| node_compare_nb
node_leaky_nb -->|"loads data"| node_data
node_correct_nb -->|"loads data"| node_data
node_leaky_nb -->|"uses leaky split"| node_leakage
node_correct_nb -->|"uses corrected split"| node_leakage
node_leaky_nb -->|"runs evaluation"| node_metrics
node_correct_nb -->|"runs evaluation"| node_metrics
node_metrics -->|"creates models"| node_models
node_leakage -->|"uses simple split"| node_data
node_leaky_nb -->|"writes summary"| node_outputs
node_correct_nb -->|"writes summary"| node_outputs
node_compare_nb -->|"reads summaries"| node_outputs
node_compare_nb -->|"creates comparison"| node_outputs

click node_eda "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/01_eda.ipynb"
click node_leaky_nb "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/02_leaky_pipeline.ipynb"
click node_correct_nb "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/03_correct_pipeline.ipynb"
click node_compare_nb "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/04_max_vs_min_accuracy.ipynb"
click node_data "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/data.py"
click node_leakage "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/leakage.py"
click node_metrics "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/metrics.py"
click node_models "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/models.py"
click node_outputs "https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/tree/main/results"

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_eda,node_leaky_nb,node_correct_nb,node_compare_nb toneBlue
class node_data,node_leakage,node_metrics,node_models toneAmber
class node_outputs toneMint
class node_user toneIndigo
```

## Components

### Notebook workflow

- [Dataset exploration](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/01_eda.ipynb): `notebooks/01_eda.ipynb`
- [Leaky experiment](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/02_leaky_pipeline.ipynb): `notebooks/02_leaky_pipeline.ipynb`
- [Correct experiment](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/03_correct_pipeline.ipynb): `notebooks/03_correct_pipeline.ipynb`
- [Accuracy comparison](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/notebooks/04_max_vs_min_accuracy.ipynb): `notebooks/04_max_vs_min_accuracy.ipynb`

### Experiment logic

- [WDBC loading and split](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/data.py): `src/cancer_ml_leakage_demo/data.py`
- [Duplicate split strategies](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/leakage.py): `src/cancer_ml_leakage_demo/leakage.py`
- [Repeated evaluation](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/metrics.py): `src/cancer_ml_leakage_demo/metrics.py`
- [Seven classifiers](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/blob/main/src/cancer_ml_leakage_demo/models.py): `src/cancer_ml_leakage_demo/models.py`

### Analysis outputs

- [Tables and figures](https://github.com/ranuth-nanvidu/cancer-ml-leakage-demo/tree/main/results): `results`

### Other components

- **Researcher**

## Connections

- Researcher → Dataset exploration: explores data (evidence: `README.md`)
- Researcher → Leaky experiment: runs experiment (evidence: `README.md`)
- Researcher → Correct experiment: runs experiment (evidence: `README.md`)
- Researcher → Accuracy comparison: reviews comparison (evidence: `README.md`)
- Leaky experiment → WDBC loading and split: loads data (evidence: `README.md`)
- Correct experiment → WDBC loading and split: loads data (evidence: `README.md`)
- Leaky experiment → Duplicate split strategies: uses leaky split (evidence: `README.md`)
- Correct experiment → Duplicate split strategies: uses corrected split (evidence: `README.md`)
- Leaky experiment → Repeated evaluation: runs evaluation (evidence: `README.md`)
- Correct experiment → Repeated evaluation: runs evaluation (evidence: `README.md`)
- Repeated evaluation → Seven classifiers: creates models (evidence: `src/cancer_ml_leakage_demo/metrics.py`)
- Duplicate split strategies → WDBC loading and split: uses simple split (evidence: `src/cancer_ml_leakage_demo/leakage.py`)
- Leaky experiment → Tables and figures: writes summary (evidence: `README.md`)
- Correct experiment → Tables and figures: writes summary (evidence: `README.md`)
- Accuracy comparison → Tables and figures: reads summaries (evidence: `README.md`)
- Accuracy comparison → Tables and figures: creates comparison (evidence: `README.md`)
