|
1 | | -# House Price Predictor |
| 1 | +# House Price Prediction Model |
2 | 2 |
|
3 | | -A Flask web application for predicting house prices in major Indian cities using machine learning. |
| 3 | +A machine learning-powered web application that predicts house prices based on various property features. This project combines data science techniques with a user-friendly web interface to provide accurate real estate price estimates. |
4 | 4 |
|
5 | | -## Features |
6 | | - |
7 | | -- Interactive map with city and locality selection |
8 | | -- Modern responsive UI with animations |
9 | | -- Real-time price predictions |
10 | | -- Support for 16+ major Indian cities |
11 | | -- Advanced property details input |
12 | | -- Mobile-friendly design |
13 | | - |
14 | | -## Deployment on Render.com |
15 | | - |
16 | | -### Prerequisites |
17 | | - |
18 | | -Make sure you have these files in your repository: |
19 | | -- `mdl.joblib` (your trained model) |
20 | | -- `fixed_label_encoders.joblib` (your label encoders) |
21 | | - |
22 | | -### Steps to Deploy |
23 | | - |
24 | | -1. **Push to GitHub**: Make sure all files are in your GitHub repository |
| 5 | +## Overview |
25 | 6 |
|
26 | | -2. **Connect to Render**: |
27 | | - - Go to [render.com](https://render.com) |
28 | | - - Sign up/Login with your GitHub account |
29 | | - - Click "New +" → "Web Service" |
30 | | - - Connect your GitHub repository |
| 7 | +This project implements a comprehensive house price prediction system that leverages machine learning algorithms to estimate property values. The system processes various property characteristics such as location, size, amenities, and market conditions to provide accurate price predictions. |
31 | 8 |
|
32 | | -3. **Configure Service**: |
33 | | - - **Name**: `house-price-predictor` |
34 | | - - **Environment**: `Python 3` |
35 | | - - **Build Command**: `pip install -r requirements.txt` |
36 | | - - **Start Command**: `gunicorn app:app` |
37 | | - - **Instance Type**: Free tier is sufficient for testing |
| 9 | +**Key Objectives:** |
| 10 | +- Provide accurate house price predictions for buyers and sellers |
| 11 | +- Offer an intuitive web interface for easy interaction |
| 12 | +- Demonstrate end-to-end machine learning pipeline implementation |
| 13 | +- Enable real-time price estimation based on property features |
38 | 14 |
|
39 | | -4. **Deploy**: Click "Create Web Service" |
40 | | - |
41 | | -### Environment Variables |
42 | | - |
43 | | -No additional environment variables are required for basic functionality. |
44 | | - |
45 | | -### File Structure |
46 | | - |
47 | | -\`\`\` |
48 | | -your-repo/ |
49 | | -├── app.py # Main Flask application |
50 | | -├── requirements.txt # Python dependencies |
51 | | -├── render.yaml # Render configuration |
52 | | -├── runtime.txt # Python version |
53 | | -├── Procfile # Process file for deployment |
54 | | -├── templates/ |
55 | | -│ └── index.html # Frontend template |
56 | | -├── mdl.joblib # Your ML model (add this) |
57 | | -├── fixed_label_encoders.joblib # Your encoders (add this) |
58 | | -└── README.md # This file |
59 | | -\`\`\` |
60 | | - |
61 | | -### Troubleshooting |
| 15 | +## Features |
62 | 16 |
|
63 | | -1. **Build Fails**: Check that `requirements.txt` has all dependencies |
64 | | -2. **Model Not Found**: Ensure `mdl.joblib` and `fixed_label_encoders.joblib` are in root directory |
65 | | -3. **Port Issues**: The app automatically uses Render's PORT environment variable |
66 | | -4. **Static Files**: All CSS/JS is inline, no static file issues |
| 17 | +- **Price Prediction**: Advanced ML algorithms for accurate house price estimation |
| 18 | +- **Web Interface**: User-friendly HTML templates for easy interaction |
| 19 | +- **Data Processing**: Robust data preprocessing and feature engineering |
| 20 | +- **Model Persistence**: Serialized models using joblib for quick loading |
| 21 | +- **Responsive Design**: Mobile-friendly web interface |
| 22 | +- **Real-time Predictions**: Instant price estimates upon feature input |
| 23 | +- **Feature Engineering**: Advanced preprocessing with label encoders |
| 24 | + |
| 25 | +## Technologies Used |
| 26 | + |
| 27 | +### **Backend & ML** |
| 28 | +- **Python** - Core programming language |
| 29 | +- **scikit-learn** - Machine learning algorithms and preprocessing |
| 30 | +- **pandas** - Data manipulation and analysis |
| 31 | +- **numpy** - Numerical computing |
| 32 | +- **joblib** - Model serialization and persistence |
| 33 | +- **Flask/Django** (inferred from app_updated.py) - Web framework |
| 34 | + |
| 35 | +### **Frontend** |
| 36 | +- **HTML5** - Web page structure and templates |
| 37 | +- **CSS3** - Styling and responsive design |
| 38 | +- **JavaScript** - Interactive frontend functionality |
| 39 | + |
| 40 | +### **Development Tools** |
| 41 | +- **Jupyter Notebook** - Data exploration and model development |
| 42 | +- **Git** - Version control |
| 43 | + |
| 44 | +## Models |
| 45 | + |
| 46 | +The project implements multiple machine learning models for house price prediction: |
| 47 | + |
| 48 | +### **Primary Models** |
| 49 | +- **Linear Regression** - Baseline model for price prediction |
| 50 | +- **Random Forest Regressor** - Ensemble method for improved accuracy |
| 51 | + |
| 52 | +### **Model Features** |
| 53 | +- **Feature Engineering**: Advanced preprocessing with label encoders |
| 54 | +- **Cross-validation**: Robust model evaluation techniques |
| 55 | +- **Hyperparameter Tuning**: Optimized model parameters |
| 56 | +- **Model Persistence**: Serialized models (`mdl.joblib`) for production use |
| 57 | + |
| 58 | +## Project Structure |
| 59 | + |
| 60 | +``` |
| 61 | +House_Prices_Pred-Model/ |
| 62 | +│ |
| 63 | +├── templates/ # HTML templates for web interface |
| 64 | +│ ├── index.html # Main prediction interface |
| 65 | +│ |
| 66 | +├── Untitled.ipynb # Jupyter notebook for model development |
| 67 | +├── app_updated.py # Main Flask/Django application |
| 68 | +├── mdl.joblib # Serialized trained model |
| 69 | +├── fixed_label_encoders.joblib # Preprocessed label encoders |
| 70 | +├── requirements.txt # Python dependencies |
| 71 | +└── README.md # Project documentation |
| 72 | +``` |
| 73 | + |
| 74 | +## Installation |
| 75 | + |
| 76 | +### **Prerequisites** |
| 77 | +- Python 3.7 or higher |
| 78 | +- pip package manager |
| 79 | + |
| 80 | +### **Setup Steps** |
| 81 | + |
| 82 | +1. **Clone the repository** |
| 83 | + ```bash |
| 84 | + git clone https://github.com/Ajaysr01/House_Prices_Pred-Model.git |
| 85 | + cd House_Prices_Pred-Model |
| 86 | + ``` |
| 87 | + |
| 88 | +2. **Create virtual environment** (recommended) |
| 89 | + ```bash |
| 90 | + python -m venv venv |
| 91 | + source venv/bin/activate # On Windows: venv\\Scripts\\activate |
| 92 | + ``` |
| 93 | + |
| 94 | +3. **Install dependencies** |
| 95 | + ```bash |
| 96 | + pip install -r requirements.txt |
| 97 | + ``` |
| 98 | + |
| 99 | +4. **Run the application** |
| 100 | + ```bash |
| 101 | + python app_updated.py |
| 102 | + ``` |
| 103 | + |
| 104 | +5. **Access the web interface** |
| 105 | + Open your browser and navigate to `http://localhost:5000` |
| 106 | + |
| 107 | +## Usage |
| 108 | + |
| 109 | +### **Web Interface** |
| 110 | +1. Navigate to the main page |
| 111 | +2. Input property features: |
| 112 | + - Location/Area |
| 113 | + - Property size (sq ft) |
| 114 | + - Number of bedrooms/bathrooms |
| 115 | + - Property age |
| 116 | + - Additional amenities |
| 117 | +3. Click "Predict Price" |
| 118 | +4. View the estimated price and confidence interval |
| 119 | + |
| 120 | + |
| 121 | +## API Endpoints |
| 122 | + |
| 123 | +- **GET /** - Main prediction interface |
| 124 | +- **POST /predict** - Submit property data for price prediction |
| 125 | +- **GET /results** - Display prediction results |
| 126 | +- **GET /api/predict** - JSON API for programmatic access |
| 127 | + |
| 128 | +## Model Performance |
| 129 | + |
| 130 | +- **Root Mean Square Error (RMSE)**: Rs. 4034.80 |
| 131 | +- **R² Score**: 0.864 |
67 | 132 |
|
68 | | -### Local Development |
| 133 | +## Contributing |
69 | 134 |
|
70 | | -\`\`\`bash |
71 | | -# Install dependencies |
72 | | -pip install -r requirements.txt |
| 135 | +Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change. |
73 | 136 |
|
74 | | -# Run locally |
75 | | -python app.py |
76 | | -\`\`\` |
| 137 | +### **Development Setup** |
| 138 | +1. Fork the repository |
| 139 | +2. Create a feature branch (`git checkout -b feature/AmazingFeature`) |
| 140 | +3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) |
| 141 | +4. Push to the branch (`git push origin feature/AmazingFeature`) |
| 142 | +5. Open a Pull Request |
77 | 143 |
|
78 | | -Visit `http://localhost:5000` to test locally. |
| 144 | +## Author |
79 | 145 |
|
80 | | -### Support |
| 146 | +**Ajaysr01** |
| 147 | +- GitHub: [@Ajaysr01](https://github.com/Ajaysr01) |
| 148 | + |
| 149 | +## Acknowledgments |
| 150 | + |
| 151 | +- Thanks to the open-source community for the amazing libraries |
| 152 | +- Dataset providers for making real estate data available |
| 153 | +- Contributors and testers who helped improve the model |
| 154 | + |
| 155 | +--- |
81 | 156 |
|
82 | | -- Check Render logs for deployment issues |
83 | | -- Ensure model files are not in `.gitignore` |
84 | | -- Verify all dependencies are in `requirements.txt` |
| 157 | +⭐ **Star this repository if you found it helpful!** |
0 commit comments