Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🏠 House Price Prediction

A machine learning regression project that predicts residential house prices based on property features such as area, number of bathrooms, stories, and amenities — and identifies which features influence price the most.

📌 Built as part of the Xylofy Internship — Week 1 Project


📖 Overview

Real estate buyers and sellers often rely on guesswork or outdated comparisons to estimate a property's fair value. This project builds a regression model that predicts house prices from property features, evaluates model accuracy, and surfaces actionable insights for real estate businesses — backed by data, not intuition.


📊 Dataset

  • Source: Kaggle — Housing Prices Dataset
  • Records: 545 houses
  • Features: 13 (area, bedrooms, bathrooms, stories, mainroad, guestroom, basement, hotwaterheating, airconditioning, parking, prefarea, furnishingstatus, price)
  • Target variable: price (in INR)
  • Missing values: None

🛠️ Tech Stack

Tool Purpose
Python 3.x Core programming language
Jupyter Notebook Development environment
Pandas Data loading & cleaning
Scikit-learn Model training & evaluation
Matplotlib / Seaborn Data visualization
ipywidgets Interactive price predictor

⚙️ Project Workflow

1. Data Loading & Exploration

  • Loaded the dataset with Pandas
  • Explored shape, column types, and missing values
  • Identified price as the target variable

2. Data Cleaning

  • Verified no missing values or duplicates
  • Converted yes/no columns (mainroad, guestroom, basement, hotwaterheating, airconditioning, prefarea) to binary (1/0)
  • One-hot encoded furnishingstatus

3. Model Building

  • Split data 80/20 into train and test sets
  • Trained and evaluated three regression models:
Model MAE RMSE R² Score
Linear Regression 9,70,043 13,24,506 0.65
Random Forest 10,22,560 14,01,496 0.61
Decision Tree — — —

Linear Regression performed best, explaining ~65% of the variance in house prices.

4. Visualizations

  • 📊 Price distribution histogram
  • 🔥 Correlation heatmap
  • 🎯 Actual vs. predicted price scatter plot
  • 📈 Price vs. area (colored by bedrooms)
  • 🌟 Feature importance bar chart
  • 🥧 Market segmentation pie chart (Budget / Mid-Range / Luxury)

5. Insights & Recommendations

  • Top price drivers: area, bathrooms, stories, air conditioning, main road access
  • Surprising finding: number of bedrooms had less impact on price than expected
  • Business recommendation: highlight area, bathrooms, and AC in listings; preferred-area properties command the highest premiums

🤖 Bonus: Interactive Price Predictor

An interactive widget built with ipywidgets lets you estimate a house price using sliders and dropdowns — no code editing needed.

Features:

  • Real-time price prediction
  • Price category (Budget / Mid-Range / Luxury)
  • Price per sq.ft.
  • ±10% confidence range
  • Personalized tips to increase property value
# Example: Run the widget cells in order, then move the sliders
# and click "🏠 Predict Price"

⚠️ Note: Run all cells in order (Run → Run All) before using the widget — sliders and the prediction button depend on earlier cells being executed first.


📁 Repository Structure

HousePricePrediction_RitikaSen/
│
├── analysis.ipynb          # Complete notebook with all tasks
├── Housing.csv             # Dataset used
├── summary.pdf             # 1-page written summary of findings
├── charts/                 # All visualizations as PNG
│   ├── chart1_price_distribution.png
│   ├── chart2_correlation_heatmap.png
│   ├── chart3_actual_vs_predicted.png
│   ├── chart4_price_vs_area.png
│   ├── chart5_feature_importance.png
│   └── chart6_market_segmentation.png
└── README.md

🚀 How to Run

  1. Clone the repository

    git clone https://github.com/<your-username>/HousePricePrediction_RitikaSen.git
    cd HousePricePrediction_RitikaSen
  2. Install dependencies

    pip install pandas numpy matplotlib seaborn scikit-learn ipywidgets
  3. Launch Jupyter Notebook

    jupyter notebook
  4. Open analysis.ipynb and run all cells

    Run → Run All Cells
    

👤 Author

Ritika Sen Xylofy Internship — Week 1 Project | June 2026


📄 License

This project is for educational purposes as part of an internship assignment.

About

HousePricePrediction

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages