# akash-selvaraj-r/kidney-cancer-model architecture

> Architecture diagram of the GitHub repository akash-selvaraj-r/kidney-cancer-model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/akash-selvaraj-r/kidney-cancer-model
- Repository: https://github.com/akash-selvaraj-r/kidney-cancer-model

## Overview

##### Project type and purpose
- This is a data-science / machine-learning pipeline that ingests multi-omics CSV data, preprocesses and integrates it, trains classification and survival models, then evaluates and visualizes results.
- It is not a web app or microservices system but a modular ETL + modeling workflow orchestrated by a single Python entry point.

##### File structure
Top-level directories and files:
- data/
– genomics.csv, transcriptomics.csv, proteomics.csv, labels.csv
- scripts/
– generate_sample_data.py (synthetic data generator)
- src/
– preprocess.py (cleaning, missing value imputation, normalization)
– integrate.py (joins and harmonizes multi-omics)
– models.py (classification models)
– survival.py (survival analysis models)
– evaluate.py (performance metrics, plots)
- notebooks/
– exploratory_analysis.py (ad hoc data exploration & visualization)
- main.py (pipeline orchestrator)
- requirements.txt (external libraries)

##### Key README insights
- Stages: Preprocessing → Integration → Modeling (classification + survival) → Evaluation
- Models: Random Forest, XGBoost, Logistic Regression, MLP, Cox PH, Random Survival Forest
- Outputs: metrics (ROC-AUC, C-index), plots (ROC curves, KM plots, feature importance)
- Customizable parameters via main.py or module-level configs

##### Main components & their interactions
a. Data Ingestion Layer
– Source: CSV files in data/ (or generated via scripts/)
– Script: scripts/generate_sample_data.py
b. Preprocessing Component
– Module: src/preprocess.py
– Input: raw CSVs
– Output: cleaned, normalized intermediate tables
c. Integration Component
– Module: src/integrate.py
– Input: preprocessed tables
– Output: unified multi-omics feature matrix
d. Modeling Components
– Classification: src/models.py
– Survival Analysis: src/survival.py
– Input: integrated feature matrix + labels
– Output: trained model objects, feature importances
e. Evaluation & Visualization
– Module: src/evaluate.py
– Notebooks: notebooks/exploratory_analysis.py (optional deep-dive)
– Output: metrics, plots saved under results/ (or configured output directory)
f. Orchestrator
– main.py calls each module in sequence, passing file paths and parameters

##### Architectural patterns & principles
- Linear modular pipeline (ETL → ML → evaluation)
- Separation of concerns: each src/ script has a single responsibility
- Reproducibility: main.py ensures end-to-end execution with consistent parameterization
- Extensibility points: add new models in src/models.py or new feature-selection logic in preprocess.py

##### Technology stack
- Language: Python 3.x
- Data handling: pandas, numpy
- ML: scikit-learn, XGBoost, lifelines (or similar)
- Visualization: matplotlib, seaborn
- Orchestration: simple scripting via main.py
- Environment: virtualenv or conda (defined in requirements.txt)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Orchestrator
    main["main.py\n(Orchestrator)"]:::orchestrator

    %% Data Ingestion Layer
    subgraph "Data Ingestion Layer"
        direction TB
        rawData[(Raw CSV Files)]:::data
        genData["generate_sample_data.py"]:::module
    end

    %% Preprocessing Component
    subgraph "Preprocessing"
        direction TB
        preprocess["preprocess.py"]:::module
        cleanData[(Cleaned CSV)]:::artifact
    end

    %% Integration Component
    subgraph "Integration"
        direction TB
        integrate["integrate.py"]:::module
        featureMatrix[(Feature Matrix)]:::artifact
    end

    %% Modeling Components
    subgraph "Modeling"
        direction TB
        classMod["models.py\n(Classification)"]:::module
        survMod["survival.py\n(Survival)"]:::module
        modelObjs[(Trained Models)]:::artifact
    end

    %% Evaluation & Visualization
    subgraph "Evaluation & Visualization"
        direction TB
        evaluate["evaluate.py"]:::module
        notebook["exploratory_analysis.py"]:::module
        results[(Metrics & Plots)]:::artifact
    end

    %% Data Flow
    main -->|"start pipeline"| rawData
    rawData -->|"or generate"| genData
    genData -->|"raw CSV"| preprocess
    preprocess -->|"cleaned CSV"| cleanData
    cleanData -->|"input tables"| integrate
    integrate -->|"feature matrix"| featureMatrix
    featureMatrix -->|"features"| classMod
    featureMatrix -->|"features"| survMod
    classMod -->|"classification models"| modelObjs
    survMod -->|"survival models"| modelObjs
    modelObjs -->|"model objects"| evaluate
    evaluate -->|"results"| results
    integrate -->|"for exploration"| notebook

    %% Click Events
    click genData "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/scripts/generate_sample_data.py"
    click rawData "https://github.com/akash-selvaraj-r/kidney-cancer-model/tree/main/data/"
    click preprocess "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/src/preprocess.py"
    click integrate "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/src/integrate.py"
    click classMod "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/src/models.py"
    click survMod "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/src/survival.py"
    click evaluate "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/src/evaluate.py"
    click notebook "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/notebooks/exploratory_analysis.py"
    click main "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/main.py"
    click requirements "https://github.com/akash-selvaraj-r/kidney-cancer-model/blob/main/requirements.txt"

    %% Styles
    classDef data fill:#aed6f1,stroke:#3498db,color:#1b2631;
    classDef module fill:#abebc6,stroke:#27ae60,color:#1b2631;
    classDef artifact fill:#f9e79f,stroke:#f1c40f,color:#1b2631;
    classDef orchestrator fill:#d2b4de,stroke:#8e44ad,color:#1b2631;
```
