Skip to content

Repository files navigation

🏡 Real Estate Price Prediction

Project Overview

🎯 Objective: Predict real estate prices using various machine learning techniques. 📊 Data Source: Cleaned real estate dataset with various features. 🔧 Techniques Used:

  • Data Cleaning
  • Feature Encoding
  • Imputation of Missing Values
  • Model Training & Evaluation
  • Deployement with streamlit on Render

Workflow

The project workflow consists of the following steps:

  1. Data Preparation

    • 🧹 Data Cleaning: Dropped irrelevant columns and handled missing values.
    • 🏷️ Feature Encoding: Transformed categorical variables using OneHotEncoder.
    • 🔄 Imputation: Applied KNN Imputation to handle missing values.

    Data Preparation

  2. Model Training

    • 🧪 Split the dataset into training and test sets (80% train, 20% test).
    • 📈 Trained a CatBoostRegressor model on the training set.
    • 🔍 Performed Grid Search to optimize hyperparameters.

    Model Training

  3. Model Evaluation

    • 🧮 Evaluated the model using various performance metrics.
    • 🎯 Fine-tuned the model based on evaluation results.

    Model Evaluation

Data Preparation

The data cleaning process involved:

  • 🗑️ Dropping irrelevant columns such as country, fireplace, monthlycharges, locality, propertyid, constructionyear, furnished, and roomcount.
  • 🔄 Encoding categorical features (district, floodingzone, subtypeofproperty, typeofsale, peb, province, region) using OneHotEncoder.
  • 🔧 Imputing missing values using KNNImputer.

Model Training

The CatBoostRegressor model was trained on the processed dataset. The training process involved:

  • 📊 Splitting the data into training and test sets.
  • 🔄 Imputing missing values in the training and test sets.
  • 🔍 Performing Grid Search to find the best hyperparameters.

Model Evaluation

The model was evaluated using the following metrics:

  • 📏 Mean Absolute Error (MAE)
  • 📏 Mean Squared Error (MSE)
  • 📏 Root Mean Squared Error (RMSE)
  • 📏 R^2 Score

Best Model Parameters:

Parameter Grid:

  • iterations: [100, 300, 500, 700],
  • learning_rate: [0.001, 0.01, 0.05],
  • depth: [3, 5, 7, 10, 12],
  • l2_leaf_reg: [0.1, 1, 3, 5, 10]

Results

The model demonstrated high performance with low error metrics:

  • 📏 MAE: 47856.00886071866
  • 📏 MSE: 4370635560.1221075
  • 📏 RMSE: 66110.78248003201
  • 📈 R^2 Score: 0.7846459907700529

Conclusion & Future Work

The CatBoostRegressor model successfully predicts real estate prices with high accuracy. Future work will focus on:

  • 🔍 Exploring additional feature engineering techniques.
  • 🧪 Testing other regression algorithms.
  • 🚀 Deploying the model for real-world applications.

Installation

To run the project, follow these steps:

  1. Clone the repository:
    git clone https://github.com/yourusername/real-estate-price-prediction.git
  2. Navigate to the project directory:
    cd real-estate-price-prediction
  3. Install the required packages:
    pip install -r requirements.txt

Usage

  1. Prepare your dataset and place it in the project directory.
  2. Run the data preparation script:
    python data_preparation.py
  3. Train the model:
    python train_model.py
  4. Evaluate the model:
    python evaluate_model.py

Deployement with streamlit on Render

Deployment with Streamlit on Render

To deploy the model using Streamlit on Render, follow these steps:

  • Set Up Streamlit App: Create a streamlit_app.py file in the project directory. This file should include the code to load the model and present the prediction interface.

  • Create a requirements.txt for Deployment: List all required packages for the Streamlit app. Include packages like streamlit, catboost, and any other dependencies.

  • Deploy on Render: Go to Render and create a new Web Service. Connect your GitHub repository and select the streamlit_app.py file. Configure the build and start commands (e.g., streamlit run streamlit_app.py).

  • Test Your Deployment: Once deployed, test the Streamlit app to ensure it functions correctly and provides accurate predictions.

By following these steps, you will be able to deploy your real estate price prediction model and make it accessible through a web interface.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages