# phuctran33/regression-lab01 architecture

> Architecture diagram of the GitHub repository phuctran33/regression-lab01, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phuctran33/regression-lab01
- Repository: https://github.com/phuctran33/regression-lab01

## Overview

This is a teaching project for predicting penguin body mass with linear-regression models. The user workflow is to explore the data and choose common features, run and compare four model variants on a shared train/test split, then inspect predictions and plots in the notebook and prepare a report and demo. The shared Python module loads the CSV, preprocesses features, fits models, and calculates metrics; each model module delegates to it. Notebook internals were not sampled, so notebook connections below rely on README statements rather than inspected code.

Main entry points: [`source/lab01.ipynb`](https://github.com/phuctran33/regression-lab01/blob/main/source/lab01.ipynb) (Explore and predict), [`source/modeling.py`](https://github.com/phuctran33/regression-lab01/blob/main/source/modeling.py) (Shared modeling pipeline), [`source/models/m1.py`](https://github.com/phuctran33/regression-lab01/blob/main/source/models/m1.py) (Model M1), [`source/models/m2.py`](https://github.com/phuctran33/regression-lab01/blob/main/source/models/m2.py) (Model M2)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Notebook workflow"]
  node_notebook["Explore and predict<br/>[lab01.ipynb]"]
  node_dataset["Penguins CSV<br/>[penguins.csv]"]
end

subgraph group_modeling["Model implementations"]
  node_shared["Shared modeling pipeline<br/>[modeling.py]"]
  node_m1["Model M1<br/>[m1.py]"]
  node_m2["Model M2<br/>[m2.py]"]
  node_m3["Model M3<br/>[m3.py]"]
  node_m4["Model M4<br/>[m4.py]"]
end

subgraph group_outputs["Results and reporting"]
  node_report["Report template<br/>[report-template.md]"]
  node_results["Metrics and plots<br/>[lab01.ipynb]"]
end

node_user(("Project user"))

node_user -->|"runs and explores"| node_notebook
node_shared -->|"loads CSV"| node_dataset
node_notebook -->|"uses shared data"| node_dataset
node_notebook -->|"uses pipeline"| node_shared
node_m1 -->|"builds and runs"| node_shared
node_m2 -->|"builds and runs"| node_shared
node_m3 -->|"builds and runs"| node_shared
node_m4 -->|"builds and runs"| node_shared
node_notebook -->|"compares models"| node_m1
node_notebook -->|"compares models"| node_m2
node_notebook -->|"compares models"| node_m3
node_notebook -->|"compares models"| node_m4
node_shared -->|"computes metrics"| node_results
node_notebook -->|"shows predictions and plots"| node_results
node_results -->|"informs report"| node_report

click node_notebook "https://github.com/phuctran33/regression-lab01/blob/main/source/lab01.ipynb"
click node_dataset "https://github.com/phuctran33/regression-lab01/blob/main/data/penguins.csv"
click node_shared "https://github.com/phuctran33/regression-lab01/blob/main/source/modeling.py"
click node_m1 "https://github.com/phuctran33/regression-lab01/blob/main/source/models/m1.py"
click node_m2 "https://github.com/phuctran33/regression-lab01/blob/main/source/models/m2.py"
click node_m3 "https://github.com/phuctran33/regression-lab01/blob/main/source/models/m3.py"
click node_m4 "https://github.com/phuctran33/regression-lab01/blob/main/source/models/m4.py"
click node_report "https://github.com/phuctran33/regression-lab01/blob/main/report/report-template.md"
click node_results "https://github.com/phuctran33/regression-lab01/blob/main/source/lab01.ipynb"

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_notebook,node_dataset,node_user toneBlue
class node_shared,node_m1,node_m2,node_m3,node_m4 toneAmber
class node_report,node_results toneMint
```

## Components

### Notebook workflow

- [Explore and predict](https://github.com/phuctran33/regression-lab01/blob/main/source/lab01.ipynb): `source/lab01.ipynb`
- [Penguins CSV](https://github.com/phuctran33/regression-lab01/blob/main/data/penguins.csv): `data/penguins.csv`

### Model implementations

- [Shared modeling pipeline](https://github.com/phuctran33/regression-lab01/blob/main/source/modeling.py): `source/modeling.py`
- [Model M1](https://github.com/phuctran33/regression-lab01/blob/main/source/models/m1.py): `source/models/m1.py`
- [Model M2](https://github.com/phuctran33/regression-lab01/blob/main/source/models/m2.py): `source/models/m2.py`
- [Model M3](https://github.com/phuctran33/regression-lab01/blob/main/source/models/m3.py): `source/models/m3.py`
- [Model M4](https://github.com/phuctran33/regression-lab01/blob/main/source/models/m4.py): `source/models/m4.py`

### Results and reporting

- [Report template](https://github.com/phuctran33/regression-lab01/blob/main/report/report-template.md): `report/report-template.md`
- [Metrics and plots](https://github.com/phuctran33/regression-lab01/blob/main/source/lab01.ipynb): `source/lab01.ipynb`

### Other components

- **Project user**

## Connections

- Project user → Explore and predict: runs and explores (evidence: `README.md`)
- Shared modeling pipeline → Penguins CSV: loads CSV (evidence: `source/modeling.py`)
- Explore and predict → Penguins CSV: uses shared data (evidence: `README.md`)
- Explore and predict → Shared modeling pipeline: uses pipeline (evidence: `README.md`)
- Model M1 → Shared modeling pipeline: builds and runs (evidence: `source/models/m1.py`)
- Model M2 → Shared modeling pipeline: builds and runs (evidence: `source/models/m2.py`)
- Model M3 → Shared modeling pipeline: builds and runs (evidence: `source/models/m3.py`)
- Model M4 → Shared modeling pipeline: builds and runs (evidence: `source/models/m4.py`)
- Explore and predict → Model M1: compares models (evidence: `README.md`)
- Explore and predict → Model M2: compares models (evidence: `README.md`)
- Explore and predict → Model M3: compares models (evidence: `README.md`)
- Explore and predict → Model M4: compares models (evidence: `README.md`)
- Shared modeling pipeline → Metrics and plots: computes metrics (evidence: `source/modeling.py`)
- Explore and predict → Metrics and plots: shows predictions and plots (evidence: `README.md`)
- Metrics and plots → Report template: informs report (evidence: `README.md`)
