In this project, Multiple Linear Regression was chosen as the foundational model for several strategic reasons:
- High Interpretability (White-Box Model): In real estate, stakeholders don't just want a price prediction; they need to know why a property is priced a certain way. Linear Regression provides transparent coefficients, allowing us to quantify the exact financial impact of each feature (e.g., calculating exactly how much value an additional bathroom or an extra 100 sqft of carpet area adds).
- Domain Alignment: Real estate pricing inherently follows linear trends—as square footage increases, the price generally increases proportionally. This model is mathematically designed to capture these foundational relationships perfectly.
- Robust Baseline Establishment: Achieving an initial R² score of 0.4596 with a simple linear model provides a strong, interpretable baseline. It sets a clear benchmark to evaluate whether the computational cost and complexity of more advanced models (like Random Forests or XGBoost) are justified in future iterations.
- Efficient Categorical Handling: Combined with One-Hot Encoding (
pd.get_dummies), the model elegantly handles categorical data likeFurnishingorStatusby assigning distinct, measurable price bonuses or penalties to each category.
A Streamlit web application for predicting house prices in Pune using Linear Regression.
- 🏠 Interactive UI for entering property details
- 📊 Real-time price predictions
- 📈 Numeric and categorical feature inputs
- 💰 Price displayed in multiple formats (Crores, Rupees, Lakhs)
-
Install dependencies:
pip install -r requirements.txt
-
Ensure the CSV file is in the same directory:
PUNE_HOUSING.csvshould be in the project folder
From the project directory, run:
streamlit run app.pyThis will start the Streamlit server and open the app in your default browser (usually at http://localhost:8501).
-
Enter Property Details in the sidebar:
- Numeric features: Rate per Sq.Ft, Carpet Area, Super Area, etc.
- Categorical features: Status, Floor Type, Furnishing, etc.
-
View Prediction:
- The predicted price appears in the main area
- Price is displayed in multiple formats for convenience
-
Input Summary:
- Review your entered values in the summary table
- Numeric: Rate_per_SqFt, Carpet_Area, Super_Area, Bathroom, Balcony, Car_Parking
- Categorical: Status, Floor, Transaction, Furnishing, facing, overlooking, Society, Ownership, Under_Construction
The current Linear Regression model achieves the following baseline metrics on the test set:
| Metric | Value |
|---|---|
| Mean Absolute Error (MAE) | 0.6427 Cr |
| Mean Squared Error (MSE) | 1.3583 |
| Root Mean Squared Error (RMSE) | 1.1655 Cr |
| R² Score | 0.4596 |
- Algorithm: Linear Regression
- Training/Test Split: 60% / 40%
- Data Preprocessing: One-hot encoding, median imputation
- Target Variable: House Price (in Crores)
app.py- Main Streamlit applicationrequirements.txt- Python dependenciesPUNE_HOUSING.csv- Dataset fileLinear_regression.ipynb- Jupyter notebook with model development