Complete end-to-end MlOps implementation for training, maintaining and monitoring a machine learning model that predicts the price of an old (second hand) car based on several different relevant factors.
MlFlow - For Experiment Tracking, Model registry
Prefect - For model orchestration
Flask and Docker - For Deployment
Grafana - For Drift detection / Monitoring
Create a virtual environment using the provided requirements.txt and run the code below in the same.
Ipython notebooks regarding model creation are provided in 'ML-experiments' folder.
cd into the project folder where 'mlflow.db' is located. Use the command mlflow ui --backend-store-uri sqlite:///mlflow.db
to start the GUI for mlflow. You can view the dashboard in chrome browser at "http://127.0.0.1:5000" (default port) A dashboard as show below will be generated. The models tab allows the user for model versioning.
Set up an api to use PREFECT using the command prefect config set PREFECT_API_URL=http://127.0.0.1:4200/api
Then, start the server using prefect server start
This will start the UI at http://127.0.0.1:4200
Use the deployment tab to schedule runs to train or deploy the model.
Two types of deployment are provided.
- One is using simple model's pickle file, FLASK API and Docker.
- Second way is to use the Models from Model registry and deploy it using Docker file.
Docker images are provided in both the ways which can be easily used to deploy the model at any platform of your choice.
As the dataset used in this problem statement is of static nature, Drift is checked for in test dataset with respect to training dataset. The code and visualizations for the same are available in 'Monitoring' folder.
- Model deployed as a web service on Hugging Face spaces