# jash0803/property_acquisition_cost_predictor architecture

> Architecture diagram of the GitHub repository jash0803/property_acquisition_cost_predictor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jash0803/property_acquisition_cost_predictor
- Repository: https://github.com/jash0803/property_acquisition_cost_predictor

## Overview

##### Project Type and Purpose
- This project is a machine learning application focused on predicting property acquisition costs. It leverages exploratory data analysis, feature engineering, multiple regression models (Linear Regression, Random Forest, and XGBoost), and model evaluation metrics. Additionally, it deploys the final model in a web app using the Streamlit framework.
- The README clearly outlines the steps from data analysis and modeling to deployment, and the file tree confirms the existence of data (Housing.csv), a Jupyter Notebook (for interactive analysis and training), a saved model (.sav), and the web app script (web_app.py).

##### File Structure
- Top-level components from the file tree:
- Housing.csv – The main dataset.
- Property_Acquisition_Cost_Predictor.ipynb – Likely contains exploratory data analysis (EDA), feature engineering, and model training.
- Property_acquisition_cost_predictor.sav – The serialized model produced after training.
- web_app.py – The script which implements the web application, likely using Streamlit, for deploying the saved model.
- requirements.txt, LICENSE, and README.md – Provide dependency management, legal usage, and project description respectively.
- This layout shows a clear separation between the modeling/analysis components and the deployment component.

##### README for Additional Insights
- The README further clarifies the project flow:
- EDA components: Histogram and Heatmap.
- Feature Engineering: Includes encoding techniques and dimensionality reduction (PCA) with scaling.
- Model Training: Covers various regressor algorithms and hyperparameter tuning.
- Model Evaluation: Contains metrics such as R-squared, MSE, and MAE.
- Model Deployment: Implements model pickling and uses Streamlit for the web interface.
- It indicates that the project follows a sequential flow from data ingestion to model deployment.

a. Main Components:
- Data Storage: Housing.csv
- Data Analysis & Feature Engineering: Represented by the notebook (Property_Acquisition_Cost_Predictor.ipynb)
- Model Training & Evaluation:
- Linear Regression, Random Forest, XGBoost components (could be depicted as modular blocks showing different algorithms)
- Evaluation metrics module
- Model Persistence: Serialized model file (Property_acquisition_cost_predictor.sav)
- Deployment: Web application component (web_app.py) utilizing the Streamlit framework
- Peripheral: Dependencies/requirements (requirements.txt) ensuring the proper libraries are used

b. Relationships and Interactions:
- The Data Storage (Housing.csv) feeds into the Data Analysis component.
- The notebook performs EDA and feature engineering which then informs the Model Training stage.
- The trained models are evaluated using defined metrics.
- The best model is stored (pickled) in a .sav file.
- The web_app.py component loads the serialized model and exposes prediction functionalities to end users.
- There is a data flow from the raw input, through analysis/training, model serialization, and finally deployment.

c. Architectural Patterns and Design Principles:
- Pipeline Approach: Data flows in a linear pipeline from data ingestion, preparation, model training, evaluation, and deployment.
- Separation of Concerns: Distinct separation between data processing/training (notebook) and web app deployment (web_app.py).
- Reusability and Portability: The use of a serialized (.sav) model file allows the deployment layer to be decoupled from the training process.
- Use of External Libraries: Relies on popular ML libraries and Streamlit for deployment, clearly indicated by requirements.txt.

d. Relevant Technologies, Frameworks, or Libraries:
- Machine Learning Libraries: Likely scikit-learn, XGBoost, and other essential Python libraries.
- Data Visualization: Libraries for generating histograms and heatmaps (e.g., matplotlib, seaborn).
- Model Deployment: Streamlit to create an interactive web app.
- Serialization: Python’s pickle library for model persistence.

##### Final Assembly
- Modules are interconnected with clear labels and directions, emphasizing the complete workflow from dataset to deployed model.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Data Storage"]:::data
    B["EDA & Feature Engineering"]:::process

    subgraph "Model Training"
        direction TB
        ML1["Linear Regression"]:::model
        ML2["Random Forest"]:::model
        ML3["XGBoost"]:::model
    end

    D["Model Evaluation"]:::metrics
    E["Model Persistence"]:::model
    F["Deployment (Web App)"]:::deployment

    A -->|"feeds"| B
    B -->|"initiates"| ML1
    ML1 -->|"trains"| ML2
    ML2 -->|"trains"| ML3
    ML3 -->|"evaluation"| D
    D -->|"stores"| E
    E -->|"serves"| F

    click A "https://github.com/jash0803/property_acquisition_cost_predictor/blob/main/Housing.csv"
    click B "https://github.com/jash0803/property_acquisition_cost_predictor/blob/main/Property_Acquisition_Cost_Predictor.ipynb"
    click E "https://github.com/jash0803/property_acquisition_cost_predictor/blob/main/Property_acquisition_cost_predictor.sav"
    click F "https://github.com/jash0803/property_acquisition_cost_predictor/blob/main/web_app.py"

    classDef data fill:#a2d5f2,stroke:#333,stroke-width:2px;
    classDef process fill:#bde0fe,stroke:#333,stroke-width:2px;
    classDef model fill:#ffcb77,stroke:#333,stroke-width:2px;
    classDef metrics fill:#caffbf,stroke:#333,stroke-width:2px;
    classDef deployment fill:#ffafcc,stroke:#333,stroke-width:2px;
```
