# diegoa-rodriguezc/ua-analisis-machine-learning architecture

> Architecture diagram of the GitHub repository diegoa-rodriguezc/ua-analisis-machine-learning, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/diegoa-rodriguezc/ua-analisis-machine-learning
- Repository: https://github.com/diegoa-rodriguezc/ua-analisis-machine-learning

## Overview

##### Project type and purpose
- From the file tree and README, this is a single-page Streamlit ML dashboard (“UA-analisis-machine-learning”).
- It loads a pre-trained model (lgboost_binary.joblib), reads auxiliary JSON values (unique_values_for_streamlit.json), and presents results through Streamlit’s web UI.

##### File structure
- Top-level:
- .devcontainer/ (VS Code dev container definition)
- .streamlit/ (Streamlit config)
- main.py (the Streamlit app entrypoint)
- lgboost_binary.joblib (ML model)
- unique_values_for_streamlit.json (static data for UI drop-downs)
- requirements.txt (dependencies)
- No separate “frontend” vs “backend” directories: it’s a monolithic Python service combining UI and server logic.

##### Main components
a. User / Browser
b. Streamlit Application Server (Python runtime + dependencies)
c. Configuration & Static Assets
- .streamlit/config.toml
- unique_values_for_streamlit.json
d. Pre-trained Model Artifact (lgboost_binary.joblib)
e. Optional Dev Environment Container (.devcontainer)

##### Relationships and interactions
1. The User’s browser sends HTTP/WebSocket requests to the Streamlit server.
2. main.py (controller) loads configuration (.streamlit), static values (JSON), and the ML model.
3. Upon user input, the controller:
- Applies any preprocessing to inputs
- Runs inference via the joblib-loaded model
- Returns predictions and visualizations to the UI
4. The UI updates dynamically in the browser.

##### Architectural patterns & design principles
- Monolithic MVC-style:
- Model: lgboost_binary.joblib
- View: Streamlit front end (main.py’s layout + built-in widgets)
- Controller: main.py’s callback functions
- “Configuration as code”: uses .streamlit/config.toml and requirements.txt
- Reproducible dev environment via .devcontainer

##### Putting it all together
- Inside it, position:

## Diagram (Mermaid)

```mermaid
flowchart TD
    User["User / Browser"]:::actor

    subgraph "UA-analysis ML Service"
        StreamlitApp["Streamlit App (main.py)"]:::process
        Dependencies["Dependencies (requirements.txt)"]:::artifact
        Config["Configuration (.streamlit/config.toml)"]:::config
        StaticData["Static Data (unique_values_for_streamlit.json)"]:::artifact
        Model["Model Artifact (lgboost_binary.joblib)"]:::artifact
    end

    subgraph "Dev Environment"
        DevContainer[".devcontainer (devcontainer.json)"]:::config
    end

    User -->|"HTTP/WebSocket"| StreamlitApp
    StreamlitApp -->|"load/infer"| Model
    StreamlitApp -->|"load values"| StaticData
    StreamlitApp -->|"load settings"| Config
    StreamlitApp -->|"uses packages"| Dependencies
    StreamlitApp -->|"render UI"| User

    click StreamlitApp "https://github.com/diegoa-rodriguezc/ua-analisis-machine-learning/blob/main/main.py"
    click Dependencies "https://github.com/diegoa-rodriguezc/ua-analisis-machine-learning/blob/main/requirements.txt"
    click Config "https://github.com/diegoa-rodriguezc/ua-analisis-machine-learning/blob/main/.streamlit/config.toml"
    click StaticData "https://github.com/diegoa-rodriguezc/ua-analisis-machine-learning/blob/main/unique_values_for_streamlit.json"
    click Model "https://github.com/diegoa-rodriguezc/ua-analisis-machine-learning/blob/main/lgboost_binary.joblib"
    click DevContainer "https://github.com/diegoa-rodriguezc/ua-analisis-machine-learning/blob/main/.devcontainer/devcontainer.json"

    classDef actor fill:#ffd,stroke:#333,stroke-width:2px
    classDef process fill:#bbf,stroke:#333,stroke-width:2px
    classDef artifact fill:#bfb,stroke:#333,stroke-width:2px
    classDef config fill:#ffb,stroke:#333,stroke-width:2px
```
