ML Flow Basic Approach — Part 2(Deploy)

Rohit Jain
2 min readApr 2, 2019

--

ML Flow

To go through the first tutorial, follow this link : Part 1

Uploading MLFlow project on github is quite simple and the best thing about running ML FLow project is that you don’t have to install anything but only mlflow. This resolves one of the challenges of ML Life cycle. To provide you a go through, following are the challenges of ML Life cycle:

  1. Tracking of parameters (MLFlow Tracking)
  2. Deployment (MLFlow Projects)
  3. Lot of Tools(MLFlow Models)
ML Flow Components

In this tutorial we will try to solve the second challenge i.e. dealing with lot of tools. It’s quite probable that everyone had faced the issue of installing all the packages that we had used to develop the Python project, model or let’s say a simple program on different machine and run the project on a new environment. ML FLow helps in dealing with this by downloading all the needed packages even downloading python environment all by itself.

To upload a Ml Flow project on Github and making it to run directly by ML Flow.

( If it’s difficult to catch up with the project then please try to go through the first tutorial)

Follow these steps

  1. As we have saved a project with the name MLFLow.py (recommended to have this file placed in separate folder with no other files in the folder)
  2. Just for those who have not read the first tutorial : -

3. Create a file named MLproject with no extension

4. Please observe above that we have mentioned conda environment file as conda.yaml and the parameter that we will be passing by default is a=5 and b=6, this is not possible if we run the file directly. So whenever we run our project directly from git we will have values of a as 5 and b as 6 if there are no values of a and b passed externally.

5. Now let us create conda.yaml file

6. Here we have only mentioned pip install as mlflow and the remaining dependencies are not needed for our program. If the program requires any other installation then it must be mentioned here.

7. Now everything is done just upload the project on git as a normal project.

8. My uploaded project is

https://github.com/jain-roh/MlFLowExample

Read all the files if needed.

9. Now the project can be executed by running the following command

mlflow run https://github.com/jain-roh/MlFLowExample.git

10. To pass parameters use the below command

mlflow run https://github.com/jain-roh/MlFLowExample.git -P a=8 -P b=6

--

--

Rohit Jain

I am a graduate student having 2 years of work experience as a software engineer. https://www.linkedin.com/in/jain-roh