# 2400080269/homeapplications architecture

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

- Interactive diagram: https://gitdiagram.com/2400080269/homeapplications
- Repository: https://github.com/2400080269/homeapplications

## Overview

This repository builds and serves California block-group home-value estimates. The training workflow loads and audits census housing data, creates a holdout split, engineers leakage-aware geospatial features, tunes and benchmarks models, calibrates 90% conformal intervals, evaluates results, and exports artifacts. At runtime, CLI, REST, and dashboard interfaces submit housing features to a shared predictor for point estimates, intervals, and local TreeSHAP explanations. The README documents the broader capabilities; some training and serving links rely on those explicit statements because the supplied source excerpts are partial.

Main entry points: [`src/inference.py`](https://github.com/2400080269/homeapplications/blob/main/src/inference.py) (House price predictor), [`train.py`](https://github.com/2400080269/homeapplications/blob/main/train.py) (Training orchestrator), [`src/data_loader.py`](https://github.com/2400080269/homeapplications/blob/main/src/data_loader.py) (Data audit and split), [`app/dashboard.py`](https://github.com/2400080269/homeapplications/blob/main/app/dashboard.py) (Streamlit dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_training["Training and evaluation"]
  node_train_cli["Training orchestrator<br/>[train.py]"]
  node_loader["Data audit and split<br/>[data_loader.py]"]
  node_features["Geospatial features<br/>[features.py]"]
  node_modeling["Tune and train models<br/>[modeling.py]"]
  node_evaluation["Benchmarks and diagnostics<br/>[evaluation.py]"]
end

subgraph group_serving["Inference core"]
  node_predictor["House price predictor<br/>[inference.py]"]
  node_shap["TreeSHAP explanations<br/>[inference.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_cli["CLI valuation<br/>[predict.py]"]
  node_api["FastAPI service<br/>[api.py]"]
  node_dashboard["Streamlit dashboard<br/>[dashboard.py]"]
end

subgraph group_resources["Data and artifacts"]
  node_config["Domain configuration<br/>[config.py]"]
  node_dataset[("California housing data")]
  node_artifacts[("Model and metadata files")]
end

node_user(("Valuation user"))

node_user -->|"submits inputs"| node_cli
node_user -->|"requests valuation"| node_api
node_user -->|"selects property"| node_dashboard
node_train_cli -->|"loads and splits"| node_loader
node_loader -->|"fetches data"| node_dataset
node_loader -->|"uses data settings"| node_config
node_train_cli -->|"trains pipelines"| node_modeling
node_modeling -->|"builds pipelines with"| node_features
node_features -->|"uses domain constants"| node_config
node_train_cli -->|"evaluates models"| node_evaluation
node_train_cli -->|"exports trained models"| node_artifacts
node_train_cli -->|"writes metadata"| node_artifacts
node_cli -->|"calls prediction"| node_predictor
node_api -->|"routes predictions"| node_predictor
node_dashboard -->|"requests valuation"| node_predictor
node_dashboard -->|"loads map data"| node_loader
node_predictor -->|"loads pipelines and metadata"| node_artifacts
node_predictor -->|"reads artifact paths"| node_config
node_predictor -->|"computes attributions"| node_shap
node_predictor -.->|"transforms model inputs"| node_features

click node_train_cli "https://github.com/2400080269/homeapplications/blob/main/train.py"
click node_loader "https://github.com/2400080269/homeapplications/blob/main/src/data_loader.py"
click node_features "https://github.com/2400080269/homeapplications/blob/main/src/features.py"
click node_modeling "https://github.com/2400080269/homeapplications/blob/main/src/modeling.py"
click node_evaluation "https://github.com/2400080269/homeapplications/blob/main/src/evaluation.py"
click node_config "https://github.com/2400080269/homeapplications/blob/main/src/config.py"
click node_artifacts "https://github.com/2400080269/homeapplications/blob/main/artifacts/model_metadata.json"
click node_predictor "https://github.com/2400080269/homeapplications/blob/main/src/inference.py"
click node_shap "https://github.com/2400080269/homeapplications/blob/main/src/inference.py"
click node_cli "https://github.com/2400080269/homeapplications/blob/main/predict.py"
click node_api "https://github.com/2400080269/homeapplications/blob/main/app/api.py"
click node_dashboard "https://github.com/2400080269/homeapplications/blob/main/app/dashboard.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_train_cli,node_loader,node_features,node_modeling,node_evaluation,node_user toneBlue
class node_predictor,node_shap toneAmber
class node_cli,node_api,node_dashboard toneMint
class node_config,node_dataset,node_artifacts toneRose
```

## Components

### Training and evaluation

- [Training orchestrator](https://github.com/2400080269/homeapplications/blob/main/train.py): `train.py`
- [Data audit and split](https://github.com/2400080269/homeapplications/blob/main/src/data_loader.py): `src/data_loader.py`
- [Geospatial features](https://github.com/2400080269/homeapplications/blob/main/src/features.py): `src/features.py`
- [Tune and train models](https://github.com/2400080269/homeapplications/blob/main/src/modeling.py): `src/modeling.py`
- [Benchmarks and diagnostics](https://github.com/2400080269/homeapplications/blob/main/src/evaluation.py): `src/evaluation.py`

### Inference core

- [House price predictor](https://github.com/2400080269/homeapplications/blob/main/src/inference.py): `src/inference.py`
- [TreeSHAP explanations](https://github.com/2400080269/homeapplications/blob/main/src/inference.py): `src/inference.py`

### User interfaces

- [CLI valuation](https://github.com/2400080269/homeapplications/blob/main/predict.py): `predict.py`
- [FastAPI service](https://github.com/2400080269/homeapplications/blob/main/app/api.py): `app/api.py`
- [Streamlit dashboard](https://github.com/2400080269/homeapplications/blob/main/app/dashboard.py): `app/dashboard.py`

### Data and artifacts

- [Domain configuration](https://github.com/2400080269/homeapplications/blob/main/src/config.py): `src/config.py`
- **California housing data**
- [Model and metadata files](https://github.com/2400080269/homeapplications/blob/main/artifacts/model_metadata.json): `artifacts/model_metadata.json`

### Other components

- **Valuation user**

## Connections

- Valuation user → CLI valuation: submits inputs (evidence: `README.md`)
- Valuation user → FastAPI service: requests valuation (evidence: `README.md`)
- Valuation user → Streamlit dashboard: selects property (evidence: `README.md`)
- Training orchestrator → Data audit and split: loads and splits (evidence: `train.py`)
- Data audit and split → California housing data: fetches data (evidence: `src/data_loader.py`)
- Data audit and split → Domain configuration: uses data settings (evidence: `src/data_loader.py`)
- Training orchestrator → Tune and train models: trains pipelines (evidence: `train.py`)
- Tune and train models → Geospatial features: builds pipelines with (evidence: `src/modeling.py`)
- Geospatial features → Domain configuration: uses domain constants (evidence: `src/features.py`)
- Training orchestrator → Benchmarks and diagnostics: evaluates models (evidence: `train.py`)
- Training orchestrator → Model and metadata files: exports trained models (evidence: `README.md`)
- Training orchestrator → Model and metadata files: writes metadata (evidence: `README.md`)
- CLI valuation → House price predictor: calls prediction (evidence: `predict.py`)
- FastAPI service → House price predictor: routes predictions (evidence: `app/api.py`)
- Streamlit dashboard → House price predictor: requests valuation (evidence: `app/dashboard.py`)
- Streamlit dashboard → Data audit and split: loads map data (evidence: `app/dashboard.py`)
- House price predictor → Model and metadata files: loads pipelines and metadata (evidence: `src/inference.py`)
- House price predictor → Domain configuration: reads artifact paths (evidence: `src/inference.py`)
- House price predictor → TreeSHAP explanations: computes attributions (evidence: `src/inference.py`)
- House price predictor → Geospatial features: transforms model inputs
