Are you sure you want to delete this access key?
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
Legend |
---|
DVC Managed File |
Git Managed File |
Metric |
Stage File |
External File |
A complete MLOps pipeline demonstrating production-ready machine learning workflows using MLflow, DagsHub, DVC, and Evidently for experiment tracking, model versioning, and drift detection.
# Install and run
pip install -r requirements.txt
python simple_train.py # Train model (~30 seconds)
python app.py # Start API server
# Test the API
curl -X POST "http://localhost:8000/predict" \
-H "Content-Type: application/json" \
-d '{"features": [5.1, 3.5, 1.4, 0.2]}'
๐ Access: http://localhost:8000 | ๐ Docs: http://localhost:8000/docs
docker build -t iris-model-api .
docker run -p 8000:8000 iris-model-api
# Complete pipeline with tracking
dvc repro # Run DVC pipeline
# OR
python -m src.pipeline # Direct execution
GET /
- API status and welcomePOST /predict
- Make predictions (iris classification)import requests
response = requests.post(
"http://localhost:8000/predict",
json={"features": [5.1, 3.5, 1.4, 0.2]}
)
print(response.json())
# Output: {"prediction": 0, "probability": 0.95, "class": "setosa"}
MLflow_demo/
โโโ app.py # FastAPI model serving
โโโ simple_train.py # Quick model training
โโโ test_api.py # API testing suite
โโโ Dockerfile # Container configuration
โ
โโโ data/
โ โโโ raw/ # Original datasets (DVC tracked)
โ โโโ processed/ # Cleaned data
โ โโโ drift_baseline/ # Drift reports
โ
โโโ src/
โ โโโ pipeline.py # End-to-end ML pipeline
โ โโโ train.py # Model training with MLflow
โ โโโ data_preprocessing.py # Data cleaning
โ โโโ drift_detection.py # Evidently monitoring
โ
โโโ scripts/ # Utility scripts
โโโ dvc.yaml # Pipeline configuration
โโโ requirements.txt
mlflow ui
โ http://localhost:5000data/drift_baseline/
# Clone repository
git clone https://github.com/yahiaehab10/MLFlow_demo.git
cd MLFlow_demo
# Install dependencies
pip install -r requirements.txt
# Configure DagsHub (optional)
dvc remote modify origin password <your-dagshub-token>
# Run API tests
python test_api.py
# Test pipeline
dvc repro --dry
# Manual testing
python -c "
import requests
r = requests.post('http://localhost:8000/predict',
json={'features': [5.1, 3.5, 1.4, 0.2]})
print(r.json())
"
Issue | Solution |
---|---|
DVC authentication error | dvc remote modify origin password <token> |
MLflow connection timeout | Check internet connection and DagsHub access |
Missing dependencies | pip install -r requirements.txt |
Docker build fails | Ensure Docker daemon is running |
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Press p or to see the previous file or, n or to see the next file
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?
Are you sure you want to delete this access key?