A machine learning project for wine quality prediction with MLOps best practices, featuring Data Version Control (DVC), MLflow tracking, and automated CI/CD pipelines.
This project demonstrates a complete MLOps workflow for predicting wine quality using machine learning. It incorporates:
- Data Version Control (DVC) for dataset management
- MLflow for experiment tracking and model registry
- Scikit-learn for model training
- AWS S3 as remote storage for DVC
- GitHub Actions for CI/CD automation
- Continuous Training in CI pipeline
- ✅ Version-controlled datasets with DVC
- ✅ Remote storage integration (AWS S3)
- ✅ Experiment tracking with MLflow
- ✅ Automated model training pipeline
- ✅ CI/CD workflows for continuous integration and deployment
- ✅ Reproducible ML workflows
Wine-prediction-using-dvc/
├── .dvc/ # DVC configuration
│ └── config # DVC remote storage settings
├── .github/ # GitHub Actions workflows (if configured)
│ └── workflows/
│ ├── ci.yml # Continuous Integration
│ └── cd.yml # Continuous Deployment
├── data/ # Data directory (tracked by DVC)
│ └── wine_sample.csv.dvc # DVC metadata file
├── requirements.txt # Python dependencies
├── .dvcignore # DVC ignore patterns
├── .gitignore # Git ignore patterns
└── README.md # This file
- Python 3.8+
- Git
- AWS account (for S3 remote storage)
- AWS credentials configured
-
Clone the repository
git clone https://github.com/Vidon212/Wine-prediction-using-dvc.git cd Wine-prediction-using-dvc -
Create a virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
This project uses AWS S3 for remote data storage:
# Configure DVC remote (already set up)
dvc remote list
# Output: wineremote s3://mlops-wine-dvc-bucketEnsure your AWS credentials are configured:
# Option 1: AWS CLI
aws configure
# Option 2: Environment variables
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
export AWS_DEFAULT_REGION=your_region# Pull the wine dataset from S3
dvc pullThis will download wine_sample.csv to the data/ directory.
# After adding or modifying data
dvc add data/wine_sample.csv
dvc push
git add data/wine_sample.csv.dvc .gitignore
git commit -m "Update dataset"# Train the model locally
python train.py # (if train.py exists)The project includes continuous training in the CI workflow:
- Automated Training: Model training runs automatically on each push to the repository
- Artifact Storage: Trained models are uploaded as GitHub Actions artifacts
- Reproducibility: Ensures consistent training environment across runs
The CI workflow (ci.yml) includes:
- Code checkout
- Python environment setup
- Dependency installation
- Model training
- Artifact upload
The CD workflow (cd.yml) handles:
- Model deployment
- Service updates
- Production releases
Key packages (see requirements.txt):
- pandas: Data manipulation
- scikit-learn: Machine learning algorithms
- joblib: Model serialization
- numpy: Numerical computing
- mlflow: Experiment tracking
- dvc: Data version control
- dvc-s3: S3 remote storage support
-
Pull the latest data
dvc pull
-
Train the model
python train.py
-
Track experiments with MLflow
mlflow ui # Open http://localhost:5000 in your browser -
Version your changes
git add . git commit -m "Your message" git push
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is open source and available under the MIT License.
- DVC for data version control
- MLflow for experiment tracking
- Scikit-learn for ML algorithms
- AWS S3 for remote storage
Vidon - @Vidon212
Project Link: https://github.com/Vidon212/Wine-prediction-using-dvc
Note: Make sure to configure your AWS credentials before running DVC commands that interact with the S3 remote storage.