This repository contains an end-to-end project for predicting wine quality using machine learning. The main objectives are to run Machine Learning pipelines and deploy the application for predicting wine quality. It also includes automated testing and continuous integration for robust development.
Clone the project:
git clone https://github.com/DimitrisReppas/End-to-end-wine_quality_prediction.git
Create and activate an environment:
conda create -n your_env_name python=3.7 -y
conda activate your_env_name
Install the requirements for this project:
pip install -r requirements.txt
The dataset we use can be found here.
Download it and put it into the data_given/ directory.
git init
dvc init
dvc add data_given/winequality.csv
Execute the following command in a new terminal window:
mlflow server --backend-store-uri sqlite:///mlflow.db --default-artifact-root ./artifacts --host 0.0.0.0 -p 1234
Navigate to the MLflow UI at http://localhost:1234/
The pipeline includes the following stages:
- data loading
- data splitting
- model training
- model evaluation on the test set
- automatically choosing the best model from the mlflow.db
Run the DVC Pipeline:
dvc repro
These tests ensure that the code handles different scenarios correctly:
- Producing valid results for correct input ranges.
- Raising appropriate exceptions or returning error messages for out-of-range inputs and incorrect column names. Run the tests:
pytest -v
Each time you perform a push or pull request, automatic testing of your code is triggered using the ci_cd.yaml in the .github/workflows directory.
python app.py
The Docker container is configured to handle POST requests.
-
open Docker Desktop application
-
Build the Docker container:
docker-compose build
- Run the Docker container:
docker-compose up -d
- Open your preferred browser and navigate to http://127.0.0.1:5000/ to start using the application.
This repository is inspired and based on https://github.com/c17hawke/simple-dvc-demo and on https://www.youtube.com/playlist?list=PLZoTAELRMXVOk1pRcOCaG5xtXxgMalpIe