# diego-0010619/tesis-tsfm-retail-moda-databricks architecture

> Architecture diagram of the GitHub repository diego-0010619/tesis-tsfm-retail-moda-databricks, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/diego-0010619/tesis-tsfm-retail-moda-databricks
- Repository: https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks

## Overview

Este repositorio implementa un pipeline de pronóstico de demanda semanal para retail de moda en Databricks: ingiere datos de H&M y VISUELLE, construye un panel semanal con regímenes de demanda, compara modelos estadísticos, LightGBM y TSFM, y consolida métricas y decisiones de inventario. El README documenta el flujo Medallion; los notebooks muestreados precisan sus etapas de modelado y evaluación. Los extractos no permiten verificar todas las conexiones internas ni el detalle de cada integración, por lo que se omiten esas relaciones.

Main entry points: [`notebooks/02_silver_weekly_panel_and_regimes.py`](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/02_silver_weekly_panel_and_regimes.py) (Panel y regímenes Silver), [`notebooks/03_baselines_stats_and_lightgbm.py`](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/03_baselines_stats_and_lightgbm.py) (Baselines y LightGBM), [`notebooks/04_tsfm_zeroshot_and_covariates.py`](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/04_tsfm_zeroshot_and_covariates.py) (Pronósticos Gold), [`notebooks/05_tsfm_lora_finetuning.py`](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/05_tsfm_lora_finetuning.py) (Adaptación LoRA)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Ingesta y preparación"]
  node_setup["Entorno de prueba"]
  node_bronze[("Ingesta Bronze")]
  node_silver[("Panel y regímenes Silver")]
end

subgraph group_forecast["Pronóstico"]
  node_baseline["Baselines y LightGBM"]
  node_tsfm["TSFM zero-shot"]
  node_lora["Adaptación LoRA"]
  node_gold_forecasts[("Pronósticos Gold")]
end

subgraph group_evaluation["Evaluación y decisión"]
  node_evaluation["Evaluación y matriz"]
  node_gold_results[("Resultados Gold")]
end

subgraph group_shared["Servicios compartidos"]
  node_regime["Clasificador de regímenes"]
  node_config["Configuración experimental<br/>[config.py]"]
  node_metrics["Métricas e inventario"]
  node_cost["Perfilado de costos<br/>[cost_profiler.py]"]
end

node_operator(("Investigador"))
node_external_data[("Datos H&amp;M y VISUELLE")]

node_operator -->|"inicia"| node_setup
node_external_data -->|"ingesta datos"| node_bronze
node_bronze -->|"prepara panel"| node_silver
node_silver -->|"alimenta modelos"| node_baseline
node_silver -->|"alimenta modelos"| node_tsfm
node_silver -->|"alimenta adaptación"| node_lora
node_silver -->|"resume regímenes"| node_regime
node_baseline -->|"guarda pronósticos"| node_gold_forecasts
node_tsfm -->|"guarda pronósticos"| node_gold_forecasts
node_lora -->|"actualiza pronósticos"| node_gold_forecasts
node_gold_forecasts -->|"evalúa resultados"| node_evaluation
node_evaluation -->|"calcula métricas"| node_metrics
node_evaluation -->|"persiste resultados"| node_gold_results
node_baseline -->|"calcula métricas"| node_metrics
node_baseline -->|"perfila cómputo"| node_cost
node_tsfm -->|"perfila cómputo"| node_cost
node_lora -->|"perfila cómputo"| node_cost

click node_setup "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/00_setup_and_smoke_test_generator.py"
click node_bronze "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/01_bronze_ingestion_hm_visuelle.py"
click node_silver "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/02_silver_weekly_panel_and_regimes.py"
click node_regime "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/regime_classifier.py"
click node_baseline "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/03_baselines_stats_and_lightgbm.py"
click node_tsfm "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/04_tsfm_zeroshot_and_covariates.py"
click node_lora "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/05_tsfm_lora_finetuning.py"
click node_gold_forecasts "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/04_tsfm_zeroshot_and_covariates.py"
click node_evaluation "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/06_gold_evaluation_and_decision_matrix.py"
click node_gold_results "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/06_gold_evaluation_and_decision_matrix.py"
click node_config "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/config.py"
click node_metrics "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/metrics_and_inventory.py"
click node_cost "https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/cost_profiler.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_setup,node_bronze,node_silver toneBlue
class node_baseline,node_tsfm,node_lora,node_gold_forecasts,node_external_data toneAmber
class node_evaluation,node_gold_results toneMint
class node_regime,node_config,node_metrics,node_cost toneRose
class node_operator toneIndigo
```

## Components

### Ingesta y preparación

- [Entorno de prueba](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/00_setup_and_smoke_test_generator.py): `notebooks/00_setup_and_smoke_test_generator.py`
- [Ingesta Bronze](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/01_bronze_ingestion_hm_visuelle.py): `notebooks/01_bronze_ingestion_hm_visuelle.py`
- [Panel y regímenes Silver](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/02_silver_weekly_panel_and_regimes.py): `notebooks/02_silver_weekly_panel_and_regimes.py`

### Pronóstico

- [Baselines y LightGBM](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/03_baselines_stats_and_lightgbm.py): `notebooks/03_baselines_stats_and_lightgbm.py`
- [TSFM zero-shot](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/04_tsfm_zeroshot_and_covariates.py): `notebooks/04_tsfm_zeroshot_and_covariates.py`
- [Adaptación LoRA](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/05_tsfm_lora_finetuning.py): `notebooks/05_tsfm_lora_finetuning.py`
- [Pronósticos Gold](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/04_tsfm_zeroshot_and_covariates.py): `notebooks/04_tsfm_zeroshot_and_covariates.py`

### Evaluación y decisión

- [Evaluación y matriz](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/06_gold_evaluation_and_decision_matrix.py): `notebooks/06_gold_evaluation_and_decision_matrix.py`
- [Resultados Gold](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/notebooks/06_gold_evaluation_and_decision_matrix.py): `notebooks/06_gold_evaluation_and_decision_matrix.py`

### Servicios compartidos

- [Clasificador de regímenes](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/regime_classifier.py): `src/fashion_tsfm/regime_classifier.py`
- [Configuración experimental](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/config.py): `src/fashion_tsfm/config.py`
- [Métricas e inventario](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/metrics_and_inventory.py): `src/fashion_tsfm/metrics_and_inventory.py`
- [Perfilado de costos](https://github.com/diego-0010619/tesis-tsfm-retail-moda-databricks/blob/main/src/fashion_tsfm/cost_profiler.py): `src/fashion_tsfm/cost_profiler.py`

### Other components

- **Investigador**
- **Datos H&M y VISUELLE**

## Connections

- Investigador → Entorno de prueba: inicia
- Datos H&M y VISUELLE → Ingesta Bronze: ingesta datos (evidence: `notebooks/01_bronze_ingestion_hm_visuelle.py`)
- Ingesta Bronze → Panel y regímenes Silver: prepara panel (evidence: `README.md`)
- Panel y regímenes Silver → Baselines y LightGBM: alimenta modelos (evidence: `notebooks/03_baselines_stats_and_lightgbm.py`)
- Panel y regímenes Silver → TSFM zero-shot: alimenta modelos (evidence: `notebooks/04_tsfm_zeroshot_and_covariates.py`)
- Panel y regímenes Silver → Adaptación LoRA: alimenta adaptación (evidence: `notebooks/05_tsfm_lora_finetuning.py`)
- Panel y regímenes Silver → Clasificador de regímenes: resume regímenes (evidence: `notebooks/02_silver_weekly_panel_and_regimes.py`)
- Baselines y LightGBM → Pronósticos Gold: guarda pronósticos (evidence: `notebooks/03_baselines_stats_and_lightgbm.py`)
- TSFM zero-shot → Pronósticos Gold: guarda pronósticos (evidence: `notebooks/04_tsfm_zeroshot_and_covariates.py`)
- Adaptación LoRA → Pronósticos Gold: actualiza pronósticos (evidence: `notebooks/05_tsfm_lora_finetuning.py`)
- Pronósticos Gold → Evaluación y matriz: evalúa resultados (evidence: `README.md`)
- Evaluación y matriz → Métricas e inventario: calcula métricas (evidence: `notebooks/06_gold_evaluation_and_decision_matrix.py`)
- Evaluación y matriz → Resultados Gold: persiste resultados (evidence: `notebooks/06_gold_evaluation_and_decision_matrix.py`)
- Baselines y LightGBM → Métricas e inventario: calcula métricas (evidence: `notebooks/03_baselines_stats_and_lightgbm.py`)
- Baselines y LightGBM → Perfilado de costos: perfila cómputo (evidence: `notebooks/03_baselines_stats_and_lightgbm.py`)
- TSFM zero-shot → Perfilado de costos: perfila cómputo (evidence: `notebooks/04_tsfm_zeroshot_and_covariates.py`)
- Adaptación LoRA → Perfilado de costos: perfila cómputo (evidence: `notebooks/05_tsfm_lora_finetuning.py`)
