# gavinkhung/machine-learning-visualized architecture

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

- Interactive diagram: https://gitdiagram.com/gavinkhung/machine-learning-visualized
- Repository: https://github.com/gavinkhung/machine-learning-visualized

## Overview

Machine Learning Visualized is a Jupyter Book of first-principles machine-learning explanations and training visualizations, with Marimo interactive notebooks. The documented workflow downloads notebooks maintained in separate algorithm repositories, assembles them with this repository’s chapters and book configuration, and builds the book for viewing. The README also documents EPUB output. Source excerpts are limited to requirements.txt, so links between components below rely on README statements; chapter-specific download mappings and implementation details are not verified.

Main entry points: [`download_notebooks.sh`](https://github.com/gavinkhung/machine-learning-visualized/blob/main/download_notebooks.sh) (Notebook download), [`chapter1/interactive_linear_regression.md`](https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter1/interactive_linear_regression.md) (Linear regression), [`chapter3/interactive_logistic_regression.md`](https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter3/interactive_logistic_regression.md) (Logistic regression), [`chapter2`](https://github.com/gavinkhung/machine-learning-visualized/tree/main/chapter2) (Chapter 2 content)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_content["Book content"]
  node_chapter1["Linear regression"]
  node_chapter3_logistic["Logistic regression"]
  node_chapter3_perceptron["Perceptron"]
  node_chapter2["Chapter 2 content"]
  node_chapter4["Chapter 4 content"]
  node_interactive["Marimo examples"]
end

subgraph group_assembly["Book assembly"]
  node_notebook_download["Notebook download"]
  node_toc["Book structure<br/>[_toc.yml]"]
  node_config["Book configuration<br/>[_config.yml]"]
  node_requirements["Python dependencies<br/>[requirements.txt]"]
end

subgraph group_outputs["Published outputs"]
  node_website["Book website<br/>[index.md]"]
  node_epub["EPUB output<br/>[main.epub]"]
end

node_reader(("Reader"))
node_algorithm_repos["Algorithm repositories"]
node_jupyter_book["Jupyter Book"]

node_algorithm_repos -->|"provides notebooks"| node_notebook_download
node_notebook_download -->|"downloads content"| node_chapter1
node_notebook_download -->|"downloads content"| node_chapter2
node_notebook_download -->|"downloads content"| node_chapter3_logistic
node_notebook_download -->|"downloads content"| node_chapter4
node_chapter1 -->|"builds from"| node_jupyter_book
node_chapter3_logistic -->|"builds from"| node_jupyter_book
node_chapter3_perceptron -->|"builds from"| node_jupyter_book
node_chapter2 -->|"builds from"| node_jupyter_book
node_chapter4 -->|"builds from"| node_jupyter_book
node_toc -->|"specifies structure"| node_jupyter_book
node_config -->|"configures"| node_jupyter_book
node_requirements -.->|"declares dependencies"| node_jupyter_book
node_jupyter_book -->|"builds website"| node_website
node_chapter1 -.->|"includes interactive example"| node_interactive
node_reader -.->|"views"| node_website
node_jupyter_book -->|"exports EPUB"| node_epub

click node_notebook_download "https://github.com/gavinkhung/machine-learning-visualized/blob/main/download_notebooks.sh"
click node_chapter1 "https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter1/interactive_linear_regression.md"
click node_chapter3_logistic "https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter3/interactive_logistic_regression.md"
click node_chapter3_perceptron "https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter3/interactive_perceptron.md"
click node_chapter2 "https://github.com/gavinkhung/machine-learning-visualized/tree/main/chapter2"
click node_chapter4 "https://github.com/gavinkhung/machine-learning-visualized/tree/main/chapter4"
click node_toc "https://github.com/gavinkhung/machine-learning-visualized/blob/main/_toc.yml"
click node_config "https://github.com/gavinkhung/machine-learning-visualized/blob/main/_config.yml"
click node_requirements "https://github.com/gavinkhung/machine-learning-visualized/blob/main/requirements.txt"
click node_website "https://github.com/gavinkhung/machine-learning-visualized/blob/main/index.md"
click node_epub "https://github.com/gavinkhung/machine-learning-visualized/blob/main/book/main.epub"
click node_interactive "https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter1/interactive_linear_regression.md"

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_chapter1,node_chapter3_logistic,node_chapter3_perceptron,node_chapter2,node_chapter4,node_interactive toneBlue
class node_notebook_download,node_toc,node_config,node_requirements toneAmber
class node_website,node_epub toneMint
class node_reader,node_algorithm_repos,node_jupyter_book toneIndigo
```

## Components

### Book content

- [Linear regression](https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter1/interactive_linear_regression.md): `chapter1/interactive_linear_regression.md`
- [Logistic regression](https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter3/interactive_logistic_regression.md): `chapter3/interactive_logistic_regression.md`
- [Perceptron](https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter3/interactive_perceptron.md): `chapter3/interactive_perceptron.md`
- [Chapter 2 content](https://github.com/gavinkhung/machine-learning-visualized/tree/main/chapter2): `chapter2`
- [Chapter 4 content](https://github.com/gavinkhung/machine-learning-visualized/tree/main/chapter4): `chapter4`
- [Marimo examples](https://github.com/gavinkhung/machine-learning-visualized/blob/main/chapter1/interactive_linear_regression.md): `chapter1/interactive_linear_regression.md`

### Book assembly

- [Notebook download](https://github.com/gavinkhung/machine-learning-visualized/blob/main/download_notebooks.sh): `download_notebooks.sh`
- [Book structure](https://github.com/gavinkhung/machine-learning-visualized/blob/main/_toc.yml): `_toc.yml`
- [Book configuration](https://github.com/gavinkhung/machine-learning-visualized/blob/main/_config.yml): `_config.yml`
- [Python dependencies](https://github.com/gavinkhung/machine-learning-visualized/blob/main/requirements.txt): `requirements.txt`

### Published outputs

- [Book website](https://github.com/gavinkhung/machine-learning-visualized/blob/main/index.md): `index.md`
- [EPUB output](https://github.com/gavinkhung/machine-learning-visualized/blob/main/book/main.epub): `book/main.epub`

### Other components

- **Reader**
- **Algorithm repositories**
- **Jupyter Book**

## Connections

- Algorithm repositories → Notebook download: provides notebooks (evidence: `README.md`)
- Notebook download → Linear regression: downloads content (evidence: `README.md`)
- Notebook download → Chapter 2 content: downloads content (evidence: `README.md`)
- Notebook download → Logistic regression: downloads content (evidence: `README.md`)
- Notebook download → Chapter 4 content: downloads content (evidence: `README.md`)
- Linear regression → Jupyter Book: builds from (evidence: `README.md`)
- Logistic regression → Jupyter Book: builds from (evidence: `README.md`)
- Perceptron → Jupyter Book: builds from (evidence: `README.md`)
- Chapter 2 content → Jupyter Book: builds from (evidence: `README.md`)
- Chapter 4 content → Jupyter Book: builds from (evidence: `README.md`)
- Book structure → Jupyter Book: specifies structure (evidence: `README.md`)
- Book configuration → Jupyter Book: configures (evidence: `README.md`)
- Python dependencies → Jupyter Book: declares dependencies
- Jupyter Book → Book website: builds website (evidence: `README.md`)
- Linear regression → Marimo examples: includes interactive example
- Reader → Book website: views
- Jupyter Book → EPUB output: exports EPUB (evidence: `README.md`)
