# g-shreekant/heart-disease-prediction-using-machine-learning architecture

> Architecture diagram of the GitHub repository g-shreekant/heart-disease-prediction-using-machine-learning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-08). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/g-shreekant/heart-disease-prediction-using-machine-learning
- Repository: https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning

## Overview

##### Project type and purpose
- This is a data-science / machine-learning pipeline encapsulated in a Jupyter notebook.
- Purpose: ingest a heart-disease dataset (heart.csv), preprocess it, train multiple classification models (Logistic Regression, Naive Bayes, SVM, KNN, Decision Tree, Random Forest, XGBoost, ANN) and evaluate their performance to predict presence of heart disease.

##### File structure
- Top level contains:
- Heart_disease_prediction.ipynb – the main notebook with all preprocessing, model training and evaluation code
- heart.csv – the raw dataset
- README.md – project description and list of algorithms used
- No subfolders, no separate “src” or “modules”—all code lives in the notebook.

##### README for additional insights
- Confirms the eight classification algorithms
- Mentions data-processing steps (cleaning, feature selection) before model training
- Target metric is accuracy (Random Forest achieved 95%)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Pipeline stages
    Data_Source["Data Source: heart.csv"]:::data
    Preprocessing["Data Ingestion & Preprocessing"]:::preprocess
    Feature["Feature Engineering & Selection"]:::preprocess

    subgraph "Model Training"
        LR["Logistic Regression"]:::training
        NB["Naive Bayes"]:::training
        SVM["SVM"]:::training
        KNN["K-Nearest Neighbors"]:::training
        DT["Decision Tree"]:::training
        RF["Random Forest"]:::training
        XGB["XGBoost"]:::training
        ANN["Artificial Neural Network"]:::training
    end

    Evaluation["Model Evaluation & Comparison"]:::evaluation
    Best["Best Model Selection"]:::evaluation
    Inference["Prediction / Inference"]:::inference
    Visualization["Visualization & Reporting"]:::inference
    Documentation["Project Documentation: README.md"]:::doc

    %% Flow
    Data_Source -->|ingest| Preprocessing
    Preprocessing -->|clean & transform| Feature
    Feature --> LR
    Feature --> NB
    Feature --> SVM
    Feature --> KNN
    Feature --> DT
    Feature --> RF
    Feature --> XGB
    Feature --> ANN

    LR --> Evaluation
    NB --> Evaluation
    SVM --> Evaluation
    KNN --> Evaluation
    DT --> Evaluation
    RF --> Evaluation
    XGB --> Evaluation
    ANN --> Evaluation

    Evaluation -->|"select best"| Best
    Best --> Inference
    Inference --> Visualization

    %% Documentation link
    Documentation

    %% Click Events
    click Data_Source "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/heart.csv"
    click Preprocessing "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click Feature "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click LR "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click NB "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click SVM "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click KNN "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click DT "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click RF "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click XGB "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click ANN "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click Evaluation "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click Best "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click Inference "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click Visualization "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/Heart_disease_prediction.ipynb"
    click Documentation "https://github.com/g-shreekant/heart-disease-prediction-using-machine-learning/blob/master/README.md"

    %% Styles
    classDef data fill:#cce5ff,stroke:#004085,color:#004085;
    classDef preprocess fill:#b8daff,stroke:#004085,color:#004085;
    classDef training fill:#d4edda,stroke:#155724,color:#155724;
    classDef evaluation fill:#fff3cd,stroke:#856404,color:#856404;
    classDef inference fill:#e2d9f3,stroke:#4b0082,color:#4b0082;
    classDef doc fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
```
