# bashutosh017/iris-flower-variant-prediction architecture

> Architecture diagram of the GitHub repository bashutosh017/iris-flower-variant-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-04). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bashutosh017/iris-flower-variant-prediction
- Repository: https://github.com/bashutosh017/iris-flower-variant-prediction

## Overview

This is a small Iris-species classification app with two workflows: a training script loads and splits the Iris dataset, trains and evaluates a random forest, then saves it; at runtime, users enter four measurements in Streamlit, which sends them to a FastAPI endpoint for prediction. The API loads the saved model and maps its output to a species name. The source excerpts support these links; the serialized model is present in the tree but its contents were not inspected.

Main entry points: [`Iris Flower Model/server.py`](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/server.py) (Prediction endpoint), [`Iris Flower Model/model.py`](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/model.py) (Train and evaluate), [`Iris Flower Model/iris_flower.py`](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/iris_flower.py) (Measurement form), [`Iris Flower Model/iris_model.pkl`](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/iris_model.pkl) (Classifier artifact)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Model training"]
  node_dataset["Iris dataset<br/>[model.py]"]
  node_training_script["Train and evaluate<br/>[model.py]"]
end

subgraph group_runtime["Prediction runtime"]
  node_measurement_ui["Measurement form<br/>[iris_flower.py]"]
  node_prediction_api["Prediction endpoint<br/>[server.py]"]
  node_classifier["Random forest<br/>[server.py]"]
end

subgraph group_artifact["Saved model"]
  node_saved_model[("Classifier artifact<br/>[iris_model.pkl]")]
end

node_operator(("Operator"))
node_user(("Flower user"))

node_operator -->|"runs"| node_training_script
node_training_script -->|"loads"| node_dataset
node_training_script -->|"saves"| node_saved_model
node_user -->|"enters measurements"| node_measurement_ui
node_measurement_ui -->|"posts measurements"| node_prediction_api
node_prediction_api -->|"loads"| node_saved_model
node_prediction_api -->|"predicts with"| node_classifier
node_prediction_api -->|"loads class names"| node_dataset
node_prediction_api -->|"returns species"| node_measurement_ui

click node_dataset "https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/model.py"
click node_training_script "https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/model.py"
click node_saved_model "https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/iris_model.pkl"
click node_measurement_ui "https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/iris_flower.py"
click node_prediction_api "https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/server.py"
click node_classifier "https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/server.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_dataset,node_training_script,node_user toneBlue
class node_measurement_ui,node_prediction_api,node_classifier toneAmber
class node_saved_model toneMint
class node_operator toneIndigo
```

## Components

### Model training

- [Iris dataset](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/model.py): `Iris Flower Model/model.py`
- [Train and evaluate](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/model.py): `Iris Flower Model/model.py`

### Prediction runtime

- [Measurement form](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/iris_flower.py): `Iris Flower Model/iris_flower.py`
- [Prediction endpoint](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/server.py): `Iris Flower Model/server.py`
- [Random forest](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/server.py): `Iris Flower Model/server.py`

### Saved model

- [Classifier artifact](https://github.com/bashutosh017/iris-flower-variant-prediction/blob/main/Iris%20Flower%20Model/iris_model.pkl): `Iris Flower Model/iris_model.pkl`

### Other components

- **Operator**
- **Flower user**

## Connections

- Operator → Train and evaluate: runs (evidence: `Iris Flower Model/model.py`)
- Train and evaluate → Iris dataset: loads (evidence: `Iris Flower Model/model.py`)
- Train and evaluate → Classifier artifact: saves (evidence: `Iris Flower Model/model.py`)
- Flower user → Measurement form: enters measurements (evidence: `Iris Flower Model/iris_flower.py`)
- Measurement form → Prediction endpoint: posts measurements (evidence: `Iris Flower Model/iris_flower.py`)
- Prediction endpoint → Classifier artifact: loads (evidence: `Iris Flower Model/server.py`)
- Prediction endpoint → Random forest: predicts with (evidence: `Iris Flower Model/server.py`)
- Prediction endpoint → Iris dataset: loads class names (evidence: `Iris Flower Model/server.py`)
- Prediction endpoint → Measurement form: returns species (evidence: `Iris Flower Model/iris_flower.py`)
