House Price Prediction Analysis Project
House Price Prediction Analysis Project
September 2, 2024
[8]: df
2
2 Data Cleaning
[10]: Home 0
Price 0
SqFt 0
Bedrooms 0
Bathrooms 0
Offers 0
Brick 0
Neighborhood 0
dtype: int64
Offers
count 128.000000
mean 2.578125
std 1.069324
min 1.000000
25% 2.000000
50% 3.000000
75% 3.000000
max 6.000000
3
sns.histplot(df['Price'], bins=50, kde=True)
plt.title('Distribution of House Prices')
plt.xlabel('Price')
plt.ylabel('Frequency')
plt.show()
4
[18]: # Average house price f o r number o f bedrooms
plt.figure(figsize=(8, 6))
sns.barplot(x='Bedrooms', y='Price', data=df, palette='coolwarm')
plt.title('Average House Price by Number of Bedrooms')
plt.xlabel('Number of Bedrooms')
plt.ylabel('Average Price')
plt.show()
C:\Users\SOUMEN\AppData\Local\Temp\ipykernel_19820\3439380094.py:3:
FutureWarning:
5
[23]: # Average house price per Neighborhood
plt.figure(figsize=(12, 6))
sns.boxplot(x='Neighborhood', y='Price', data=df)
plt.xticks(rotation=45)
plt.title('House Prices by Neighborhood')
plt.show()
6
Insights from the Analysis:
From this project, we can conclude the following insights-
• Size and Price: House size is one of the key factors driving house prices. Larger
homes generally command higher prices.
• Bedrooms and Price: The number of bedrooms also impacts house prices, but the
relationship is not linear—other factors like location and size play important roles.
• Location's Influence: Location is a critical factor in determining house prices, with
significant variation across different regions or neighborhoods.