Skip to content

An end-to-end Machine Learning project that predicts house prices based on property features like area, location attributes, and amenities. This project covers everything from data preprocessing and model training to web deployment using Flask.

Notifications You must be signed in to change notification settings

CodeWithParthiv/House-Price-Prediction

Repository files navigation

House Price Prediction using Machine Learning

An end-to-end Machine Learning project that predicts house prices based on property features like area, location attributes, and amenities. This project covers everything from data preprocessing and model training to web deployment using Flask.

Python Flask Machine Learning Deployment


📌 Table of Contents


📖 Overview

This project solves a regression problem where the goal is to estimate the price of a house based on features like:

  • Area (sq ft)
  • Number of bedrooms & bathrooms
  • Road access (mainroad)
  • Amenities like guest room, air conditioning, hot water, etc.
  • Parking availability and furnishing status

🎥 Demo

Watch the full walkthrough video on YouTube

Screenshots

Demo Screenshot Demo Screenshot


📁 Project Structure

├── app.py # Flask backend
├── train_model.py # Model training script
├── housing.csv # Dataset
├── house_price_model.joblib # Trained model
├── scaler.joblib # Saved scaler
├── label_encoders.joblib # Saved label encoders
├── requirements.txt # Required packages
└── templates/
└── index.html # Web UI

🚀 Features

  • Categorical variable encoding
  • Feature scaling using StandardScaler
  • Random Forest Regressor for price prediction
  • Reusable model, scaler, and encoder artifacts
  • Flask web interface and API endpoint
  • Real-time predictions

🧠 Tech Stack

  • Languages: Python
  • Libraries: pandas, numpy, scikit-learn, joblib, flask
  • Tools: HTML/CSS, Flask
  • Model: Random Forest Regressor

⚙️ How to Run

  1. Clone the repository
git clone https://github.com/yourusername/house-price-prediction.git
cd house-price-prediction
  1. Install dependencies
pip install -r requirements.txt
  1. Train the model
python train_model.py
  1. Run the Flask app
python app.py
  1. Open in your browser
http://127.0.0.1:5000/

📈 Model Performance

Metric	Score
Train R²	0.8783
Test R²	0.5917
Model Size	0.17 MB

🔧 Future Improvements

  • Deploy the app on Render or Heroku

  • Add visual charts for better insights

  • Improve UI/UX with form validations

  • Use GridSearchCV for better hyperparameter tuning


🤝 Connect with Me

About

An end-to-end Machine Learning project that predicts house prices based on property features like area, location attributes, and amenities. This project covers everything from data preprocessing and model training to web deployment using Flask.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published