# tony11montana/ml-on-c- architecture

> Architecture diagram of the GitHub repository tony11montana/ml-on-c-, 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/tony11montana/ml-on-c-
- Repository: https://github.com/tony11montana/ml-on-c-

## Overview

ML is a small interactive C++ classifier. The user selects a digit and supplies training examples; the program combines those with built-in digit patterns, adjusts a shared weight vector until its threshold checks pass, then classifies entered test patterns and prints the result and weights. The README describes the goal as memory saving, but the available source shows no separate storage subsystem. The graph reflects the single sampled source file; no other runtime components or relationships are evidenced.

Main entry points: [`ML/ML.cpp`](https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp) (Program workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_classification["Digit classification"]
  node_training_data["Training data<br/>[ML.cpp]"]
  node_learner["Weight learner<br/>[ML.cpp]"]
  node_classifier["Threshold classifier<br/>[ML.cpp]"]
  node_weights["Weight vector<br/>[ML.cpp]"]
end

subgraph group_runtime["Interactive runtime"]
  node_main["Program workflow<br/>[ML.cpp]"]
end

node_user(("User"))

node_user -->|"enters inputs"| node_main
node_main -->|"builds examples"| node_training_data
node_main -->|"starts training"| node_learner
node_learner -->|"checks examples"| node_training_data
node_learner -->|"updates weights"| node_weights
node_main -->|"classifies inputs"| node_classifier
node_classifier -->|"reads weights"| node_weights
node_classifier -->|"prints predictions"| node_user

click node_main "https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp"
click node_training_data "https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp"
click node_learner "https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp"
click node_classifier "https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp"
click node_weights "https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp"

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_training_data,node_learner,node_classifier,node_weights,node_user toneBlue
class node_main toneAmber
```

## Components

### Digit classification

- [Training data](https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp): `ML/ML.cpp`
- [Weight learner](https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp): `ML/ML.cpp`
- [Threshold classifier](https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp): `ML/ML.cpp`
- [Weight vector](https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp): `ML/ML.cpp`

### Interactive runtime

- [Program workflow](https://github.com/tony11montana/ml-on-c-/blob/master/ML/ML.cpp): `ML/ML.cpp`

### Other components

- **User**

## Connections

- User → Program workflow: enters inputs (evidence: `ML/ML.cpp`)
- Program workflow → Training data: builds examples (evidence: `ML/ML.cpp`)
- Program workflow → Weight learner: starts training (evidence: `ML/ML.cpp`)
- Weight learner → Training data: checks examples (evidence: `ML/ML.cpp`)
- Weight learner → Weight vector: updates weights (evidence: `ML/ML.cpp`)
- Program workflow → Threshold classifier: classifies inputs (evidence: `ML/ML.cpp`)
- Threshold classifier → Weight vector: reads weights (evidence: `ML/ML.cpp`)
- Threshold classifier → User: prints predictions (evidence: `ML/ML.cpp`)
