# dggdaniel/trabajo-de-grado-wilson-gaona architecture

> Architecture diagram of the GitHub repository dggdaniel/trabajo-de-grado-wilson-gaona, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dggdaniel/trabajo-de-grado-wilson-gaona
- Repository: https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona

## Overview

This repository is a reproducible research workflow analyzing subjective well-being in Colombia’s ECV 2024 data. It consolidates and filters survey data, prepares leakage-controlled text, generates embeddings through either OpenAI or local Qwen, evaluates traditional statistical and machine-learning models, and produces thesis figures. The README documents the execution stages and major methods; the excerpts also show specific input/output behavior. Connections between stages follow that documented workflow, while internal relationships in unsampled modules are not inferred.

Main entry points: [`02_generacion_embeddings/02_generar_embeddings_small_api_openai.py`](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/02_generar_embeddings_small_api_openai.py) (OpenAI embeddings), [`02_generacion_embeddings/01_preparacion_datos_serializacion.py`](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/01_preparacion_datos_serializacion.py) (Serialized texts), [`01_procesamiento_datos/01_consolidacion_y_depuracion_ecv2024.py`](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/01_procesamiento_datos/01_consolidacion_y_depuracion_ecv2024.py) (Consolidate and audit), [`02_generacion_embeddings/03_generar_embeddings_qwen3_local.py`](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/03_generar_embeddings_qwen3_local.py) (Local Qwen embeddings)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_processing["Data processing"]
  node_consolidation["Consolidate and audit"]
  node_selection["Select variables"]
end

subgraph group_embedding["Text embeddings"]
  node_serialization["Serialize text"]
  node_openai["OpenAI embeddings"]
  node_qwen["Local Qwen embeddings"]
end

subgraph group_modeling["Model evaluation"]
  node_reference_models["Statistical reference models"]
  node_ml_evaluation["GroupKFold and holdout"]
end

subgraph group_visualization["Thesis figures"]
  node_figures["Figures 1–7<br/>[generar_figuras.py]"]
end

node_researcher(("Researcher"))
node_dane[("DANE microdata")]
node_openai_service{{"OpenAI API"}}
node_processed_data["Processed datasets"]
node_serialized_text["Serialized texts"]
node_embedding_outputs["Embedding outputs"]
node_model_results["Evaluation results"]
node_figure_outputs["Thesis figures<br/>[generar_figuras.py]"]

node_researcher -->|"runs pipeline"| node_consolidation
node_dane -->|"supplies survey data"| node_consolidation
node_consolidation -->|"precedes filtering"| node_selection
node_selection -->|"exports dataset"| node_processed_data
node_processed_data -.->|"feeds preparation"| node_serialization
node_researcher -->|"runs preparation"| node_serialization
node_serialization -->|"writes serialized text"| node_serialized_text
node_serialized_text -->|"provides text"| node_openai
node_serialized_text -.->|"provides text"| node_qwen
node_researcher -->|"runs option"| node_openai
node_researcher -->|"runs alternative"| node_qwen
node_openai -->|"requests embeddings"| node_openai_service
node_openai -->|"exports embeddings"| node_embedding_outputs
node_qwen -->|"exports embeddings"| node_embedding_outputs
node_researcher -->|"runs reference models"| node_reference_models
node_researcher -->|"runs evaluation"| node_ml_evaluation
node_embedding_outputs -.->|"supports model comparisons"| node_ml_evaluation
node_reference_models -.->|"exports tables"| node_model_results
node_ml_evaluation -->|"exports evaluation"| node_model_results
node_researcher -->|"runs figure generation"| node_figures
node_model_results -.->|"informs comparison figure"| node_figures
node_figures -->|"saves figures"| node_figure_outputs

click node_consolidation "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/01_procesamiento_datos/01_consolidacion_y_depuracion_ecv2024.py"
click node_selection "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/01_procesamiento_datos/02_seleccion_y_depuracion_variables.py"
click node_serialization "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/01_preparacion_datos_serializacion.py"
click node_openai "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/02_generar_embeddings_small_api_openai.py"
click node_qwen "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/03_generar_embeddings_qwen3_local.py"
click node_reference_models "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/03_modelos_estadisticos_y_ml/01_modelos_estadisticos_referencia.py"
click node_ml_evaluation "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/03_modelos_estadisticos_y_ml/02_evaluacion_group_kfold.py"
click node_figures "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/04_visualizacion_y_figuras/generar_figuras.py"
click node_processed_data "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/01_procesamiento_datos/02_seleccion_y_depuracion_variables.py"
click node_serialized_text "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/01_preparacion_datos_serializacion.py"
click node_embedding_outputs "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/03_generar_embeddings_qwen3_local.py"
click node_model_results "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/03_modelos_estadisticos_y_ml/02_evaluacion_group_kfold.py"
click node_figure_outputs "https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/04_visualizacion_y_figuras/generar_figuras.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_consolidation,node_selection toneBlue
class node_serialization,node_openai,node_qwen,node_dane toneAmber
class node_reference_models,node_ml_evaluation,node_openai_service toneMint
class node_figures toneRose
class node_researcher toneIndigo
class node_processed_data,node_serialized_text,node_embedding_outputs,node_model_results,node_figure_outputs toneTeal
```

## Components

### Data processing

- [Consolidate and audit](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/01_procesamiento_datos/01_consolidacion_y_depuracion_ecv2024.py): `01_procesamiento_datos/01_consolidacion_y_depuracion_ecv2024.py`
- [Select variables](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/01_procesamiento_datos/02_seleccion_y_depuracion_variables.py): `01_procesamiento_datos/02_seleccion_y_depuracion_variables.py`

### Text embeddings

- [Serialize text](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/01_preparacion_datos_serializacion.py): `02_generacion_embeddings/01_preparacion_datos_serializacion.py`
- [OpenAI embeddings](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/02_generar_embeddings_small_api_openai.py): `02_generacion_embeddings/02_generar_embeddings_small_api_openai.py`
- [Local Qwen embeddings](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/03_generar_embeddings_qwen3_local.py): `02_generacion_embeddings/03_generar_embeddings_qwen3_local.py`

### Model evaluation

- [Statistical reference models](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/03_modelos_estadisticos_y_ml/01_modelos_estadisticos_referencia.py): `03_modelos_estadisticos_y_ml/01_modelos_estadisticos_referencia.py`
- [GroupKFold and holdout](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/03_modelos_estadisticos_y_ml/02_evaluacion_group_kfold.py): `03_modelos_estadisticos_y_ml/02_evaluacion_group_kfold.py`

### Thesis figures

- [Figures 1–7](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/04_visualizacion_y_figuras/generar_figuras.py): `04_visualizacion_y_figuras/generar_figuras.py`

### Other components

- **Researcher**
- **DANE microdata**
- **OpenAI API**
- [Processed datasets](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/01_procesamiento_datos/02_seleccion_y_depuracion_variables.py): `01_procesamiento_datos/02_seleccion_y_depuracion_variables.py`
- [Serialized texts](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/01_preparacion_datos_serializacion.py): `02_generacion_embeddings/01_preparacion_datos_serializacion.py`
- [Embedding outputs](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/02_generacion_embeddings/03_generar_embeddings_qwen3_local.py): `02_generacion_embeddings/03_generar_embeddings_qwen3_local.py`
- [Evaluation results](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/03_modelos_estadisticos_y_ml/02_evaluacion_group_kfold.py): `03_modelos_estadisticos_y_ml/02_evaluacion_group_kfold.py`
- [Thesis figures](https://github.com/dggdaniel/trabajo-de-grado-wilson-gaona/blob/main/04_visualizacion_y_figuras/generar_figuras.py): `04_visualizacion_y_figuras/generar_figuras.py`

## Connections

- Researcher → Consolidate and audit: runs pipeline (evidence: `README.md`)
- DANE microdata → Consolidate and audit: supplies survey data (evidence: `README.md`)
- Consolidate and audit → Select variables: precedes filtering (evidence: `README.md`)
- Select variables → Processed datasets: exports dataset (evidence: `01_procesamiento_datos/02_seleccion_y_depuracion_variables.py`)
- Processed datasets → Serialize text: feeds preparation
- Researcher → Serialize text: runs preparation (evidence: `README.md`)
- Serialize text → Serialized texts: writes serialized text (evidence: `02_generacion_embeddings/01_preparacion_datos_serializacion.py`)
- Serialized texts → OpenAI embeddings: provides text (evidence: `02_generacion_embeddings/02_generar_embeddings_small_api_openai.py`)
- Serialized texts → Local Qwen embeddings: provides text (evidence: `README.md`)
- Researcher → OpenAI embeddings: runs option (evidence: `README.md`)
- Researcher → Local Qwen embeddings: runs alternative (evidence: `README.md`)
- OpenAI embeddings → OpenAI API: requests embeddings (evidence: `02_generacion_embeddings/02_generar_embeddings_small_api_openai.py`)
- OpenAI embeddings → Embedding outputs: exports embeddings (evidence: `02_generacion_embeddings/02_generar_embeddings_small_api_openai.py`)
- Local Qwen embeddings → Embedding outputs: exports embeddings (evidence: `02_generacion_embeddings/03_generar_embeddings_qwen3_local.py`)
- Researcher → Statistical reference models: runs reference models (evidence: `README.md`)
- Researcher → GroupKFold and holdout: runs evaluation (evidence: `README.md`)
- Embedding outputs → GroupKFold and holdout: supports model comparisons
- Statistical reference models → Evaluation results: exports tables (evidence: `README.md`)
- GroupKFold and holdout → Evaluation results: exports evaluation (evidence: `03_modelos_estadisticos_y_ml/02_evaluacion_group_kfold.py`)
- Researcher → Figures 1–7: runs figure generation (evidence: `README.md`)
- Evaluation results → Figures 1–7: informs comparison figure (evidence: `README.md`)
- Figures 1–7 → Thesis figures: saves figures (evidence: `04_visualizacion_y_figuras/generar_figuras.py`)
