This project features a web app that predicts house prices using a linear regression model. Users can input details like location, square footage, bathrooms, and bedrooms through an HTML form. I've added a CI/CD pipeline with GitHub Actions, unit testing with pytest, and automated Docker containerization to improve deployment and robustness.
MIT License
This project implements a house price prediction model using linear regression, predicting prices based on features like location, total square feet, number of bathrooms, and bedrooms (BHK), with a Flask backend and a simple HTML frontend for user interaction. Building on the initial version, I've integrated a CI/CD pipeline using GitHub Actions for automated testing and deployment, added unit test cases with pytest
to ensure code quality, and automated Docker containerization for consistent deployments across environments. These enhancements significantly improve the application's robustness, maintainability, and scalability, making it production-ready.
pytest
to ensure application reliability.Ensure you have Python and pip installed on your system. You will also need the following Python libraries:
Clone this repository to your local machine:
git clone https://github.com/2003HARSH/House-Price-Prediction-using-Machine-Learning
cd House-Price-Prediction-using-Machine-Learning
You can install the required libraries using pip:
pip install -r requirements.txt
Run the Flask server with the following command:
python app.py
The server will start and listen on http://127.0.0.1:5000/
.
After the form is open enter the required values to get the output.
Pull the Docker Image:
docker pull 2003harsh/house_price_prediction
Run the Docker Container:
docker run -p 5000:5000 2003harsh/house_price_prediction
Access the Application:
Open your web browser and navigate to http://localhost:5000
to use the app.
Description: Receives house details and returns the predicted price.
Request Body:
{
"location": "Sarjapur",
"total_sqft": 1500,
"bath": 2,
"bhk": 3
}
Response:
{
"predicted_price": 550000.00
}
app.py
: Flask backend script.model.pkl
: Serialized linear regression model.index.html
: Frontend HTML form for user input.README.md
: This file.This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or issues, please contact [email protected].