# parisa-amin/fys-stk4155 architecture

> Architecture diagram of the GitHub repository parisa-amin/fys-stk4155, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/parisa-amin/fys-stk4155
- Repository: https://github.com/parisa-amin/fys-stk4155

## Overview

This is a coursework analysis project, not a deployed application. Its user workflow is to run either author’s notebook, use the shared regression tools, and reproduce analysis figures. The README documents OLS, Ridge, Lasso, bootstrap, k-fold cross-validation, and gradient descent; notebook internals were not provided, so those capabilities are shown at the code-directory level rather than assigned to a particular notebook. Internal tool relationships reflect only the sampled regression source.

Main entry points: [`Project1/code`](https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code) (Polynomial regression), [`Project1/code/Project1.ipynb`](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/Project1.ipynb) (Parisa notebook), [`Project1/code/Project1_gard.ipynb`](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/Project1_gard.ipynb) (Gard notebook), [`Project1/code/regression.py`](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py) (Fit and predict)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Notebook analyses"]
  node_parisa["Parisa notebook<br/>[Project1.ipynb]"]
  node_gard["Gard notebook"]
end

subgraph group_methods["Analysis methods"]
  node_polyreg["Polynomial regression"]
  node_ols["OLS fitting<br/>[regression.py]"]
  node_ridge["Ridge fitting<br/>[regression.py]"]
  node_lasso["Lasso fitting"]
  node_resampling["Bootstrap and CV"]
  node_gradient["Gradient descent"]
end

subgraph group_shared["Shared regression tools"]
  node_data["Runge data<br/>[regression.py]"]
  node_features["Polynomial features<br/>[regression.py]"]
  node_fitpredict["Fit and predict<br/>[regression.py]"]
  node_metrics["Error metrics<br/>[regression.py]"]
end

subgraph group_outputs["Analysis outputs"]
  node_figures["Analysis figures"]
end

node_user(("Coursework user"))

node_user -->|"runs"| node_parisa
node_user -->|"runs"| node_gard
node_parisa -->|"uses shared tools"| node_data
node_gard -->|"uses shared tools"| node_data
node_parisa -->|"analyzes"| node_polyreg
node_gard -->|"analyzes"| node_polyreg
node_polyreg -->|"uses"| node_ols
node_polyreg -->|"uses"| node_ridge
node_polyreg -->|"uses"| node_lasso
node_polyreg -->|"evaluates with"| node_resampling
node_polyreg -->|"optimizes with"| node_gradient
node_data -->|"feeds"| node_features
node_fitpredict -->|"builds"| node_features
node_fitpredict -->|"fits with"| node_ols
node_fitpredict -->|"fits with"| node_ridge
node_parisa -->|"reproduces"| node_figures
node_gard -->|"reproduces"| node_figures

click node_parisa "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/Project1.ipynb"
click node_gard "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/Project1_gard.ipynb"
click node_polyreg "https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code"
click node_ols "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py"
click node_ridge "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py"
click node_lasso "https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code"
click node_resampling "https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code"
click node_gradient "https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code"
click node_data "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py"
click node_features "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py"
click node_fitpredict "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py"
click node_metrics "https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py"
click node_figures "https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/results"

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_parisa,node_gard,node_user toneBlue
class node_polyreg,node_ols,node_ridge,node_lasso,node_resampling,node_gradient toneAmber
class node_data,node_features,node_fitpredict,node_metrics toneMint
class node_figures toneRose
```

## Components

### Notebook analyses

- [Parisa notebook](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/Project1.ipynb): `Project1/code/Project1.ipynb`
- [Gard notebook](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/Project1_gard.ipynb): `Project1/code/Project1_gard.ipynb`

### Analysis methods

- [Polynomial regression](https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code): `Project1/code`
- [OLS fitting](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py): `Project1/code/regression.py`
- [Ridge fitting](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py): `Project1/code/regression.py`
- [Lasso fitting](https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code): `Project1/code`
- [Bootstrap and CV](https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code): `Project1/code`
- [Gradient descent](https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/code): `Project1/code`

### Shared regression tools

- [Runge data](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py): `Project1/code/regression.py`
- [Polynomial features](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py): `Project1/code/regression.py`
- [Fit and predict](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py): `Project1/code/regression.py`
- [Error metrics](https://github.com/parisa-amin/fys-stk4155/blob/main/Project1/code/regression.py): `Project1/code/regression.py`

### Analysis outputs

- [Analysis figures](https://github.com/parisa-amin/fys-stk4155/tree/main/Project1/results): `Project1/results`

### Other components

- **Coursework user**

## Connections

- Coursework user → Parisa notebook: runs (evidence: `README.md`)
- Coursework user → Gard notebook: runs (evidence: `README.md`)
- Parisa notebook → Runge data: uses shared tools (evidence: `README.md`)
- Gard notebook → Runge data: uses shared tools (evidence: `README.md`)
- Parisa notebook → Polynomial regression: analyzes (evidence: `README.md`)
- Gard notebook → Polynomial regression: analyzes (evidence: `README.md`)
- Polynomial regression → OLS fitting: uses (evidence: `README.md`)
- Polynomial regression → Ridge fitting: uses (evidence: `README.md`)
- Polynomial regression → Lasso fitting: uses (evidence: `README.md`)
- Polynomial regression → Bootstrap and CV: evaluates with (evidence: `README.md`)
- Polynomial regression → Gradient descent: optimizes with (evidence: `README.md`)
- Runge data → Polynomial features: feeds (evidence: `Project1/code/regression.py`)
- Fit and predict → Polynomial features: builds (evidence: `Project1/code/regression.py`)
- Fit and predict → OLS fitting: fits with (evidence: `Project1/code/regression.py`)
- Fit and predict → Ridge fitting: fits with (evidence: `Project1/code/regression.py`)
- Parisa notebook → Analysis figures: reproduces (evidence: `README.md`)
- Gard notebook → Analysis figures: reproduces (evidence: `README.md`)
