Regression Models in Python for House Price Prediction

Nitin Arora

Business Analyst
Data Analyst
Python
Business Objective
The price of a house is based on several characteristics such as location, total area, number of rooms, various amenities available, etc.
In this project, we will perform house price prediction for 200 apartments in Pune city. Different regression models such as Linear, Random Forest, XGBoost, etc., will be implemented. Also, multi-layer perceptron (MLP) models will be implemented using scikit-learn and TensorFlow.
This house price prediction project will help you predict the price of houses based on various features and house properties.
 
Data Description
We are given a real estate dataset with around 200 rows and 17 different variables that play an important role in predicting our target variable, i.e., price.
 
Aim
The goal is to predict sale prices for homes in Pune city.
 
Tech stack
Language - Python
Libraries - sklearn, pandas, NumPy, matplotlib, seaborn, xgboost
Approach
Data Cleaning
Importing the required libraries and reading the dataset.
Preliminary exploration
Check for the outliers and remove outliers.
Dropping of redundant feature columns
Missing value handling
Regularizing the categorical columns
Save the cleaned data
2. Data Pre-processing
Import the required libraries and read the cleaned dataset.
Converting binary columns to dummy variables
Feature Engineering
Univariate and Bivariate analysis
Check for correlation
Feature selection
Data Scaling
Saving the final updated dataset
3. Model Building
Data preparation
Performing train test split
Linear Regression
Ridge Regression
Lasso Regressor
Elastic Net
Random Forest Regressor
XGBoost Regressor
K-Nearest Neighbours Regressor
Support Vector Regressor
4. Model Validation
Mean Squared Error
R2 score
Plot for residuals
Performs the grid search and cross-validation for the given regressor
Fitting the model and making predictions on the test data
Checking for Feature Importance
Model comparisons.
MLP (Multi-Layer Perceptron) Models
MLP Regression with scikit-learn
Regression with TensorFlow

2022

Partner With Nitin
View Services

More Projects by Nitin