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
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.
- 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
| 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 |
- Loaded the dataset with Pandas
- Explored shape, column types, and missing values
- Identified
priceas the target variable
- Verified no missing values or duplicates
- Converted yes/no columns (
mainroad,guestroom,basement,hotwaterheating,airconditioning,prefarea) to binary (1/0) - One-hot encoded
furnishingstatus
- 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.
- 📊 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)
- 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
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.
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
-
Clone the repository
git clone https://github.com/<your-username>/HousePricePrediction_RitikaSen.git cd HousePricePrediction_RitikaSen
-
Install dependencies
pip install pandas numpy matplotlib seaborn scikit-learn ipywidgets
-
Launch Jupyter Notebook
jupyter notebook
-
Open
analysis.ipynband run all cellsRun → Run All Cells
Ritika Sen Xylofy Internship — Week 1 Project | June 2026
This project is for educational purposes as part of an internship assignment.