Anushi Project-House Price Prediction
Anushi Project-House Price Prediction
SUBMITTED BY
ANUSHI TYAGI
1|Page
CONTENTS
1 Problem statement 3
And agenda
4 Top 5 rows 6
Analysis
Outliers
9 Histogram 20-22
11 Business insights 26
2|Page
PROBLEM STATEMENT AND AGENDA
• A house value is simply more than location and square footage. Like the features that make up a
person, an educated party would want to know all aspects that give a house its value. For example, you want
to sell a house and you don’t know the price which you may expect — it can’t be too low or too high. To find
house price you usually try to find similar properties in your neighborhood and based on gathered data you will
try to assess your house price.
• Take advantage of all of the feature variables available, use it to analyze and predict house prices.
• Your job is to use your magical data science skills to provide them with suitable insights about their
data and help them in predicting the price of the house.
NEED TO STUDY
• The prices of house increase every year, so there is a need for a system to predict house prices in the
future.
• Also house price prediction can help the developer to determine the selling price of a house and can
help the customer to arrange the right time to purchase a house.
OPPORTUNITIES
• Will get the idea about the things or important factors need to include for better results.
3|Page
SUMMARY OF THE DATA-
• Null Values-There are multiple NA values with respect to each column we will drop them. In this case
there are few missing values you can drop those values.
• After dropping-we can see all the 23 columns don’t have null values in it.
dayhours 0 dayhours 0
price 0 price 0
room_bed 108 room_bed 0
room_bath 108 room_bath 0
living_measure 17 living_measure 0
lot_measure 42 lot_measure 0
ceil 42 ceil 0
coast 1 coast 0
lat 0 lat 0
sight 57 sight 0
condition 57 condition 0
quality 1 quality 0
ceil_measure 1 ceil_measure 0
basement 1 basement 0
yr_built 1 yr_built 0
yr_renovated 0 yr_renovated 0
zipcode 0 zipcode 0
long 0 long 0
living_measure1 166 living_measure1 0
5 5
lot_measure15 29 lot_measure15 0
furnished 29 furnished 0
total_area 29 total_area 0
4|Page
INFO OF THE DATA-
• Missing values -We can see there are missing values as per the count in the column entries.
• Data types-We can see there are 12 columns of float data type, 4 columns of integer data type and 7
columns of object data type.
5|Page
TOP 5 ROWS -. The top 5 observations of the dataset are displayed below to get some idea about different
features and their values.
cid dayhours price room_bed room_bath living_measure lot_measure ceil coast sight ...
-
1250 1966 0 98034 47.7228 2020 8660 0 12490
122
-
0 1948 0 98118 47.5546 1660 4100 0 3771
122
-
0 1966 0 98118 47.5188 2620 2433 0 5455
122
-
0 2009 0 98002 47.3363 2030 3794 0 5461
122
-
0 1924 0 98118 47.5663 1120 5100 0 571
122
6|Page
DISCRIBING THE NUMERICAL DATA-
• The describe method will help to see how data has been spread for the numerical values as well as for
categorical values. We can clearly see the minimum value, mean values, different percentile values
and maximum values.
• From the above table we can see that range of price varies from Rs7.5 to Rs.7.7and also the standard
deviation is 3.6.
• We can also find some values 0 as minimum value for furnished, basement, room_bed, room_bath
which is meaningless and to be taken care while data pre-processing.
• Also, the mean and median for the attributes are same which shows that the data is normally
distributed
• Also, by seeing the difference in the values we can say there are outliers present in the data.
7|Page
DISCRIBING THE CATEGORICAL DATA-
8|Page
UNIVARIATE ANALYSIS AND BAIVARIATE ANALYSIS-
Distribution of room_bed
9|Page
Distribution of living_measure15
Distribution of lat
10 | P a g e
• There are outliers present in the living_measure15 variable.
• Two peaks are found in the distribution of lot measure15.
11 | P a g e
There are no outliers present in the cid variable.
12 | P a g e
• There are outliers present in the living_measure15 variable.
• Multiple peaks are found in the distribution of long.
• Also seems to be left skewed.
13 | P a g e
OUTLIERS CHECK-
We can see there are outliers in many columns except for the few columns-
cid
dayhours
ceil
yr_built
total_area
14 | P a g e
AFTER TREATMENT-
• For removing the outliers, we have used Inter Quartile Range method on the given dataset.
• Now we can see our data does not consist of any outliers.
15 | P a g e
PAIRPLOT-
In the above plot scatter diagrams are plotted for all the numerical columns in the dataset. A scatter
plot is a visual representation of the degree of correlation between any two columns. The pair plot
function in seaborn makes it very easy to generate joint scatter plots for all the columns in the data.
16 | P a g e
HEATMAP-
17 | P a g e
From the above pair-plot and correlation matrix we find that following have high correlation
HISTOGRAM-
18 | P a g e
19 | P a g e
Distribution of ceil
Total = 21387
Number of Groups = 7
Distribution of coast
Total = 21387
Number of Groups =3
20 | P a g e
Distribution of condition Total = 21387
Number of Groups =5
• most of the houses are rated 3 approx. 13881 no. of houses for their condition.
21 | P a g e
ENCODING-
The top 5 records of dataset after converting the categories is displayed below.
cid dayhours price room_bed room_bath living_measure lot_measure ceil coast sight ...
22 | P a g e
SCALING-
Scaling is necessary in this case as the variables/attributes in the dataset are on different scales and using
distance measure, so it is really important that all attributes/variables are on same scale before moving
further. Because of the above-mentioned reasons scaling is necessary in this case. To add further, for the given
dataset it is required because all the variables are expressed in different form. The values expressed in higher
units will outweigh the values expressed in lower units and therefore creating a disbalance in the overall
analysis. Scaling is a method to normalize the range of independent variables/attributes in the given dataset. It
is part of the data preparation step in the overall exploratory data analysis (EDA).
Scaled Data and box plot after scaling the data using standard scalar,
yr_built yr_renovated
zipcode lat long living_measure15
lot_measure15
furnished total_area
-0.17138 0 -0.82046 1.174785 -0.22647 0.068362 0.082345 0 1823
-0.78418 0 0.749731 -0.03896 0.434679 -0.48601 -0.96223 0 6392
-0.17138 0 0.749731 -0.2973 0.303903 0.992317 -1.34409 0 7734
1.29253 0 -1.41862 -1.61423 -0.00851 0.083761 -1.03232 0 7739
-1.60124 0 0.749731 0.045467 0.514598 -1.31757 -0.73315 0 7914
23 | P a g e
24 | P a g e
Business insights –
• Yes, the data is unbalanced for that we can use StandardScaler which will help in scaling the data
and will return the z-scores of every attribute.
• In this method, we convert variables with different scales of measurements into a single scale.
• By doing model training and then testing on it along with predictions can help in getting the accurate output.
• The dataset has significant number of outliers which were removed during the data preprocessing step done
on the given data set.
• Among the variables/attributes in the given dataset, Price is one of the important features as seen from the
feature importance parameters in the models.
• The best attributes which can help the business in predictions can be-
Quality
Condition
Total_area
Furnished
Yr_built
Room_bath
• Linear Regression can help in achieving the further required objection as linear regression model
helps in predicting the real estate values based on the given data
• Also, it can help the business or investors to know the trend of housing prices in a certain
required location.
• Also, the most important factor is location because it helps in determining the prevailing land
price.
25 | P a g e
THANKYOU
26 | P a g e