# anagonbu/proyecto_google architecture

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

- Interactive diagram: https://gitdiagram.com/anagonbu/proyecto_google
- Repository: https://github.com/anagonbu/proyecto_google

## Overview

##### Project Type and Purpose
- This is a data‐analysis & machine‐learning prototype project built around the “Medical Cost Personal Dataset” (a Kaggle CSV).
- The goal is to explore patient attributes (age, gender, BMI, children, smoking, region), build a predictive model for annual medical expenditure, and deliver visual/interactive reports (Tableau dashboard, R Markdown/PDF outputs).

##### File‐Structure Analysis
- Top‐level files:
- 00-insurance.csv → raw data source
- 01-EDA.ipynb → exploratory data analysis (Python notebook)
- 02_resume_model_…ipynb (2 variants) → modeling pipelines (Python notebooks)
- google2.Rmd → R Markdown report
- google2.html / .pdf → rendered report outputs
- Google_tableau.pdf → exported visualization/dashboard
- No “src/” or production “app/” directories, indicating this is an analytics prototype rather than a deployed service.

a. Data Layer
– Raw dataset (00-insurance.csv) stored in a flat‐file (or local CSV store).
– (Optional) SQL staging area for initial querying/preprocessing.
b. Processing & Modeling Layer
– EDA Notebook (01-EDA.ipynb): data cleaning, feature exploration, visualization code (Python + Seaborn).
– Modeling Notebooks (02_resume_model…ipynb): feature engineering, model training (scikit-learn, lazypredict), model evaluation.
c. Reporting & Visualization Layer
– R Markdown (google2.Rmd) → renders to HTML/PDF reports summarizing findings and metrics.
– Tableau Dashboard (Google_tableau.pdf and public link) for interactive visualizations.
d. Outputs & Deliverables
– Final deliverables: PDF presentations, HTML reports, Tableau interactive dashboard.
– Model performance metrics (R², MSE) and proposed campaign strategy.

##### Architectural Patterns & Design Principles
- Modular separation of concerns:
- Ingestion/EDA
- Modeling & evaluation
- Reporting & visualization
- Reproducibility: notebooks capture code & narrative; R Markdown ties code to report; version control via file naming.

##### Technologies & Frameworks
- Python ecosystem: Jupyter notebooks, pandas, Seaborn, scikit-learn, lazypredict
- R ecosystem: R Markdown (knitr)
- SQL (ad hoc queries)
- Tableau for interactive BI
- Output formats: HTML, PDF

##### Essential Elements Checklist
- [ ] Raw dataset component with path/name
- [ ] EDA process block
- [ ] Modeling pipeline block
- [ ] Reporting blocks (R Markdown, Tableau)
- [ ] Output artifacts (PDF, HTML, Dashboard link)
- [ ] Technology annotations (e.g., Python, R)

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Data Layer
    subgraph "Data Layer"
        direction TB
        RawData["00-insurance.csv"]:::data
        SQLStaging["SQL Staging Area"]:::data
    end

    %% Processing & Modeling Layer
    subgraph "Processing & Modeling" 
        direction TB
        EDA["01-EDA.ipynb\n(pandas, seaborn)"]:::process
        ModelA["02_resume_model_(2)_(2).ipynb\n(scikit-learn, lazypredict)"]:::process
        ModelB["02_resume_model_(2)_(2)_(2).ipynb\n(scikit-learn, lazypredict)"]:::process
    end

    %% Reporting & Visualization Layer
    subgraph "Reporting & Visualization"
        direction TB
        Rmd["google2.Rmd\n(R Markdown)"]:::report
        HTMLReport["google2.html\n(HTML Report)"]:::report
        PDFReport["google2.pdf\n(PDF Report)"]:::report
        TableauExport["Google_tableau.pdf\n(Tableau Dashboard)"]:::report
    end

    %% Supporting Assets
    subgraph "Supporting Assets"
        direction TB
        Images["img/"]:::support
        Metadata["README.md"]:::support
    end

    %% Data Flows
    RawData -->|ingest raw CSV| EDA
    SQLStaging -->|optional query| EDA
    EDA -->|cleaned dataframe| ModelA
    EDA -->|cleaned dataframe| ModelB
    ModelA -->|model.pkl & metrics.csv| Rmd
    ModelA -->|model.pkl & metrics.csv| TableauExport
    ModelB -->|model.pkl & metrics.csv| Rmd
    ModelB -->|model.pkl & metrics.csv| TableauExport
    Rmd -->|renders to| HTMLReport
    Rmd -->|renders to| PDFReport
    TableauExport -->|delivers dashboard| Metadata
    HTMLReport -->|delivers report| Metadata
    PDFReport -->|delivers report| Metadata

    %% Click Events
    click RawData "https://github.com/anagonbu/proyecto_google/blob/main/00-insurance.csv"
    click EDA "https://github.com/anagonbu/proyecto_google/blob/main/01-EDA.ipynb"
    click ModelA "https://github.com/anagonbu/proyecto_google/blob/main/02_resume_model_(2)_(2).ipynb"
    click ModelB "https://github.com/anagonbu/proyecto_google/blob/main/02_resume_model_(2)_(2)_(2).ipynb"
    click Rmd "https://github.com/anagonbu/proyecto_google/blob/main/google2.Rmd"
    click HTMLReport "https://github.com/anagonbu/proyecto_google/blob/main/google2.html"
    click PDFReport "https://github.com/anagonbu/proyecto_google/blob/main/google2.pdf"
    click TableauExport "https://github.com/anagonbu/proyecto_google/blob/main/Google_tableau.pdf"
    click Images "https://github.com/anagonbu/proyecto_google/tree/main/img/"
    click Metadata "https://github.com/anagonbu/proyecto_google/blob/main/README.md"

    %% Styles
    classDef data fill:#ddeeff,stroke:#3399ff,stroke-width:2px;
    classDef process fill:#ddffdd,stroke:#33cc33,stroke-width:2px;
    classDef report fill:#ffebcc,stroke:#ff9933,stroke-width:2px;
    classDef support fill:#f0e6ff,stroke:#884dff,stroke-width:2px;
```
