Get startedGet started for free

Creating a multi-step workflow: Model Engineering

The MLflow Projects module can be used as a way to run a multi-step workflow. All steps can be coordinated though a single Python program that passes results from previous steps to the following.

In this exercise, you will begin creating a multi-step workflow to manage the Model Engineering and Model Evaluation steps of the ML lifecycle. You will use the run() method from the MLflow Projects module for the model_engineering entry point and pass parameters used as hyperparameters for model training. You will also capture the output of the run_id and set it to a variable so that it can be passed to the model_evaluation step of the workflow as a parameter.

The MLproject created in the previous step is available in the IPython Shell using print(MLproject). The MLflow module is imported.

This exercise is part of the course

Introduction to MLflow

View Course

Exercise instructions

  • Assign the run() method from MLflow Projects module to a variable called model_engineering.
  • Set the entry point argument to "model_engineering".
  • Set parameters for training the model. "n_jobs" to 2 and "fit_intercept" to False.
  • Set the run_id attribute of model_engineering to a variable called model_engineering_run_id.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Set run method to model_engineering
____ = ____.____.____(
    uri='./',
    # Set entry point to model_engineering
    ____='____',
    experiment_name='Insurance',
    # Set the parameters for n_jobs and fit_intercept
    parameters={
        '____': ____, 
        '____': ____
    },
    env_manager='local'
)

# Set Run ID of model training to be passed to Model Evaluation step
____ = ____.____
print(model_engineering_run_id)
Edit and Run Code