# chjonathan44-bit/iris-flask-predictor- architecture

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

- Interactive diagram: https://gitdiagram.com/chjonathan44-bit/iris-flask-predictor-
- Repository: https://github.com/chjonathan44-bit/iris-flask-predictor-

## Overview

This is a Flask Iris-species classifier with a separate model-training script. A user submits four flower measurements through the web page; the app scales them, predicts a class, and displays the species or an error. Training loads the Iris dataset, prepares and scales its features and labels, trains and evaluates a neural network, then saves the model and scaler consumed by the app. The source shows these workflows in app.py and train.py; the template’s contents and runtime behavior were not sampled.

Main entry points: [`harsha/app.py`](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py) (Request handler), [`harsha/train.py`](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py) (Data preparation), [`harsha/templates/index.html`](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/templates/index.html) (Input form), [`harsha/iris_model.h5`](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/iris_model.h5) (Saved model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_web_handler["Request handler<br/>[app.py]"]
  node_form["Input form<br/>[index.html]"]
end

subgraph group_inference["Prediction"]
  node_feature_scaler["Feature scaler<br/>[app.py]"]
  node_classifier["Neural classifier<br/>[app.py]"]
  node_species_map["Species mapping<br/>[app.py]"]
  node_model_artifact["Saved model<br/>[iris_model.h5]"]
  node_scaler_artifact["Saved scaler<br/>[scaler.save]"]
end

subgraph group_training["Model training"]
  node_iris_data["Iris dataset<br/>[train.py]"]
  node_data_prep["Data preparation<br/>[train.py]"]
  node_network_training["Network training<br/>[train.py]"]
  node_evaluation["Model evaluation<br/>[train.py]"]
end

node_user(("User"))

node_user -->|"enters measurements"| node_form
node_user -->|"submits form"| node_web_handler
node_web_handler -->|"renders"| node_form
node_web_handler -->|"scales inputs"| node_feature_scaler
node_web_handler -->|"predicts class"| node_classifier
node_web_handler -->|"maps class"| node_species_map
node_iris_data -->|"prepares features"| node_data_prep
node_data_prep -->|"supplies data"| node_network_training
node_network_training -->|"evaluates model"| node_evaluation
node_network_training -->|"saves model"| node_model_artifact
node_data_prep -->|"saves scaler"| node_scaler_artifact
node_web_handler -->|"loads model"| node_model_artifact
node_web_handler -->|"loads scaler"| node_scaler_artifact

click node_web_handler "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py"
click node_form "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/templates/index.html"
click node_feature_scaler "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py"
click node_classifier "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py"
click node_species_map "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py"
click node_iris_data "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py"
click node_data_prep "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py"
click node_network_training "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py"
click node_evaluation "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py"
click node_model_artifact "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/iris_model.h5"
click node_scaler_artifact "https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/scaler.save"

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_web_handler,node_form,node_user toneBlue
class node_feature_scaler,node_classifier,node_species_map,node_model_artifact,node_scaler_artifact toneAmber
class node_iris_data,node_data_prep,node_network_training,node_evaluation toneMint
```

## Components

### Web interface

- [Request handler](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py): `harsha/app.py`
- [Input form](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/templates/index.html): `harsha/templates/index.html`

### Prediction

- [Feature scaler](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py): `harsha/app.py`
- [Neural classifier](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py): `harsha/app.py`
- [Species mapping](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/app.py): `harsha/app.py`
- [Saved model](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/iris_model.h5): `harsha/iris_model.h5`
- [Saved scaler](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/scaler.save): `harsha/scaler.save`

### Model training

- [Iris dataset](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py): `harsha/train.py`
- [Data preparation](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py): `harsha/train.py`
- [Network training](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py): `harsha/train.py`
- [Model evaluation](https://github.com/chjonathan44-bit/iris-flask-predictor-/blob/main/harsha/train.py): `harsha/train.py`

### Other components

- **User**

## Connections

- User → Input form: enters measurements
- User → Request handler: submits form (evidence: `harsha/app.py`)
- Request handler → Input form: renders (evidence: `harsha/app.py`)
- Request handler → Feature scaler: scales inputs (evidence: `harsha/app.py`)
- Request handler → Neural classifier: predicts class (evidence: `harsha/app.py`)
- Request handler → Species mapping: maps class (evidence: `harsha/app.py`)
- Iris dataset → Data preparation: prepares features (evidence: `harsha/train.py`)
- Data preparation → Network training: supplies data (evidence: `harsha/train.py`)
- Network training → Model evaluation: evaluates model (evidence: `harsha/train.py`)
- Network training → Saved model: saves model (evidence: `harsha/train.py`)
- Data preparation → Saved scaler: saves scaler (evidence: `harsha/train.py`)
- Request handler → Saved model: loads model (evidence: `harsha/app.py`)
- Request handler → Saved scaler: loads scaler (evidence: `harsha/app.py`)
