Skip to content

JAYASIMMA/House_Price_Prediction

Repository files navigation

🏠 House Price Prediction Web App

This project is a machine learning-based web application built with Streamlit for predicting house prices. It uses Linear Regression and optionally XGBoost, trained on housing data with preprocessing steps included in a pipeline.


📁 Project Structure


House\_Price\_Prediction/
│
├── dataset/
│   ├── train.csv
│   ├── test.csv
│   └── sample\_submission.csv
│
├── oneshot\_linear.py             # Train linear regression model
│
├── dataset/
│   ├── train.csv
│   ├── test.csv
│   └── sample\_submission.csv
│
├── train\_xgboost.py             # Train XGBoost model (optional)
├── app.py                       # Streamlit frontend app
├── zero\_shot\_model.pkl          # Trained model file (e.g., Linear or XGBoost)
│
├── dataset/
│   ├── train.csv
│   ├── test.csv
│   └── sample\_submission.csv
│
├── submission\_oneshot\_linear.csv # Generated submission file
├── requirements.txt
└── README.md


🚀 Features

  • Upload custom house data and get predicted price
  • Interactive sidebar for input features
  • Visualizations:
    • Histogram of Sale Prices
    • Correlation Heatmap
    • Feature Importance (for XGBoost models)
  • Preprocessing includes:
    • Missing value handling
    • One-hot encoding
    • Model serialization using joblib

📦 Requirements

Install dependencies using:

pip install -r requirements.txt

requirements.txt

pandas
scikit-learn
joblib
xgboost
streamlit
matplotlib
seaborn

🧠 Training the Model

➤ Linear Regression

python oneshot_linear.py

This will:

  • Train a model on train.csv
  • Save predictions to submission_oneshot_linear.csv
  • Export trained model as oneshot_linear_model.pkl

➤ XGBoost (optional)

python train_xgboost.py

Exports model as xgboost_model.pkl


💻 Running the Web App

To launch the Streamlit frontend:

streamlit run app.py

Make sure your trained model (e.g., zero_shot_model.pkl) is present in the directory.


🔍 Example Inputs

  • Numerical Inputs: LotArea, GrLivArea, YearBuilt, etc.
  • Categorical Inputs: Neighborhood, HouseStyle, etc.

📊 Screenshots

Screenshot 2025-06-13 180409 Screenshot 2025-06-13 180901 Screenshot 2025-06-13 185950 Screenshot 2025-06-13 191924 Screenshot 2025-06-13 192013 Screenshot 2025-06-13 192036 Screenshot 2025-06-13 192051 Screenshot 2025-06-13 192157 Screenshot 2025-06-13 192302


🤖 Model Notes

  • Linear Regression gives a good baseline performance.
  • XGBoost supports feature importance plotting.
  • Trained pipeline includes full preprocessing using ColumnTransformer.

🧾 License

This project is licensed under the MIT License.


🙋‍♂️ Author

Jayasimma D

Feel free to connect on LinkedIn or contribute to this project!

About

This project aims to predict house prices based on features such as area, number of rooms, and other relevant attributes using a Linear Regression model.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors