# mohitpunglia/machine_learning_algorithms architecture

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

- Interactive diagram: https://gitdiagram.com/mohitpunglia/machine_learning_algorithms
- Repository: https://github.com/mohitpunglia/machine_learning_algorithms

## Overview

##### Project type and purpose
- This is an **educational, open-source Python library** of machine learning algorithms implemented from scratch, organized as a collection of Jupyter Notebooks and supporting data files.
- Its goal is to help learners step through core ML algorithms (regression, classification, clustering, dimensionality reduction) with clean, modular code and visual explanations.

##### File structure
- Top-level folders each correspond to an algorithm or algorithm family (e.g., “Decision Tree”, “KNN”, “Gradient Boosting”, “Clustering”, etc.).
- Inside each folder: one or more `.ipynb` notebooks implementing the algorithm, plus any CSV datasets used for demos.
- A few special files/directories:
- `streamlit-decision-tree/` (an interactive Streamlit app for decision trees)
- `README.md` describing overall purpose, features, and installation.

##### README for additional insights
- Emphasizes **clean modular code**, **Jupyter notebooks** for step-by-step execution, **included datasets**, and **mathematical derivations**.
- No heavy external “service” or microservice architecture—main dependencies are Python libraries (NumPy, pandas, matplotlib, etc.) and Jupyter.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% User Interface Layer
    subgraph "User Interface Layer"
        direction TB
        bagging_nb["bagging_classification_demo.ipynb"]:::ui
        dbscan_nb["DBSCAN.ipynb"]:::ui
        agglom_nb["agglomerative-clustering.ipynb"]:::ui
        dt_cls_nb["decision_tree_classification.ipynb"]:::ui
        dt_reg_nb["decision_tree_regression.ipynb"]:::ui
        gb_nb["gradient_boosting.ipynb"]:::ui
        kmeans_nb["K_means_clustering.ipynb"]:::ui
        knn_nb["KNN.ipynb"]:::ui
        pos_nb["POS_tagging.ipynb"]:::ui
        pca_demo_nb["PCA_Demo.ipynb"]:::ui
        pca_impl_nb["pca_implementation_steps.ipynb"]:::ui
        xgb_cls_nb["xgboost_classification.ipynb"]:::ui
        xgb_reg_nb["xgboost_regression.ipynb"]:::ui
        streamlit_app["app.py (Streamlit)"]:::ui
    end

    %% Algorithm Modules
    subgraph "ML Algorithm Modules"
        direction TB
        BaggingModule["Bagging/"]:::alg
        ClusteringModule["Clustering/"]:::alg
        DecisionTreeModule["Decision Tree/"]:::alg
        GradientBoostingModule["Gradient Boosting/"]:::alg
        KMeansModule["K Means Clustering/"]:::alg
        KNNModule["KNN/"]:::alg
        NLPModule["NLP/"]:::alg
        PCAModule["PCA/"]:::alg
        RandomForestModule["Random Forest/"]:::alg
        SimpleLinearModule["Simple_Linear_Regression/"]:::alg
        XGBoostModule["XGBoost/"]:::alg
    end

    %% Data Store
    subgraph "Data Store"
        direction TB
        hier_data["hierarchical-clustering-with-python-and-scikit-learn-shopping-data.csv"]:::data
        dt_ads_data["Social_Netwoks_Ads.csv"]:::data
        dt_boston_data["boston_house_prices.csv"]:::data
        kmeans_data["student_clustering.csv"]:::data
        knn_data["Social_Netwoks_Ads.csv"]:::data
        rf_heart["heart.csv"]:::data
        rf_train["train.csv"]:::data
        slr_data["placement.csv"]:::data
        xgb_data["titanic.csv"]:::data
    end

    %% Core Libraries & Dependencies
    subgraph "Core Dependencies"
        direction TB
        Python["Python 3.8+"]:::lib
        Numpy["NumPy"]:::lib
        Pandas["pandas"]:::lib
        Matplotlib["Matplotlib/Seaborn"]:::lib
        Sklearn["scikit-learn"]:::lib
    end

    %% Repository
    Repo["GitHub Repository (README.md)"]:::repo

    %% Relationships: Notebooks to Modules
    bagging_nb -->|imports| BaggingModule
    dbscan_nb -->|imports| ClusteringModule
    agglom_nb -->|imports| ClusteringModule
    dt_cls_nb -->|imports| DecisionTreeModule
    dt_reg_nb -->|imports| DecisionTreeModule
    gb_nb -->|imports| GradientBoostingModule
    kmeans_nb -->|imports| KMeansModule
    knn_nb -->|imports| KNNModule
    pos_nb -->|imports| NLPModule
    pca_demo_nb -->|imports| PCAModule
    pca_impl_nb -->|imports| PCAModule
    xgb_cls_nb -->|imports| XGBoostModule
    xgb_reg_nb -->|imports| XGBoostModule
    streamlit_app -->|calls| DecisionTreeModule

    %% Modules to Data Store
    BaggingModule -->|loads| hier_data
    ClusteringModule -->|loads| hier_data
    DecisionTreeModule -->|loads| dt_ads_data
    DecisionTreeModule -->|loads| dt_boston_data
    KMeansModule -->|loads| kmeans_data
    KNNModule -->|loads| knn_data
    RandomForestModule -->|loads| rf_heart
    RandomForestModule -->|loads| rf_train
    SimpleLinearModule -->|loads| slr_data
    XGBoostModule -->|loads| xgb_data

    %% Modules to Libraries
    BaggingModule -->|uses| Python
    BaggingModule -->|uses| Numpy
    BaggingModule -->|uses| Pandas
    BaggingModule -->|uses| Matplotlib
    BaggingModule -->|uses| Sklearn
    ClusteringModule -->|uses| Numpy
    ClusteringModule -->|uses| Pandas
    ClusteringModule -->|uses| Matplotlib
    DecisionTreeModule -->|uses| Numpy
    DecisionTreeModule -->|uses| Pandas
    GradientBoostingModule -->|uses| Numpy
    GradientBoostingModule -->|uses| Pandas
    KMeansModule -->|uses| Numpy
    KNNModule -->|uses| Numpy
    NLPModule -->|uses| Numpy
    PCAModule -->|uses| Numpy
    RandomForestModule -->|uses| Numpy
    SimpleLinearModule -->|uses| Numpy
    XGBoostModule -->|uses| Numpy

    %% Repo connections
    Repo -->|contains| bagging_nb
    Repo -->|contains| dbscan_nb
    Repo -->|contains| agglom_nb
    Repo -->|contains| dt_cls_nb
    Repo -->|contains| dt_reg_nb
    Repo -->|contains| gb_nb
    Repo -->|contains| kmeans_nb
    Repo -->|contains| knn_nb
    Repo -->|contains| pos_nb
    Repo -->|contains| pca_demo_nb
    Repo -->|contains| pca_impl_nb
    Repo -->|contains| xgb_cls_nb
    Repo -->|contains| xgb_reg_nb
    Repo -->|contains| streamlit_app
    Repo -->|contains| BaggingModule
    Repo -->|contains| ClusteringModule
    Repo -->|contains| DecisionTreeModule
    Repo -->|contains| GradientBoostingModule
    Repo -->|contains| KMeansModule
    Repo -->|contains| KNNModule
    Repo -->|contains| NLPModule
    Repo -->|contains| PCAModule
    Repo -->|contains| RandomForestModule
    Repo -->|contains| SimpleLinearModule
    Repo -->|contains| XGBoostModule

    %% Click Events for Notebooks
    click bagging_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Bagging/bagging_classification_demo.ipynb"
    click dbscan_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Clustering/DBSCAN.ipynb"
    click agglom_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Clustering/agglomerative-clustering.ipynb"
    click dt_cls_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Decision Tree/decision_tree_classification.ipynb"
    click dt_reg_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Decision Tree/decision_tree_regression.ipynb"
    click gb_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Gradient Boosting/gradient_boosting.ipynb"
    click kmeans_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/K Means Clustering/K_means_clustering.ipynb"
    click knn_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/KNN/KNN.ipynb"
    click pos_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/NLP/POS_tagging.ipynb"
    click pca_demo_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/PCA/PCA_Demo.ipynb"
    click pca_impl_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/PCA/pca_implementation_steps.ipynb"
    click xgb_cls_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/XGBoost/xgboost_classification.ipynb"
    click xgb_reg_nb "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/XGBoost/xgboost_regression.ipynb"

    %% Click Events for Streamlit App
    click streamlit_app "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Decision Tree/streamlit-decision-tree/app.py"

    %% Click Events for Modules
    click BaggingModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/Bagging/"
    click ClusteringModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/Clustering/"
    click DecisionTreeModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/Decision Tree/"
    click GradientBoostingModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/Gradient Boosting/"
    click KMeansModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/K Means Clustering/"
    click KNNModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/KNN/"
    click NLPModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/NLP/"
    click PCAModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/PCA/"
    click RandomForestModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/Random Forest/"
    click SimpleLinearModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/Simple_Linear_Regression/"
    click XGBoostModule "https://github.com/mohitpunglia/machine_learning_algorithms/tree/main/XGBoost/"

    %% Click Events for Data Store
    click hier_data "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Clustering/hierarchical-clustering-with-python-and-scikit-learn-shopping-data.csv"
    click dt_ads_data "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Decision Tree/Social_Netwoks_Ads.csv"
    click dt_boston_data "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Decision Tree/boston_house_prices.csv"
    click kmeans_data "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/K Means Clustering/student_clustering.csv"
    click knn_data "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/KNN/Social_Netwoks_Ads.csv"
    click rf_heart "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Random Forest/heart.csv"
    click rf_train "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Random Forest/train.csv"
    click slr_data "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/Simple_Linear_Regression/placement.csv"
    click xgb_data "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/XGBoost/titanic.csv"

    %% Click Event for README
    click Repo "https://github.com/mohitpunglia/machine_learning_algorithms/blob/main/README.md"

    %% Styles
    classDef ui fill:#f9f,stroke:#333
    classDef alg fill:#bbf,stroke:#333
    classDef data fill:#bfb,stroke:#333,shape:cylinder
    classDef lib fill:#fbb,stroke:#333,shape:parallelogram
    classDef repo fill:#eee,stroke:#333,stroke-dasharray: 5 5
```
