This repository contains a project for predicting house prices in Bangalore using machine learning techniques.
This project aims to predict house prices in Bangalore based on historical data. It utilizes features such as number of bedrooms (bhk), location, area type, total square feet, number of bathrooms, and number of balconies to build predictive models.
The dataset used in this project is sourced from Kaggle.
- Python
- Pandas, NumPy, Scikit-learn, Matplotlib
- Jupyter Notebook (for data exploration and modeling)
- Nginx, AWS (for cloud hosting and deployment)
model.ipynb
: Jupyter notebook containing code for data preprocessing, model training, and evaluation.bangalore_home_prices_model.pickle
: Pickle file containing the trained machine learning model.
To run the Bangalore House Price Prediction application locally using Nginx, follow these steps:
-
Start the Flask Server:
- Navigate to the server directory where
server.py
is located. - Start the Flask server using the following command:
python server.py
This will start your Flask server on
http://localhost:5000
. - Navigate to the server directory where
-
Configure Nginx:
- Open your Nginx configuration file (
nginx.conf
). Modify the configuration to proxy requests to your Flask server:server { listen 80; server_name localhost; location / { proxy_pass http://localhost:5000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } }
- Open your Nginx configuration file (
-
Start Nginx:
- Start Nginx by running
nginx.exe
from the command line.
- Start Nginx by running
-
Access the Application:
- Open your web browser and navigate to
http://localhost
. This will display the Bangalore House Price Prediction application.
- Open your web browser and navigate to
-
Client Setup:
- Ensure your client (e.g., HTML file
app.html
) is configured to make requests tohttp://localhost
for data and predictions.
- Ensure your client (e.g., HTML file
-
Making Predictions:
- Use the application interface to input data and obtain predictions for house prices in Bangalore.
-
Stopping the Servers:
- To stop the Flask server, terminate the process in the terminal.
- To stop Nginx, execute
nginx.exe -s stop
from the command line.
The model achieved competitive scores in RMSE and MAE, indicating its effectiveness in predicting house prices.
In the future, improvements could include:
- Exploring ensemble methods for improved prediction accuracy.
- Incorporating additional relevant features such as property age or neighborhood amenities.
- Optimizing model hyperparameters for better performance.
This project is licensed under the MIT License.
This project was inspired by a coding challenge from Codebasics. Link to Codebasics.
For questions or collaborations, please reach out at madhurdixit37@gmail.com.