# vasaviosc/ai-ml architecture

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

- Interactive diagram: https://gitdiagram.com/vasaviosc/ai-ml
- Repository: https://github.com/vasaviosc/ai-ml

## Overview

This repository is a collection of hands-on AI/ML projects, rather than one integrated application. Its visible user-facing workflows are house-price prediction through a Streamlit form and spam classification through a command-line prompt; the spam project also includes model training and evaluation. The house training notebook is present but unsampled, so its connections to the dataset and saved model are not asserted. The spam training and prediction scripts refer to a model file that is not present in the tree.

Main entry points: [`house_price_prediction/src/predict.py`](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/predict.py) (Prediction form), [`spam-email/src/predict.py`](https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/predict.py) (Message prompt), [`house_price_prediction/models/house_price_model.pkl`](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/models/house_price_model.pkl) (Price model), [`spam-email/src/train.py`](https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/train.py) (Model training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_housing["House-price prediction"]
  node_house_form["Prediction form<br/>[predict.py]"]
  node_house_features["Feature preparation<br/>[predict.py]"]
  node_house_model["Price model"]
  node_house_columns["Feature columns"]
  node_house_result["Price result<br/>[predict.py]"]
  node_house_training["Model training<br/>[train.ipynb]"]
  node_house_data["Housing data<br/>[data.csv]"]
end

subgraph group_spam["Spam classification"]
  node_spam_trainer["Model training<br/>[train.py]"]
  node_spam_data["Labeled messages<br/>[spam.csv]"]
  node_spam_model["Classifier artifact"]
  node_spam_prompt["Message prompt<br/>[predict.py]"]
  node_spam_classifier["Spam classification<br/>[predict.py]"]
  node_spam_result["Label and confidence<br/>[predict.py]"]
end

node_house_user(("House-price user"))
node_spam_user(("Message sender"))

node_house_user -->|"enters details"| node_house_form
node_house_form -->|"prepares inputs"| node_house_features
node_house_features -->|"aligns columns"| node_house_columns
node_house_form -->|"loads model"| node_house_model
node_house_features -->|"predicts price"| node_house_model
node_house_form -->|"displays prediction"| node_house_result
node_house_data -.-> node_house_training
node_house_training -.-> node_house_model
node_spam_trainer -->|"reads messages"| node_spam_data
node_spam_trainer -->|"saves classifier"| node_spam_model
node_spam_user -->|"enters message"| node_spam_prompt
node_spam_prompt -->|"loads classifier"| node_spam_model
node_spam_prompt -->|"classifies message"| node_spam_classifier
node_spam_classifier -->|"prints label"| node_spam_result

click node_house_form "https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/predict.py"
click node_house_features "https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/predict.py"
click node_house_model "https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/models/house_price_model.pkl"
click node_house_columns "https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/models/feature_columns.pkl"
click node_house_result "https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/predict.py"
click node_house_training "https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/train.ipynb"
click node_house_data "https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/data.csv"
click node_spam_trainer "https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/train.py"
click node_spam_data "https://github.com/vasaviosc/ai-ml/blob/main/spam-email/data/spam.csv"
click node_spam_prompt "https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/predict.py"
click node_spam_classifier "https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/predict.py"
click node_spam_result "https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/predict.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_house_form,node_house_features,node_house_model,node_house_columns,node_house_result,node_house_training,node_house_data,node_house_user toneBlue
class node_spam_trainer,node_spam_data,node_spam_model,node_spam_prompt,node_spam_classifier,node_spam_result toneAmber
class node_spam_user toneIndigo
```

## Components

### House-price prediction

- [Prediction form](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/predict.py): `house_price_prediction/src/predict.py`
- [Feature preparation](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/predict.py): `house_price_prediction/src/predict.py`
- [Price model](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/models/house_price_model.pkl): `house_price_prediction/models/house_price_model.pkl`
- [Feature columns](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/models/feature_columns.pkl): `house_price_prediction/models/feature_columns.pkl`
- [Price result](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/predict.py): `house_price_prediction/src/predict.py`
- [Model training](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/src/train.ipynb): `house_price_prediction/src/train.ipynb`
- [Housing data](https://github.com/vasaviosc/ai-ml/blob/main/house_price_prediction/data.csv): `house_price_prediction/data.csv`

### Spam classification

- [Model training](https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/train.py): `spam-email/src/train.py`
- [Labeled messages](https://github.com/vasaviosc/ai-ml/blob/main/spam-email/data/spam.csv): `spam-email/data/spam.csv`
- **Classifier artifact**
- [Message prompt](https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/predict.py): `spam-email/src/predict.py`
- [Spam classification](https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/predict.py): `spam-email/src/predict.py`
- [Label and confidence](https://github.com/vasaviosc/ai-ml/blob/main/spam-email/src/predict.py): `spam-email/src/predict.py`

### Other components

- **House-price user**
- **Message sender**

## Connections

- House-price user → Prediction form: enters details (evidence: `house_price_prediction/src/predict.py`)
- Prediction form → Feature preparation: prepares inputs (evidence: `house_price_prediction/src/predict.py`)
- Feature preparation → Feature columns: aligns columns (evidence: `house_price_prediction/src/predict.py`)
- Prediction form → Price model: loads model (evidence: `house_price_prediction/src/predict.py`)
- Feature preparation → Price model: predicts price (evidence: `house_price_prediction/src/predict.py`)
- Prediction form → Price result: displays prediction (evidence: `house_price_prediction/src/predict.py`)
- Housing data → Model training
- Model training → Price model
- Model training → Labeled messages: reads messages (evidence: `spam-email/src/train.py`)
- Model training → Classifier artifact: saves classifier (evidence: `spam-email/src/train.py`)
- Message sender → Message prompt: enters message (evidence: `spam-email/src/predict.py`)
- Message prompt → Classifier artifact: loads classifier (evidence: `spam-email/src/predict.py`)
- Message prompt → Spam classification: classifies message (evidence: `spam-email/src/predict.py`)
- Spam classification → Label and confidence: prints label (evidence: `spam-email/src/predict.py`)
