Skip to content

Latest commit

 

History

History
83 lines (56 loc) · 3.48 KB

File metadata and controls

83 lines (56 loc) · 3.48 KB

Why Linear Regression?

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 like Furnishing or Status by assigning distinct, measurable price bonuses or penalties to each category.

Pune Housing Price Prediction API

A Streamlit web application for predicting house prices in Pune using Linear Regression.

Features

  • 🏠 Interactive UI for entering property details
  • 📊 Real-time price predictions
  • 📈 Numeric and categorical feature inputs
  • 💰 Price displayed in multiple formats (Crores, Rupees, Lakhs)

Installation

  1. Install dependencies:

    pip install -r requirements.txt
  2. Ensure the CSV file is in the same directory:

    • PUNE_HOUSING.csv should be in the project folder

Running the App

From the project directory, run:

streamlit run app.py

This will start the Streamlit server and open the app in your default browser (usually at http://localhost:8501).

How to Use

  1. Enter Property Details in the sidebar:

    • Numeric features: Rate per Sq.Ft, Carpet Area, Super Area, etc.
    • Categorical features: Status, Floor Type, Furnishing, etc.
  2. View Prediction:

    • The predicted price appears in the main area
    • Price is displayed in multiple formats for convenience
  3. Input Summary:

    • Review your entered values in the summary table

Features Used in Model

  • Numeric: Rate_per_SqFt, Carpet_Area, Super_Area, Bathroom, Balcony, Car_Parking
  • Categorical: Status, Floor, Transaction, Furnishing, facing, overlooking, Society, Ownership, Under_Construction

Model Performance

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

Model Information

  • Algorithm: Linear Regression
  • Training/Test Split: 60% / 40%
  • Data Preprocessing: One-hot encoding, median imputation
  • Target Variable: House Price (in Crores)

Files

  • app.py - Main Streamlit application
  • requirements.txt - Python dependencies
  • PUNE_HOUSING.csv - Dataset file
  • Linear_regression.ipynb - Jupyter notebook with model development