# kalyanm45/end-to-end-airbnb-price-prediction architecture

> Architecture diagram of the GitHub repository kalyanm45/end-to-end-airbnb-price-prediction, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kalyanm45/end-to-end-airbnb-price-prediction
- Repository: https://github.com/kalyanm45/end-to-end-airbnb-price-prediction

## Overview

This repository is an Airbnb listing price-prediction application. Hosts submit listing attributes through a Flask form; the app converts them to prediction input, applies a saved preprocessor and model, and displays the estimated price or an error. A separate training workflow ingests and splits data, transforms features, evaluates candidate regressors, and saves the selected model. The graph includes shared serialization and diagnostics. Training and prediction source are shown; README capabilities are included where documented, but unsampled integrations are omitted.

Main entry points: [`app.py`](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/app.py) (Flask app), [`src/Airbnb/components/Data_ingestion.py`](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/components/Data_ingestion.py) (Data ingestion), [`src/Airbnb/pipelines/Prediction_Pipeline.py`](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/pipelines/Prediction_Pipeline.py) (Price prediction), [`src/Airbnb/utils/utils.py`](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/utils/utils.py) (Object serialization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web prediction"]
  node_web_app["Flask app<br/>[app.py]"]
  node_listing_input["Listing input"]
  node_predict["Price prediction"]
  node_result_page["Result page<br/>[index.html]"]
  node_error_page["Error page<br/>[error.html]"]
end

subgraph group_ml["Model development"]
  node_training_flow["Training workflow"]
  node_ingestion["Data ingestion<br/>[Data_ingestion.py]"]
  node_transformation["Feature transformation"]
  node_model_training["Model evaluation<br/>[Model_trainer.py]"]
end

subgraph group_artifacts["Data and artifacts"]
  node_source_data["Airbnb source data<br/>[Airbnb_Data.csv]"]
  node_training_data["Train/test datasets"]
  node_model_artifacts["Model artifacts"]
end

subgraph group_shared["Shared services"]
  node_serialization["Object serialization<br/>[utils.py]"]
  node_logging["Logging<br/>[logger.py]"]
  node_exceptions["Custom exceptions<br/>[exception.py]"]
end

node_host(("Host"))

node_host -->|"submits listing"| node_web_app
node_web_app -->|"builds input"| node_listing_input
node_web_app -->|"requests prediction"| node_predict
node_listing_input -->|"provides features"| node_predict
node_predict -->|"loads objects"| node_serialization
node_predict -->|"reads model files"| node_model_artifacts
node_web_app -->|"renders result"| node_result_page
node_web_app -->|"renders error"| node_error_page
node_training_flow -->|"runs ingestion"| node_ingestion
node_training_flow -->|"runs transformation"| node_transformation
node_training_flow -->|"runs training"| node_model_training
node_ingestion -->|"reads CSV"| node_source_data
node_ingestion -->|"writes splits"| node_training_data
node_transformation -->|"reads splits"| node_training_data
node_transformation -->|"saves preprocessor"| node_serialization
node_model_training -->|"saves model"| node_serialization
node_serialization -->|"reads and writes"| node_model_artifacts
node_web_app -->|"logs events"| node_logging
node_web_app -->|"raises errors"| node_exceptions
node_ingestion -->|"logs events"| node_logging
node_ingestion -->|"raises errors"| node_exceptions

click node_web_app "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/app.py"
click node_listing_input "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/pipelines/Prediction_Pipeline.py"
click node_predict "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/pipelines/Prediction_Pipeline.py"
click node_result_page "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/templates/index.html"
click node_error_page "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/templates/error.html"
click node_training_flow "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/pipelines/Training_pipeline.py"
click node_ingestion "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/components/Data_ingestion.py"
click node_transformation "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/components/Data_transformation.py"
click node_model_training "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/components/Model_trainer.py"
click node_source_data "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/Notebook_Experiments/Data/Airbnb_Data.csv"
click node_training_data "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/tree/main/Artifacts"
click node_model_artifacts "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/tree/main/Artifacts"
click node_serialization "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/utils/utils.py"
click node_logging "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/logger.py"
click node_exceptions "https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/exception.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_web_app,node_listing_input,node_predict,node_result_page,node_error_page toneBlue
class node_training_flow,node_ingestion,node_transformation,node_model_training toneAmber
class node_source_data,node_training_data,node_model_artifacts toneMint
class node_serialization,node_logging,node_exceptions toneRose
class node_host toneIndigo
```

## Components

### Web prediction

- [Flask app](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/app.py): `app.py`
- [Listing input](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/pipelines/Prediction_Pipeline.py): `src/Airbnb/pipelines/Prediction_Pipeline.py`
- [Price prediction](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/pipelines/Prediction_Pipeline.py): `src/Airbnb/pipelines/Prediction_Pipeline.py`
- [Result page](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/templates/index.html): `templates/index.html`
- [Error page](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/templates/error.html): `templates/error.html`

### Model development

- [Training workflow](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/pipelines/Training_pipeline.py): `src/Airbnb/pipelines/Training_pipeline.py`
- [Data ingestion](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/components/Data_ingestion.py): `src/Airbnb/components/Data_ingestion.py`
- [Feature transformation](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/components/Data_transformation.py): `src/Airbnb/components/Data_transformation.py`
- [Model evaluation](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/components/Model_trainer.py): `src/Airbnb/components/Model_trainer.py`

### Data and artifacts

- [Airbnb source data](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/Notebook_Experiments/Data/Airbnb_Data.csv): `Notebook_Experiments/Data/Airbnb_Data.csv`
- [Train/test datasets](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/tree/main/Artifacts): `Artifacts`
- [Model artifacts](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/tree/main/Artifacts): `Artifacts`

### Shared services

- [Object serialization](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/utils/utils.py): `src/Airbnb/utils/utils.py`
- [Logging](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/logger.py): `src/Airbnb/logger.py`
- [Custom exceptions](https://github.com/kalyanm45/end-to-end-airbnb-price-prediction/blob/main/src/Airbnb/exception.py): `src/Airbnb/exception.py`

### Other components

- **Host**

## Connections

- Host → Flask app: submits listing (evidence: `README.md`)
- Flask app → Listing input: builds input (evidence: `app.py`)
- Flask app → Price prediction: requests prediction (evidence: `app.py`)
- Listing input → Price prediction: provides features (evidence: `app.py`)
- Price prediction → Object serialization: loads objects (evidence: `src/Airbnb/pipelines/Prediction_Pipeline.py`)
- Price prediction → Model artifacts: reads model files (evidence: `src/Airbnb/pipelines/Prediction_Pipeline.py`)
- Flask app → Result page: renders result (evidence: `app.py`)
- Flask app → Error page: renders error (evidence: `app.py`)
- Training workflow → Data ingestion: runs ingestion (evidence: `src/Airbnb/pipelines/Training_pipeline.py`)
- Training workflow → Feature transformation: runs transformation (evidence: `src/Airbnb/pipelines/Training_pipeline.py`)
- Training workflow → Model evaluation: runs training (evidence: `src/Airbnb/pipelines/Training_pipeline.py`)
- Data ingestion → Airbnb source data: reads CSV (evidence: `src/Airbnb/components/Data_ingestion.py`)
- Data ingestion → Train/test datasets: writes splits (evidence: `src/Airbnb/components/Data_ingestion.py`)
- Feature transformation → Train/test datasets: reads splits (evidence: `src/Airbnb/components/Data_transformation.py`)
- Feature transformation → Object serialization: saves preprocessor (evidence: `src/Airbnb/components/Data_transformation.py`)
- Model evaluation → Object serialization: saves model (evidence: `src/Airbnb/components/Model_trainer.py`)
- Object serialization → Model artifacts: reads and writes (evidence: `src/Airbnb/utils/utils.py`)
- Flask app → Logging: logs events
- Flask app → Custom exceptions: raises errors
- Data ingestion → Logging: logs events (evidence: `src/Airbnb/components/Data_ingestion.py`)
- Data ingestion → Custom exceptions: raises errors (evidence: `src/Airbnb/components/Data_ingestion.py`)
