File size: 5,889 Bytes
81522e3 e0a433a 60808c3 58f019a 60808c3 58f019a 60808c3 10aeb0d 81522e3 e0a433a 58f019a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
---
layout: default
title: Real Estate Price Prediction API
description: real estate price prediction tool with web interface
license: apache-2.0
sdk: docker
app_file: app.py
emoji: π
colorFrom: green
colorTo: gray
pinned: true
---
# π **Real Estate Price Prediction API**
## π **Project Motto**
This project aims to provide an accurate and interactive **Real Estate Price Prediction tool**. Users can input details such as property location, square footage, number of bedrooms, and bathrooms to get an **instant price prediction** based on a trained **machine learning model**.
This API bridges the gap between **data science** and **user-friendly deployment**, allowing seamless integration of advanced predictions into real-world applications.
---
## π‘ **How It Works**
1. **Data Processing & Model Training**
- A dataset of real estate transactions was cleaned and processed.
- Key features such as `location`, `total_sqft`, `bath`, and `bhk` were selected.
- A **Linear Regression model** was trained and stored as a `.pkl` file for deployment.
2. **Prediction Mechanism**
- The trained model is loaded and predicts property prices based on user inputs.
- Location data is one-hot encoded to handle categorical features.
3. **Interactive Frontend**
- A Flask-powered web app provides an intuitive interface for predictions.
- Users input details via forms, and results are displayed instantly.
4. **API Integration**
- A `/predict` endpoint allows developers to integrate the model with other applications.
---
## π₯ Watch the Demo(click image belowπ)
[](https://www.youtube.com/watch?v=NcmXkE907io)
---
## π· **Screenshots**
### Home Page

### Prediction Results

---
## π **Project Structure**
```
βββ .github/
β βββ workflows/
β βββ python-app.yml # CI/CD workflow configuration
βββ data/ # Dataset directory
β βββ bengaluru_house_prices.csv # Dataset file for the project
βββ models/ # Saved models and feature names
β βββ feature_names.pkl # Pickled feature names
β βββ lr_regg.pkl # Trained regression model
βββ src/ # Source code for the project
β βββ EDA.py # Exploratory Data Analysis script
β βββ model.py # Model training and evaluation script
β βββ preprocessing.py # Data preprocessing logic
βββ templates/ # HTML templates for the Flask web app
β βββ index.html # User input form for predictions
β βββ results.html # Displays prediction results
βββ tests/ # Unit testing for the project
β βββ __init__.py # Marks the directory as a package
β βββ test_model.py # Tests for the model
β βββ test2direct.py # Additional test script
βββ .gitignore # Specifies ignored files for Git
βββ app.py # Flask application entry point
βββ main.py # Main execution script
βββ requirements.txt # List of dependencies for the project
βββ setup.py # Setup script for packaging the project
βββ README.md # Project overview and documentation
```
---
## π **Features**
- **Accurate Price Predictions** using a trained regression model.
- **Interactive Web Interface** for user-friendly predictions.
- **API Integration** for developers to use the model programmatically.
- **Scalable and Extendable** to new locations or additional features.
---
## π οΈ **Installation and Setup**
### Prerequisites
- Python 3.8+
- Flask
- Pickle
### Installation Steps
1. Clone the repository:
```bash
git clone https://github.com/Maazuddin1/Banglore_RealEstate_forecast-using-CICD-piplines.git
cd Banglore_RealEstate_forecast-using-CICD-piplines
```
2. Create a virtual environment:
```bash
python -m venv env
source env/bin/activate # Linux/Mac
env\Scripts\activate # Windows
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Start the Flask application:
```bash
python app.py
```
5. Open your browser and navigate to `http://127.0.0.1:5000/`.
---
## π **API Usage**
### Endpoint: `/predict`
**Method**: `POST`
**Input** (JSON):
```json
{
"location": "Whitefield",
"sqft": 1200,
"bath": 2,
"bhk": 3
}
```
**Output**:
```json
{
"predicted_price": 94.23 Lakhs
}
```
---
## π **Model Details**
The trained model uses **Linear Regression** with key features like:
- **total_sqft**: Total square footage of the property.
- **bath**: Number of bathrooms.
- **bhk**: Number of bedrooms.
- **Location**: One-hot encoded for categorical support.
---
## π **Future Enhancements**
- Add support for more advanced machine learning models like Random Forest or XGBoost.
- Improve UI design with frameworks like Bootstrap.
- Expand location datasets for better predictions.
- Add real-time price scraping for dynamic updates.
---
## πΌοΈ **Visual Workflow**
```mermaid
graph TD
A[User Input] --> B[Flask App]
B --> C[Process Input Features]
C --> D[Trained ML Model]
D --> E[Predict Price]
E --> F[Display Results]
```
---
## π **Contributions**
Contributions are welcome! Feel free to fork this repository, open issues, or submit pull requests.
---
## π **License**
-
--- |