# shivamshinde123/thyroid_disease_detection_internship architecture

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

- Interactive diagram: https://gitdiagram.com/shivamshinde123/thyroid_disease_detection_internship
- Repository: https://github.com/shivamshinde123/thyroid_disease_detection_internship

## Overview

##### Project type and purpose
- This is an end-to-end machine learning application for thyroid disease detection.
- It includes a data pipeline (data ingestion, validation, preprocessing), model training with MLflow tracking, and a Streamlit-based web application for serving predictions.

##### File structure
- Top-level data directories:
- Data/Raw_data – stores raw CSV from UCI
- Data/Processed_Data – stores cleaned train/validation splits
- Preprocess_pipeline – stores serialized transformers (label encoder, preprocessing pipeline)
- Models – stores the trained model artifact (model.joblib)
- Logs – per-stage log files
- Metrics – evaluation outputs (classification_report.csv, metrics.json)
- mlruns – MLflow experiment artifacts and metrics
- src – contains all Python code:
- step0_utility_functions, step1_make_dataset, step2_data_validation, step3/4 preprocessing stages, step5_model_training
- webapp.py (Streamlit front end)
- tests for each pipeline stage
- config files: params.yaml, requirements.txt, .streamlit/config.toml

##### README for additional insights
- Describes project flow: data ingestion → validation → preprocessing → training/evaluation → web deployment
- Lists technologies: Python, Pandas, NumPy, scikit-learn, MLflow, Pydantic, Streamlit

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Data Sources
    subgraph "Data Sources"
        RawCSV["Raw CSV File"]:::dataStore
    end
    click RawCSV "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/Data/Raw_data/ThyroidRawData.csv"

    %% Raw Data Store
    RawDataStore["Raw Data Store\n(Data/Raw_data)"]:::dataStore
    click RawDataStore "https://github.com/shivamshinde123/thyroid_disease_detection_internship/tree/main/Data/Raw_data"

    RawCSV --> Ingest

    %% Pipeline Processes
    subgraph "Pipeline Processes"
        Ingest["Data Ingestion"]:::process
        Validate["Data Validation"]:::process
        Pre1["Preprocessing Stage 1"]:::process
        Pre2["Preprocessing Stage 2"]:::process
        Train["Model Training & Evaluation"]:::process
    end
    click Ingest "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/src/step1_make_dataset.py"
    click Validate "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/src/step2_training_Data_Validation.py"
    click Pre1 "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/src/step3_data_preprocessing_stage1.py"
    click Pre2 "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/src/step4_data_preprocessing_stage2.py"
    click Train "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/src/step5_model_training.py"

    RawDataStore --> Ingest
    Ingest --> ProcessedStore

    ProcessedStore["Processed Data Store\n(Data/Processed_Data)"]:::dataStore
    click ProcessedStore "https://github.com/shivamshinde123/thyroid_disease_detection_internship/tree/main/Data/Processed_Data"

    ProcessedStore --> Validate
    Validate --> Pre1
    Pre1 --> Pre2
    Pre2 --> Train

    %% Configuration Files
    subgraph "Configuration"
        Params["params.yaml"]:::config
        StreamConfig[".streamlit/config.toml"]:::config
        Req["requirements.txt"]:::config
    end
    click Params "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/params.yaml"
    click StreamConfig "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/.streamlit/config.toml"
    click Req "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/requirements.txt"

    Params --> Ingest
    Params --> Validate
    Params --> Pre1
    Params --> Pre2
    Params --> Train

    %% Artifact Stores
    subgraph "Artifact Stores"
        Transformers1["le_transformer.pkl"]:::artifact
        Transformers2["preprocess_pipeline.pkl"]:::artifact
        ModelArt["model.joblib"]:::artifact
        MetricsCSV["classification_report.csv"]:::artifact
        MetricsJSON["metrics.json"]:::artifact
        MLflowStore["MLflow Backend Store\n(mlruns/)"]:::artifact
        LogsDir["Logs Store\n(Logs/)"]:::logs
    end
    click Transformers1 "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/Preprocess_pipeline/le_transforme.pkl"
    click Transformers2 "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/Preprocess_pipeline/preprocess_pipeline.pkl"
    click ModelArt "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/Models/model.joblib"
    click MetricsCSV "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/Metrics/classification_report.csv"
    click MetricsJSON "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/Metrics/metrics.json"
    click MLflowStore "https://github.com/shivamshinde123/thyroid_disease_detection_internship/tree/main/mlruns/"
    click LogsDir "https://github.com/shivamshinde123/thyroid_disease_detection_internship/tree/main/Logs/"

    Pre1 --> Transformers1
    Pre2 --> Transformers2
    Pre2 --> Train
    Train --> ModelArt
    Train --> MetricsCSV
    Train --> MetricsJSON
    Train --> MLflowStore

    Ingest --> LogsDir
    Validate --> LogsDir
    Pre1 --> LogsDir
    Pre2 --> LogsDir
    Train --> LogsDir

    %% Serving Layer
    subgraph "Serving Layer"
        WebApp["Streamlit Web App"]:::ui
    end
    click WebApp "https://github.com/shivamshinde123/thyroid_disease_detection_internship/blob/main/src/webapp.py"

    Transformers1 --> WebApp
    Transformers2 --> WebApp
    ModelArt --> WebApp
    StreamConfig --> WebApp

    %% External User
    User["End User Browser"]:::external

    User --> WebApp
    WebApp --> User

    %% Styles
    classDef dataStore fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef process fill:#90EE90,stroke:#000,stroke-width:1px
    classDef artifact fill:#FFA500,stroke:#000,stroke-width:1px
    classDef ui fill:#DDA0DD,stroke:#000,stroke-width:1px
    classDef config fill:#FFFFE0,stroke:#000,stroke-width:1px
    classDef logs fill:#F5F5F5,stroke:#000,stroke-width:1px
```
