# zotroneneis/machine_learning_basics architecture

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

- Interactive diagram: https://gitdiagram.com/zotroneneis/machine_learning_basics
- Repository: https://github.com/zotroneneis/machine_learning_basics

## Overview

##### Main Components Organization

a) Learning Algorithms Layer
- Algorithms into categories:
- Regression Models (Linear, Logistic, Bayesian, Softmax)
- Tree-based Models (Decision Trees for Classification and Regression)
- Neural Networks (Perceptron, Simple Neural Net)
- Clustering & Dimensionality Reduction (k-Means, PCA)
- Instance-based Learning (k-Nearest Neighbor)
- Support Vector Machines

b) Data Processing Layer
- Image Preprocessing Pipeline
- Numerical/Categorical Data Preprocessing Pipeline

c) Core Infrastructure Layer
- Jupyter Notebook Environment
- Python Runtime (3.6+)
- Dependencies (from requirements.txt)

##### Component Relationships

- Data flow from preprocessing components to learning algorithms
- Which algorithms can be used with which types of preprocessed data
- Infrastructure layer supporting both preprocessing and algorithms

**[Data Sources] → [Preprocessing Layer] → [Algorithm Layer] → [Output/Predictions]**
- ↑               ↑                      ↑
- [Infrastructure Layer]──────────┘

##### Additional Elements

Annotations indicating:

- Implementation is from scratch (no external ML libraries)
- Educational purpose of each component
- Python version requirements
- Binder integration points

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Data
        D1[("Raw Data")]
    end

    subgraph "Data Processing Layer"
        direction TB
        DP1["Image Preprocessing"]
        DP2["Data Preprocessing"]
        click DP1 "https://github.com/zotroneneis/machine_learning_basics/blob/master/image_preprocessing.ipynb"
        click DP2 "https://github.com/zotroneneis/machine_learning_basics/blob/master/data_preprocessing.ipynb"
    end

    subgraph "Learning Algorithms Layer"
        direction TB
        
        subgraph "Regression Models"
            direction TB
            LR["Linear Regression"]
            LogR["Logistic Regression"]
            BR["Bayesian Regression"]
            SR["Softmax Regression"]
            click LR "https://github.com/zotroneneis/machine_learning_basics/blob/master/linear_regression.ipynb"
            click LogR "https://github.com/zotroneneis/machine_learning_basics/blob/master/logistic_regression.ipynb"
            click BR "https://github.com/zotroneneis/machine_learning_basics/blob/master/bayesian_linear_regression.ipynb"
            click SR "https://github.com/zotroneneis/machine_learning_basics/blob/master/softmax_regression.ipynb"
        end

        subgraph "Tree-based Models"
            direction TB
            CT["Classification Trees"]
            RT["Regression Trees"]
            click CT "https://github.com/zotroneneis/machine_learning_basics/blob/master/decision_tree_classification.ipynb"
            click RT "https://github.com/zotroneneis/machine_learning_basics/blob/master/decision_tree_regression.ipynb"
        end

        subgraph "Neural Networks"
            direction TB
            P["Perceptron"]
            NN["Simple Neural Net"]
            click P "https://github.com/zotroneneis/machine_learning_basics/blob/master/perceptron.ipynb"
            click NN "https://github.com/zotroneneis/machine_learning_basics/blob/master/simple_neural_net.ipynb"
        end

        subgraph "Clustering & Dim Reduction"
            direction TB
            KM["K-Means"]
            PCA["Principal Component Analysis"]
            click KM "https://github.com/zotroneneis/machine_learning_basics/blob/master/kmeans.ipynb"
            click PCA "https://github.com/zotroneneis/machine_learning_basics/blob/master/principal_component_analysis.ipynb"
        end

        subgraph "Instance-based Learning"
            direction TB
            KNN["K-Nearest Neighbor"]
            click KNN "https://github.com/zotroneneis/machine_learning_basics/blob/master/k_nearest_neighbour.ipynb"
        end

        subgraph "Support Vector Machines"
            direction TB
            SVM["SVM"]
            click SVM "https://github.com/zotroneneis/machine_learning_basics/blob/master/support_vector_machines.ipynb"
        end
    end

    subgraph "Core Infrastructure Layer"
        direction TB
        JN["Jupyter Notebook Environment"]
        PY["Python Runtime 3.6+"]
        DEP["Dependencies"]
        click DEP "https://github.com/zotroneneis/machine_learning_basics/blob/master/requirements.txt"
    end

    subgraph Output
        O1[("Predictions/Results")]
    end

    %% Connections
    D1 --> DP1 & DP2
    DP1 & DP2 --> LR & LogR & BR & SR & CT & RT & P & NN & KM & PCA & KNN & SVM
    LR & LogR & BR & SR & CT & RT & P & NN & KM & PCA & KNN & SVM --> O1
    JN & PY & DEP --> DP1 & DP2
    JN & PY & DEP --> LR & LogR & BR & SR & CT & RT & P & NN & KM & PCA & KNN & SVM

    %% Styling
    classDef processing fill:#90EE90
    classDef algorithms fill:#ADD8E6
    classDef infrastructure fill:#D3D3D3
    classDef data fill:#FFA500
    
    class DP1,DP2 processing
    class LR,LogR,BR,SR,CT,RT,P,NN,KM,PCA,KNN,SVM algorithms
    class JN,PY,DEP infrastructure
    class D1,O1 data

    %% Legend
    subgraph Legend
        L1[Algorithms]:::algorithms
        L2[Processing]:::processing
        L3[Infrastructure]:::infrastructure
        L4[("Data")]:::data
    end
```
