# mprodriguezj/previomachinelearning architecture

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

- Interactive diagram: https://gitdiagram.com/mprodriguezj/previomachinelearning
- Repository: https://github.com/mprodriguezj/previomachinelearning

## Overview

##### Project type and purpose
- This is an interactive Machine-Learning evaluation tool built with Streamlit.
- It focuses on data ingestion, exploratory data analysis (EDA), training decision-tree and ensemble classifiers, and visualizing metrics (confusion matrix, ROC/AUC, etc.).

##### File structure
- Top‐level files:
- app.py – Streamlit entry point (UI layer)
- requirements.txt – Python dependencies (pandas, scikit-learn, streamlit, matplotlib/seaborn, etc.)
- data/ – folder holding CSV datasets
- modules/ – core processing layer, subdivided into:
- data_loader.py – data ingestion and validation
- eda.py – exploratory data analysis functions
- decision_tree.py – training/evaluation of decision-tree classifiers
- ensemble_models.py – training/evaluation of RandomForest, AdaBoost, GradientBoosting, Bagging

##### README for insights
- Confirms technology stack: Python ≥3.10, Streamlit UI, scikit-learn models, pandas for data, Matplotlib/Seaborn for plots.
- Workflow: user uploads or selects a dataset → EDA → model selection (decision tree or ensemble variants) → training & metrics → plots and tables in the browser.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Presentation Layer
    subgraph "Presentation Layer"
        App["Streamlit UI\n(app.py)"]:::ui
    end

    %% Processing Layer
    subgraph "Processing Layer"
        Init["modules/__init__.py"]:::processing
        DataLoader["data_loader.py\n(Ingestion & Validation)"]:::processing
        EDA["eda.py\n(Exploratory Data Analysis)"]:::processing
        DecisionTree["decision_tree.py\n(Decision Tree Trainer)"]:::processing
        EnsembleModels["ensemble_models.py\n(Ensemble Models Trainer)"]:::processing
    end

    %% Data Layer
    subgraph "Data Layer"
        DataStore(("CSV Data Store\ndata/")):::data
    end

    %% External Dependencies
    subgraph "External Dependencies"
        Pandas["pandas"]:::external
        Scikit["scikit-learn"]:::external
        StreamlitLib["streamlit"]:::external
        PlotLib["matplotlib/seaborn"]:::external
    end

    %% Config & Documentation
    subgraph "Config & Documentation"
        Requirements["requirements.txt"]:::config
        Readme["README.md"]:::config
        GitIgnore[".gitignore"]:::config
    end

    %% User Interaction
    User(("User")):::external

    %% Flows
    User -->|"interacts with"| App
    App -->|"calls"| DataLoader
    DataLoader -->|"reads CSV"| DataStore
    DataLoader -->|"returns DataFrame"| App
    App -->|"requests EDA"| EDA
    EDA -->|"returns stats & plots"| App
    App -->|"trains Decision Tree"| DecisionTree
    DecisionTree -->|"returns model & metrics"| App
    App -->|"trains Ensemble Models"| EnsembleModels
    EnsembleModels -->|"returns models & metrics"| App

    %% External usage by modules
    DataLoader --> Pandas
    EDA --> Pandas
    EDA --> PlotLib
    DecisionTree --> Scikit
    EnsembleModels --> Scikit
    App --> StreamlitLib

    %% Click Events
    click App "https://github.com/mprodriguezj/previomachinelearning/blob/main/app.py"
    click DataLoader "https://github.com/mprodriguezj/previomachinelearning/blob/main/modules/data_loader.py"
    click EDA "https://github.com/mprodriguezj/previomachinelearning/blob/main/modules/eda.py"
    click DecisionTree "https://github.com/mprodriguezj/previomachinelearning/blob/main/modules/decision_tree.py"
    click EnsembleModels "https://github.com/mprodriguezj/previomachinelearning/blob/main/modules/ensemble_models.py"
    click Init "https://github.com/mprodriguezj/previomachinelearning/blob/main/modules/__init__.py"
    click DataStore "https://github.com/mprodriguezj/previomachinelearning/tree/main/data/"
    click Requirements "https://github.com/mprodriguezj/previomachinelearning/blob/main/requirements.txt"
    click Readme "https://github.com/mprodriguezj/previomachinelearning/blob/main/README.md"
    click GitIgnore "https://github.com/mprodriguezj/previomachinelearning/blob/main/.gitignore"

    %% Styles
    classDef ui fill:#D0E6FA,stroke:#333,stroke-width:1px
    classDef processing fill:#D5F5D5,stroke:#333,stroke-width:1px
    classDef data fill:#FDEBD0,stroke:#333,stroke-width:1px
    classDef external fill:#E0E0E0,stroke:#333,stroke-width:1px
    classDef config fill:#E8E8E8,stroke:#333,stroke-width:1px
```
