Skip to content

🏠 Built with machine learning, Dockerized for containerization, and automated with GitHub Actions for seamless CI/CD deployment with Render.

License

Notifications You must be signed in to change notification settings

Md-Emon-Hasan/Ml-Project-Boston-House-Price-Prediction-using-Docker-and-GitHub-Action-with-Deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🏑 Boston House Price Prediction System

Welcome to the Boston House Price Prediction System repository! This project leverages machine learning to predict housing prices based on various features. It integrates Docker for containerization, GitHub Actions for CI/CD, and deployment on Render for live hosting.

Capture

πŸ“‹ Contents


πŸ“– Introduction

This repository showcases a machine learning project aimed at predicting housing prices in Boston based on various features. The project utilizes Docker for containerization, GitHub Actions for CI/CD, and is deployed on Render for a live demonstration.


πŸ” Topics Covered

  • Machine Learning Models: Training models to predict housing prices.
  • Data Preprocessing: Techniques for cleaning and preparing the Boston housing dataset.
  • Model Evaluation: Assessing the performance of the regression model.
  • Deployment: Implementing the model as a web service using Flask.
  • Docker: Containerizing the application for consistent deployment across environments.
  • CI/CD: Automating tests and deployments with GitHub Actions.
  • Render: Deploying the application on Render for live access.

πŸš€ Getting Started

To get started with this project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/Md-Emon-Hasan/Ml-Project-Boston-House-Price-Prediction-using-Docker-and-GitHub-Action-with-Deployment.git
  2. Navigate to the project directory:

    cd Ml-Project-Boston-House-Price-Prediction-using-Docker-and-GitHub-Action-with-Deployment
  3. Create a virtual environment and activate it:

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  4. Install the dependencies:

    pip install -r requirements.txt
  5. Run the application:

    python app.py
  6. Open your browser and visit:

    http://127.0.0.1:5000/
    

πŸŽ‰ Live Demo

Check out the live version of the Boston House Price Prediction app here.


🐳 Docker and CI/CD

Docker

This project is containerized using Docker to ensure that the environment is consistent across different systems.

  1. Build the Docker image:

    docker build -t boston-house-price-predictor .
  2. Run the Docker container:

    docker run -p 5000:5000 boston-house-price-predictor
  3. Visit the application:

    http://127.0.0.1:5000/
    

CI/CD with GitHub Actions

This project uses GitHub Actions for continuous integration and deployment. Each commit triggers the following workflow:

  • Linting and Testing: Automatically runs linting and tests to ensure code quality.
  • Build and Deploy: Builds the Docker image and deploys the application to a cloud platform (e.g., Render, Heroku).

You can find the CI/CD workflow file in .github/workflows/ci-cd.yml.


🌐 Deploy on Render

To deploy this application on Render, follow these steps:

  1. Sign up for Render: Visit Render and sign up for an account.

  2. Create a new Web Service:

    • Select "New Web Service" from your Render dashboard.
    • Connect your GitHub repository.
    • Select your desired branch (e.g., main) and set up the build and runtime settings.
  3. Deploy: Render will automatically build and deploy your application. Once the deployment is successful, your application will be live.

  4. Access your live app: Your application will be accessible via a Render-generated URL.


🌟 Best Practices

Recommendations for maintaining and improving this project:

  • Model Updating: Continuously retrain the model with new data to improve accuracy.
  • Container Security: Ensure the Docker container is secure and free from vulnerabilities.
  • Error Handling: Implement comprehensive error handling in both the app and the CI/CD pipeline.
  • Documentation: Keep the documentation up-to-date with the latest changes and improvements.

❓ FAQ

Q: What is the purpose of this project? A: This project predicts housing prices in Boston based on various features, demonstrating the use of machine learning, Docker, and CI/CD practices.

Q: How can I contribute to this repository? A: Refer to the Contributing section for details on how to contribute.

Q: Can I deploy this app on cloud platforms? A: Yes, you can deploy the Dockerized app on platforms such as Heroku, Render, or AWS.


πŸ› οΈ Troubleshooting

Common issues and solutions:

  • Issue: Docker Container Not Running Solution: Ensure that Docker is properly installed and the image was built successfully.

  • Issue: CI/CD Pipeline Failing Solution: Check the GitHub Actions logs for errors and ensure all tests pass locally before committing.

  • Issue: Model Accuracy Low Solution: Verify that the training data is preprocessed correctly and consider tuning the hyperparameters of the model.


🀝 Contributing

Contributions are welcome! Here's how you can contribute:

  1. Fork the repository.

  2. Create a new branch:

    git checkout -b feature/new-feature
  3. Make your changes:

    • Add features, fix bugs, or improve documentation.
  4. Commit your changes:

    git commit -am 'Add a new feature or update'
  5. Push to the branch:

    git push origin feature/new-feature
  6. Submit a pull request.


πŸ“š Additional Resources

Explore these resources for more insights into Docker, CI/CD, and machine learning:


πŸ’ͺ Challenges Faced

Some challenges during development:

  • Setting up Docker for seamless deployment across environments.
  • Configuring the CI/CD pipeline to automate the testing and deployment process.
  • Ensuring the model performs well with a limited dataset.

πŸ“š Lessons Learned

Key takeaways from this project:

  • Hands-on experience with Docker for containerizing machine learning applications.
  • Setting up CI/CD pipelines for automated testing and deployment.
  • Importance of continuous model improvement and deployment best practices.

🌟 Why I Created This Repository

This repository was created to demonstrate the end-to-end process of developing, containerizing, and deploying a machine learning model for predicting housing prices, with a focus on using Docker and CI/CD best practices.


πŸ“ License

This repository is licensed under the MIT License. See the LICENSE file for more details.


πŸ“¬ Contact


Feel free to adjust and expand this template based on the specifics of your project and requirements.


About

🏠 Built with machine learning, Dockerized for containerization, and automated with GitHub Actions for seamless CI/CD deployment with Render.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages