# kirillkaszycki/mle-project-sprint-1-v001 architecture

> Architecture diagram of the GitHub repository kirillkaszycki/mle-project-sprint-1-v001, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kirillkaszycki/mle-project-sprint-1-v001
- Repository: https://github.com/kirillkaszycki/mle-project-sprint-1-v001

## Overview

This repository is a student project for building an apartment-price prediction pipeline. Its Airflow workflows prepare and clean apartment data in PostgreSQL; a separate DVC-oriented workflow extracts the cleaned table, fits a regression model, and evaluates it with cross-validation. The graph captures the data operations visible in the excerpts. The DVC configuration and Airflow deployment wiring are present in the tree but were not sampled, so links that depend on them are not asserted.

Main entry points: [`part2_dvc/scripts/fit.py`](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/fit.py) (Fit model), [`part2_dvc/scripts/evaluate.py`](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/evaluate.py) (Cross-validation), [`part2_dvc/scripts/data.py`](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/data.py) (Extract data), [`part1_airflow/dags/etl_dag.py`](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part1_airflow/dags/etl_dag.py) (Prepare dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_airflow["Airflow ETL"]
  node_prepare["Prepare dataset<br/>[etl_dag.py]"]
  node_clean["Clean dataset<br/>[clean_data_dag.py]"]
end

subgraph group_model["Model workflow"]
  node_extract["Extract data<br/>[data.py]"]
  node_csv["Initial data CSV<br/>[data.py]"]
  node_fit["Fit model<br/>[fit.py]"]
  node_model_file["Fitted model<br/>[fit.py]"]
  node_evaluate["Cross-validation<br/>[evaluate.py]"]
  node_results["CV results<br/>[evaluate.py]"]
end

subgraph group_integrations["External systems"]
  node_callbacks["Telegram callbacks<br/>[messages.py]"]
  node_postgres[("PostgreSQL")]
end

node_scheduler(("Airflow scheduler"))

node_scheduler -.->|"schedules"| node_prepare
node_scheduler -.->|"schedules"| node_clean
node_prepare -->|"reads and writes"| node_postgres
node_clean -->|"reads and writes"| node_postgres
node_prepare -->|"registers callbacks"| node_callbacks
node_clean -->|"registers callbacks"| node_callbacks
node_callbacks -.->|"reports status"| node_scheduler
node_extract -->|"reads cleaned table"| node_postgres
node_extract -->|"writes CSV"| node_csv
node_fit -->|"reads CSV"| node_csv
node_fit -->|"serializes model"| node_model_file
node_evaluate -->|"reads data"| node_csv
node_evaluate -->|"loads model"| node_model_file
node_evaluate -->|"writes metrics"| node_results
node_extract -.->|"workflow order"| node_fit
node_fit -.->|"workflow order"| node_evaluate

click node_prepare "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part1_airflow/dags/etl_dag.py"
click node_clean "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part1_airflow/dags/clean_data_dag.py"
click node_callbacks "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part1_airflow/plugins/steps/messages.py"
click node_extract "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/data.py"
click node_csv "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/data.py"
click node_fit "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/fit.py"
click node_model_file "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/fit.py"
click node_evaluate "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/evaluate.py"
click node_results "https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/evaluate.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_prepare,node_clean toneBlue
class node_extract,node_csv,node_fit,node_model_file,node_evaluate,node_results toneAmber
class node_callbacks,node_postgres toneMint
class node_scheduler toneRose
```

## Components

### Airflow ETL

- [Prepare dataset](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part1_airflow/dags/etl_dag.py): `part1_airflow/dags/etl_dag.py`
- [Clean dataset](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part1_airflow/dags/clean_data_dag.py): `part1_airflow/dags/clean_data_dag.py`

### Model workflow

- [Extract data](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/data.py): `part2_dvc/scripts/data.py`
- [Initial data CSV](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/data.py): `part2_dvc/scripts/data.py`
- [Fit model](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/fit.py): `part2_dvc/scripts/fit.py`
- [Fitted model](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/fit.py): `part2_dvc/scripts/fit.py`
- [Cross-validation](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/evaluate.py): `part2_dvc/scripts/evaluate.py`
- [CV results](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part2_dvc/scripts/evaluate.py): `part2_dvc/scripts/evaluate.py`

### External systems

- [Telegram callbacks](https://github.com/kirillkaszycki/mle-project-sprint-1-v001/blob/main/part1_airflow/plugins/steps/messages.py): `part1_airflow/plugins/steps/messages.py`
- **PostgreSQL**

### Other components

- **Airflow scheduler**

## Connections

- Airflow scheduler → Prepare dataset: schedules
- Airflow scheduler → Clean dataset: schedules
- Prepare dataset → PostgreSQL: reads and writes (evidence: `part1_airflow/dags/etl_dag.py`)
- Clean dataset → PostgreSQL: reads and writes (evidence: `part1_airflow/dags/clean_data_dag.py`)
- Prepare dataset → Telegram callbacks: registers callbacks (evidence: `part1_airflow/dags/etl_dag.py`)
- Clean dataset → Telegram callbacks: registers callbacks (evidence: `part1_airflow/dags/clean_data_dag.py`)
- Telegram callbacks → Airflow scheduler: reports status
- Extract data → PostgreSQL: reads cleaned table (evidence: `part2_dvc/scripts/data.py`)
- Extract data → Initial data CSV: writes CSV (evidence: `part2_dvc/scripts/data.py`)
- Fit model → Initial data CSV: reads CSV (evidence: `part2_dvc/scripts/fit.py`)
- Fit model → Fitted model: serializes model (evidence: `part2_dvc/scripts/fit.py`)
- Cross-validation → Initial data CSV: reads data (evidence: `part2_dvc/scripts/evaluate.py`)
- Cross-validation → Fitted model: loads model (evidence: `part2_dvc/scripts/evaluate.py`)
- Cross-validation → CV results: writes metrics (evidence: `part2_dvc/scripts/evaluate.py`)
- Extract data → Fit model: workflow order
- Fit model → Cross-validation: workflow order
