# venugopal9578/real-estate-ml-pipeline architecture

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

- Interactive diagram: https://gitdiagram.com/venugopal9578/real-estate-ml-pipeline
- Repository: https://github.com/venugopal9578/real-estate-ml-pipeline

## Overview

#### Purpose and Entry Points
This repository implements a batch real-estate price prediction workflow: prepare housing data, train regression models, and publish prediction/analysis artifacts. Primary executable stages are Python modules under `src/`; exploratory and presentation entry points are `notebooks/01_EDA.ipynb`, `notebooks/02_ETL_Results.ipynb`, and `notebooks/generate_visualizations.py`.

#### Data Sources and Storage Boundary
The pipeline uses local CSV files rather than an active database or cloud integration. Raw input is stored at `data/raw_data/house_prices_raw.csv`; the canonical processed dataset is `data/processed_data/house_prices_final.csv`. `src/generate_synthetic_data.py` supports creating synthetic source-like data, separating data generation from downstream processing.

#### ETL Orchestration
`src/etl_pipeline.py` is the likely batch coordinator for transforming raw housing records into the processed dataset. It composes cleaning, validation, and feature creation stages:
- `src/data_cleaning.py`
- `src/data_validation.py`
- `src/feature_engineering.py`

The key contract is CSV-based: upstream stages must produce valid tabular records and downstream model preparation consumes the finalized processed file.

#### Data Quality and Feature Construction
Cleaning and validation are explicit architectural boundaries rather than being embedded only in notebooks. `src/data_cleaning.py` handles input normalization or missing/invalid values, while `src/data_validation.py` enforces dataset expectations before training. `src/feature_engineering.py` derives model-ready predictive features from cleaned real-estate attributes.

#### Model Preparation and Training
`src/model_preparation.py` bridges processed tabular data and ML estimators, likely handling target/feature selection and training/test preparation. `src/model_training.py` owns fitting and comparative evaluation of the supported regressors. Persisted model outputs indicate three model families:
- `models/Linear_Regression.pkl`
- `models/Random_Forest.pkl`
- `models/XGBoost.pkl`

This establishes model serialization as the boundary between offline training and later inference or reporting.

#### Evaluation and Insights Outputs
Training/evaluation results are materialized as files under `results/`, enabling analysis without a live application or service. Core outputs include `results/model_metrics.csv`, `results/model_metrics_detailed.csv`, `results/all_predictions_best_model.csv`, and model-specific feature importance CSVs. Narrative interpretation is preserved in `results/MODEL_ANALYSIS_REPORT.txt` and `results/METRIC_INTERPRETATION.txt`.

#### Runtime and External Dependencies
The runtime is Python with dependencies declared in `requirements.txt`; README identifies Pandas, NumPy, Scikit-Learn, Matplotlib, and Seaborn as core libraries. Jupyter is used for EDA and ETL-result inspection. BigQuery, Google Cloud, SQL, and Power BI are stated as future-phase technologies, but no corresponding implementation or infrastructure files are present in this tree.

Main entry points: [`src/model_training.py`](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/model_training.py) (Model Training & Evaluation), [`data/processed_data/house_prices_final.csv`](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/data/processed_data/house_prices_final.csv) (Processed Housing CSV), [`data/raw_data/house_prices_raw.csv`](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/data/raw_data/house_prices_raw.csv) (Raw Housing CSV), [`src/etl_pipeline.py`](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/etl_pipeline.py) (ETL Coordinator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data Assets"]
  node_synthetic_data["Synthetic Data Generator<br/>Python module"]
  node_raw_csv[("Raw Housing CSV<br/>CSV input")]
  node_processed_csv[("Processed Housing CSV<br/>CSV contract")]
end

subgraph group_etl["ETL Pipeline"]
  node_etl_pipeline["ETL Coordinator<br/>Python module<br/>[etl_pipeline.py]"]
  node_cleaning["Data Cleaning<br/>Python module<br/>[data_cleaning.py]"]
  node_validation["Data Validation<br/>Python module<br/>[data_validation.py]"]
  node_features["Feature Engineering<br/>Python module"]
end

subgraph group_ml["Modeling"]
  node_model_prep["Model Preparation<br/>Python module"]
  node_training["Model Training &amp; Evaluation<br/>Python module<br/>[model_training.py]"]
  node_linear_model["Linear Regression<br/>Serialized model"]
  node_forest_model["Random Forest<br/>Serialized model<br/>[Random_Forest.pkl]"]
  node_xgboost_model["XGBoost<br/>Serialized model<br/>[XGBoost.pkl]"]
end

subgraph group_analysis["Analysis &amp; Publishing"]
  node_metrics["Model Metrics<br/>CSV output<br/>[model_metrics.csv]"]
  node_detailed_metrics["Detailed Metrics<br/>CSV output"]
  node_predictions["Best-Model Predictions<br/>CSV output"]
  node_analysis_report["Model Analysis Report<br/>Text report"]
  node_metric_interpretation["Metric Interpretation<br/>Text report"]
  node_eda_notebook["EDA Notebook<br/>Jupyter notebook<br/>[01_EDA.ipynb]"]
  node_etl_results_notebook["ETL Results Notebook<br/>Jupyter notebook"]
  node_visualizations["Visualization Generator<br/>Python script"]
end

node_synthetic_data -.->|"generates"| node_raw_csv
node_raw_csv -->|"batch input"| node_etl_pipeline
node_etl_pipeline -->|"orchestrates"| node_cleaning
node_cleaning -->|"normalized records"| node_validation
node_validation -->|"valid records"| node_features
node_features -->|"writes finalized data"| node_processed_csv
node_etl_pipeline -->|"publishes"| node_processed_csv
node_processed_csv -->|"modeling input"| node_model_prep
node_model_prep -->|"prepared splits"| node_training
node_training -->|"serializes"| node_linear_model
node_training -->|"serializes"| node_forest_model
node_training -->|"serializes"| node_xgboost_model
node_training -->|"writes"| node_metrics
node_training -->|"writes"| node_detailed_metrics
node_training -->|"writes"| node_predictions
node_training -->|"writes"| node_analysis_report
node_training -->|"writes"| node_metric_interpretation
node_raw_csv -.->|"explores"| node_eda_notebook
node_processed_csv -.->|"explores"| node_eda_notebook
node_processed_csv -.->|"inspects"| node_etl_results_notebook
node_metrics -->|"visualizes"| node_visualizations
node_detailed_metrics -->|"visualizes"| node_visualizations
node_predictions -->|"visualizes"| node_visualizations

click node_synthetic_data "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/generate_synthetic_data.py"
click node_raw_csv "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/data/raw_data/house_prices_raw.csv"
click node_processed_csv "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/data/processed_data/house_prices_final.csv"
click node_etl_pipeline "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/etl_pipeline.py"
click node_cleaning "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/data_cleaning.py"
click node_validation "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/data_validation.py"
click node_features "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/feature_engineering.py"
click node_model_prep "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/model_preparation.py"
click node_training "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/model_training.py"
click node_linear_model "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/models/Linear_Regression.pkl"
click node_forest_model "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/models/Random_Forest.pkl"
click node_xgboost_model "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/models/XGBoost.pkl"
click node_metrics "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/model_metrics.csv"
click node_detailed_metrics "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/model_metrics_detailed.csv"
click node_predictions "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/all_predictions_best_model.csv"
click node_analysis_report "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/MODEL_ANALYSIS_REPORT.txt"
click node_metric_interpretation "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/METRIC_INTERPRETATION.txt"
click node_eda_notebook "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/notebooks/01_EDA.ipynb"
click node_etl_results_notebook "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/notebooks/02_ETL_Results.ipynb"
click node_visualizations "https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/notebooks/generate_visualizations.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_synthetic_data,node_raw_csv,node_processed_csv toneBlue
class node_etl_pipeline,node_cleaning,node_validation,node_features toneAmber
class node_model_prep,node_training,node_linear_model,node_forest_model,node_xgboost_model toneMint
class node_metrics,node_detailed_metrics,node_predictions,node_analysis_report,node_metric_interpretation,node_eda_notebook,node_etl_results_notebook,node_visualizations toneRose
```

## Components

### Data Assets

- [Synthetic Data Generator](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/generate_synthetic_data.py): Python module · Creates source-like housing records. · `src/generate_synthetic_data.py`
- [Raw Housing CSV](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/data/raw_data/house_prices_raw.csv): CSV input · `data/raw_data/house_prices_raw.csv`
- [Processed Housing CSV](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/data/processed_data/house_prices_final.csv): CSV contract · Canonical validated dataset for modeling. · `data/processed_data/house_prices_final.csv`

### ETL Pipeline

- [ETL Coordinator](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/etl_pipeline.py): Python module · Runs the batch transformation workflow. · `src/etl_pipeline.py`
- [Data Cleaning](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/data_cleaning.py): Python module · `src/data_cleaning.py`
- [Data Validation](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/data_validation.py): Python module · Enforces dataset expectations. · `src/data_validation.py`
- [Feature Engineering](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/feature_engineering.py): Python module · Derives predictive features. · `src/feature_engineering.py`

### Modeling

- [Model Preparation](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/model_preparation.py): Python module · Builds features, target, and train/test inputs. · `src/model_preparation.py`
- [Model Training & Evaluation](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/src/model_training.py): Python module · Fits and compares regression models. · `src/model_training.py`
- [Linear Regression](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/models/Linear_Regression.pkl): Serialized model · `models/Linear_Regression.pkl`
- [Random Forest](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/models/Random_Forest.pkl): Serialized model · `models/Random_Forest.pkl`
- [XGBoost](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/models/XGBoost.pkl): Serialized model · `models/XGBoost.pkl`

### Analysis & Publishing

- [Model Metrics](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/model_metrics.csv): CSV output · `results/model_metrics.csv`
- [Detailed Metrics](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/model_metrics_detailed.csv): CSV output · `results/model_metrics_detailed.csv`
- [Best-Model Predictions](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/all_predictions_best_model.csv): CSV output · `results/all_predictions_best_model.csv`
- [Model Analysis Report](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/MODEL_ANALYSIS_REPORT.txt): Text report · `results/MODEL_ANALYSIS_REPORT.txt`
- [Metric Interpretation](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/results/METRIC_INTERPRETATION.txt): Text report · `results/METRIC_INTERPRETATION.txt`
- [EDA Notebook](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/notebooks/01_EDA.ipynb): Jupyter notebook · `notebooks/01_EDA.ipynb`
- [ETL Results Notebook](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/notebooks/02_ETL_Results.ipynb): Jupyter notebook · `notebooks/02_ETL_Results.ipynb`
- [Visualization Generator](https://github.com/venugopal9578/real-estate-ml-pipeline/blob/main/notebooks/generate_visualizations.py): Python script · Publishes analysis visualizations from pipeline outputs. · `notebooks/generate_visualizations.py`

## Connections

- Synthetic Data Generator → Raw Housing CSV: generates
- Raw Housing CSV → ETL Coordinator: batch input
- ETL Coordinator → Data Cleaning: orchestrates
- Data Cleaning → Data Validation: normalized records
- Data Validation → Feature Engineering: valid records
- Feature Engineering → Processed Housing CSV: writes finalized data
- ETL Coordinator → Processed Housing CSV: publishes
- Processed Housing CSV → Model Preparation: modeling input
- Model Preparation → Model Training & Evaluation: prepared splits
- Model Training & Evaluation → Linear Regression: serializes
- Model Training & Evaluation → Random Forest: serializes
- Model Training & Evaluation → XGBoost: serializes
- Model Training & Evaluation → Model Metrics: writes
- Model Training & Evaluation → Detailed Metrics: writes
- Model Training & Evaluation → Best-Model Predictions: writes
- Model Training & Evaluation → Model Analysis Report: writes
- Model Training & Evaluation → Metric Interpretation: writes
- Raw Housing CSV → EDA Notebook: explores
- Processed Housing CSV → EDA Notebook: explores
- Processed Housing CSV → ETL Results Notebook: inspects
- Model Metrics → Visualization Generator: visualizes
- Detailed Metrics → Visualization Generator: visualizes
- Best-Model Predictions → Visualization Generator: visualizes
