Skip to content

Sankesh12/House-Price-Prediction

Repository files navigation

🏠 House Price Prediction

  • A Machine Learning based web application that predicts house prices based on different features like location, rooms, income and population.

🚀 Project Overview

  • This project uses Data Analysis, Feature Engineering and Machine Learning to predict house prices.

  • The model is trained on the California Housing Dataset and deployed using Streamlit for real-time predictions.

🛠 Technologies Used

  • Python

  • Pandas

  • NumPy

  • Seaborn

  • Matplotlib

  • Scikit-learn

  • Streamlit

  • Joblib

🤖 Machine Learning Models Used

  • Linear Regression

  • Random Forest Regressor

  • GridSearchCV (Hyperparameter Tuning)

📊 Dataset Details

  • Dataset: California Housing Dataset

  • Problem Type: Regression

  • Target Variable: median_house_value

🔍 Methodology

1️⃣ Data Cleaning

  • Checked dataset info

  • Handled missing values using dropna()

  • Removed null records

2️⃣ Feature Engineering

Log transformation on skewed data:

  • total_rooms

  • total_bedrooms

  • population

  • households

Created new features:

  • bedroom_ratio = bedrooms / rooms

  • household_rooms = rooms / households

One-Hot Encoding for:

  • ocean_proximity

3️⃣ Exploratory Data Analysis (EDA)

  • Histogram plots for feature distribution

  • Correlation heatmap

  • Scatter plot (latitude vs longitude with price)

📸 Project Screenshots

image alt image alt

📈 Model Evaluation

Evaluation Metrics Used:

  • R² Score

  • Mean Squared Error (MSE)

  • Root Mean Squared Error (RMSE)

🏆 Model Performance

  • Linear Regression applied

  • Random Forest gave better accuracy

  • GridSearchCV used for best parameter tuning

  • Final model selected based on performance

💡 Key Insights

  • Location (latitude & longitude) strongly affects house prices

  • Median income has high impact on prediction

  • Engineered features improved model accuracy

  • Log transformation helped normalize skewed data

🌐 Deployment

  • Model saved using Joblib

  • Scaler also saved

  • Integrated into a Streamlit Web App

Users can:

  • Enter house details

  • Click Predict

  • Get estimated house price instantly

▶️ How to Run the Project

##Install dependencies

  • pip install -r requirements.txt

##Run Streamlit app

  • streamlit run app.py

🔮 Future Improvements

  • Add more advanced models (XGBoost, Gradient Boosting)

  • Improve feature engineering

  • Add map-based visualization

  • Create better UI/UX

About

• Created a House Price Prediction system using housing and location data with preprocessing, feature engineering, and Random Forest regression. • Deployed a Streamlit app for real-time price prediction.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages