# karunya2006-ux/california_house_price_predictoin architecture

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

- Interactive diagram: https://gitdiagram.com/karunya2006-ux/california_house_price_predictoin
- Repository: https://github.com/karunya2006-ux/california_house_price_predictoin

## Overview

This California housing predictor offers two related workflows: the Streamlit app reads census data, trains a model at startup, and predicts from submitted property details; the separate script trains and serializes model artifacts, or loads them to predict on a test split. The README also documents stratified sampling, preprocessing, Random Forest training, and hosted Streamlit use. The graph reflects the supplied source and tree; serialized files and deployment hosting are documented or runtime outputs, not present in the tree.

Main entry points: [`main.py`](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py) (Training script), [`app.py`](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py) (Streamlit app), [`housing.csv`](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/housing.csv) (Census dataset)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interactive["Prediction app"]
  node_app["Streamlit app<br/>[app.py]"]
  node_app_split["Stratified split<br/>[app.py]"]
  node_app_preprocess["Feature preprocessing<br/>[app.py]"]
  node_app_model["Random Forest model<br/>[app.py]"]
  node_prediction["Price estimate<br/>[app.py]"]
end

subgraph group_training["Training workflow"]
  node_trainer["Training script<br/>[main.py]"]
  node_train_split["Stratified split<br/>[main.py]"]
  node_train_preprocess["Pipeline builder<br/>[main.py]"]
  node_train_model["Random Forest model<br/>[main.py]"]
  node_artifacts["Serialized artifacts"]
  node_test_results["Prediction CSV"]
end

subgraph group_data["Housing data"]
  node_housing["Census dataset<br/>[housing.csv]"]
end

node_user(("Property user"))

node_user -->|"enters features"| node_app
node_app -->|"reads"| node_housing
node_app -->|"samples training data"| node_app_split
node_app -->|"fits and transforms"| node_app_preprocess
node_app -->|"fits and predicts"| node_app_model
node_app -->|"displays"| node_prediction
node_trainer -->|"reads"| node_housing
node_trainer -->|"stratifies"| node_train_split
node_trainer -->|"builds pipeline"| node_train_preprocess
node_trainer -->|"fits model"| node_train_model
node_trainer -->|"serializes"| node_artifacts
node_trainer -->|"loads"| node_artifacts
node_trainer -->|"writes predictions"| node_test_results

click node_app "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py"
click node_app_split "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py"
click node_app_preprocess "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py"
click node_app_model "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py"
click node_prediction "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py"
click node_trainer "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py"
click node_train_split "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py"
click node_train_preprocess "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py"
click node_train_model "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py"
click node_housing "https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/housing.csv"

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_app,node_app_split,node_app_preprocess,node_app_model,node_prediction,node_user toneBlue
class node_trainer,node_train_split,node_train_preprocess,node_train_model,node_artifacts,node_test_results toneAmber
class node_housing toneMint
```

## Components

### Prediction app

- [Streamlit app](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py): `app.py`
- [Stratified split](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py): `app.py`
- [Feature preprocessing](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py): `app.py`
- [Random Forest model](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py): `app.py`
- [Price estimate](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/app.py): `app.py`

### Training workflow

- [Training script](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py): `main.py`
- [Stratified split](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py): `main.py`
- [Pipeline builder](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py): `main.py`
- [Random Forest model](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/main.py): `main.py`
- **Serialized artifacts**
- **Prediction CSV**

### Housing data

- [Census dataset](https://github.com/karunya2006-ux/california_house_price_predictoin/blob/main/housing.csv): `housing.csv`

### Other components

- **Property user**

## Connections

- Property user → Streamlit app: enters features
- Streamlit app → Census dataset: reads
- Streamlit app → Stratified split: samples training data
- Streamlit app → Feature preprocessing: fits and transforms
- Streamlit app → Random Forest model: fits and predicts
- Streamlit app → Price estimate: displays
- Training script → Census dataset: reads
- Training script → Stratified split: stratifies
- Training script → Pipeline builder: builds pipeline
- Training script → Random Forest model: fits model
- Training script → Serialized artifacts: serializes
- Training script → Serialized artifacts: loads
- Training script → Prediction CSV: writes predictions
