# r0hankrishnan/idx-exchange-data-science architecture

> Architecture diagram of the GitHub repository r0hankrishnan/idx-exchange-data-science, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/r0hankrishnan/idx-exchange-data-science
- Repository: https://github.com/r0hankrishnan/idx-exchange-data-science

## Overview

This repository builds and serves pre-listing sale-price estimates for California single-family homes. The user workflow is to search for a sold home or enter its details, then view a Model C estimate, calibrated price ranges, comparable sales, and feature effects. Behind that are fixed cleaning and feature engineering, time-based model validation and fitted preprocessing, and final-model training and persistence. The README documents the broad workflow and app capabilities; some dashboard internals and feature/model implementation details were not sampled, so those links are limited to documented relationships.

Main entry points: [`app/dashboard.py`](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py) (Streamlit dashboard), [`src/idx_exchange_data_science/features.py`](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/features.py) (Feature table), [`src/idx_exchange_data_science/serving.py`](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/serving.py) (Final model training), [`src/idx_exchange_data_science/modeling.py`](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/modeling.py) (Models and metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_prep["Data preparation"]
  node_crmls[("CRMLS sales data")]
  node_cleaning["Fixed cleaning<br/>[cleaning.py]"]
  node_feature_table["Feature table<br/>[features.py]"]
  node_districts["School districts<br/>[features.py]"]
  node_comparables["Comparable sales<br/>[features.py]"]
end

subgraph group_modeling["Model development"]
  node_time_splits["Time splits<br/>[splits.py]"]
  node_preprocessing["Fitted preprocessing<br/>[preprocessing.py]"]
  node_modeling_core["Models and metrics<br/>[modeling.py]"]
end

subgraph group_serving["Model serving"]
  node_final_training["Final model training<br/>[serving.py]"]
  node_paths["Data and model paths<br/>[paths.py]"]
  node_model_store[("Saved model")]
end

subgraph group_experience["Home price app"]
  node_app["Streamlit dashboard<br/>[dashboard.py]"]
  node_home_search["Search or enter home<br/>[dashboard.py]"]
  node_estimate_view["Estimate and ranges<br/>[dashboard.py]"]
  node_sales_view["Sales and comparables<br/>[dashboard.py]"]
  node_effects_view["Feature effects<br/>[dashboard.py]"]
end

node_homebuyer(("Home seeker"))

node_homebuyer -->|"searches or enters"| node_home_search
node_crmls -->|"provides sales"| node_cleaning
node_cleaning -->|"prepares Dataset A"| node_feature_table
node_feature_table -->|"adds district features"| node_districts
node_feature_table -->|"adds sales features"| node_comparables
node_feature_table -->|"supplies feature table"| node_final_training
node_time_splits -->|"defines validation folds"| node_modeling_core
node_preprocessing -->|"transforms training data"| node_modeling_core
node_modeling_core -->|"provides model and scoring"| node_final_training
node_final_training -->|"uses model location"| node_paths
node_final_training -->|"saves trained bundle"| node_model_store
node_home_search -->|"dispatches app view"| node_app
node_app -->|"loads saved model"| node_model_store
node_app -->|"loads or builds homes"| node_feature_table
node_app -->|"shows estimate and ranges"| node_estimate_view
node_app -->|"shows sale and comparables"| node_sales_view
node_app -->|"shows feature effects"| node_effects_view

click node_cleaning "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/cleaning.py"
click node_feature_table "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/features.py"
click node_districts "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/features.py"
click node_comparables "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/features.py"
click node_time_splits "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/splits.py"
click node_preprocessing "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/preprocessing.py"
click node_modeling_core "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/modeling.py"
click node_final_training "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/serving.py"
click node_paths "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/paths.py"
click node_app "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py"
click node_home_search "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py"
click node_estimate_view "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py"
click node_sales_view "https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py"
click node_effects_view "https://github.com/r0hankrishnan/idx-exchange-data-science/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_crmls,node_cleaning,node_feature_table,node_districts,node_comparables toneBlue
class node_time_splits,node_preprocessing,node_modeling_core toneAmber
class node_final_training,node_paths,node_model_store toneMint
class node_app,node_home_search,node_estimate_view,node_sales_view,node_effects_view toneRose
class node_homebuyer toneIndigo
```

## Components

### Data preparation

- **CRMLS sales data**
- [Fixed cleaning](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/cleaning.py): `src/idx_exchange_data_science/cleaning.py`
- [Feature table](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/features.py): `src/idx_exchange_data_science/features.py`
- [School districts](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/features.py): `src/idx_exchange_data_science/features.py`
- [Comparable sales](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/features.py): `src/idx_exchange_data_science/features.py`

### Model development

- [Time splits](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/splits.py): `src/idx_exchange_data_science/splits.py`
- [Fitted preprocessing](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/preprocessing.py): `src/idx_exchange_data_science/preprocessing.py`
- [Models and metrics](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/modeling.py): `src/idx_exchange_data_science/modeling.py`

### Model serving

- [Final model training](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/serving.py): `src/idx_exchange_data_science/serving.py`
- [Data and model paths](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/src/idx_exchange_data_science/paths.py): `src/idx_exchange_data_science/paths.py`
- **Saved model**

### Home price app

- [Streamlit dashboard](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py): `app/dashboard.py`
- [Search or enter home](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py): `app/dashboard.py`
- [Estimate and ranges](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py): `app/dashboard.py`
- [Sales and comparables](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py): `app/dashboard.py`
- [Feature effects](https://github.com/r0hankrishnan/idx-exchange-data-science/blob/main/app/dashboard.py): `app/dashboard.py`

### Other components

- **Home seeker**

## Connections

- Home seeker → Search or enter home: searches or enters (evidence: `README.md`)
- CRMLS sales data → Fixed cleaning: provides sales (evidence: `README.md`)
- Fixed cleaning → Feature table: prepares Dataset A (evidence: `README.md`)
- Feature table → School districts: adds district features (evidence: `README.md`)
- Feature table → Comparable sales: adds sales features (evidence: `README.md`)
- Feature table → Final model training: supplies feature table (evidence: `src/idx_exchange_data_science/serving.py`)
- Time splits → Models and metrics: defines validation folds (evidence: `src/idx_exchange_data_science/modeling.py`)
- Fitted preprocessing → Models and metrics: transforms training data (evidence: `src/idx_exchange_data_science/modeling.py`)
- Models and metrics → Final model training: provides model and scoring (evidence: `src/idx_exchange_data_science/serving.py`)
- Final model training → Data and model paths: uses model location (evidence: `src/idx_exchange_data_science/serving.py`)
- Final model training → Saved model: saves trained bundle (evidence: `src/idx_exchange_data_science/serving.py`)
- Search or enter home → Streamlit dashboard: dispatches app view (evidence: `app/dashboard.py`)
- Streamlit dashboard → Saved model: loads saved model (evidence: `README.md`)
- Streamlit dashboard → Feature table: loads or builds homes (evidence: `README.md`)
- Streamlit dashboard → Estimate and ranges: shows estimate and ranges (evidence: `README.md`)
- Streamlit dashboard → Sales and comparables: shows sale and comparables (evidence: `README.md`)
- Streamlit dashboard → Feature effects: shows feature effects (evidence: `README.md`)
