🎯 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
The project workflow consists of the following steps:
-
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.
-
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 Evaluation
- 🧮 Evaluated the model using various performance metrics.
- 🎯 Fine-tuned the model based on evaluation results.
The data cleaning process involved:
- 🗑️ Dropping irrelevant columns such as
country,fireplace,monthlycharges,locality,propertyid,constructionyear,furnished, androomcount. - 🔄 Encoding categorical features (
district,floodingzone,subtypeofproperty,typeofsale,peb,province,region) using OneHotEncoder. - 🔧 Imputing missing values using KNNImputer.
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.
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]
The model demonstrated high performance with low error metrics:
- 📏 MAE: 47856.00886071866
- 📏 MSE: 4370635560.1221075
- 📏 RMSE: 66110.78248003201
- 📈 R^2 Score: 0.7846459907700529
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.
To run the project, follow these steps:
- Clone the repository:
git clone https://github.com/yourusername/real-estate-price-prediction.git
- Navigate to the project directory:
cd real-estate-price-prediction - Install the required packages:
pip install -r requirements.txt
- Prepare your dataset and place it in the project directory.
- Run the data preparation script:
python data_preparation.py
- Train the model:
python train_model.py
- Evaluate the model:
python evaluate_model.py
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.


