Get startedGet started for free

MLflow projects module

MLflow Projects can also be run programmatically with Python using the mlflow projects module.

In this exercise you will run an MLflow Project using the projects module to train a model for your "Insurance" Project. You will define the entry point from your MLproject file to execute the training code. You will also define the experiment name of "Insurance" so that the model is properly logged to the correct experiment in MLflow Tracking.

You may read the contents of the MLproject file by executing print(MLproject) in the IPython shell.

This exercise is part of the course

Introduction to MLflow

View Course

Exercise instructions

  • Call the run() function from the mlflow projects module.
  • Set the URI for the MLproject file to the current working directory.
  • Set the entry point to "main" according to the MLproject file.
  • Set the experiment name to "Insurance".

Hands-on interactive exercise

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

import mlflow

# Set the run function from the MLflow Projects module
____.____.____(
  	# Set the URI as the current working directory
    ____='____',
    # Set the entry point to main
    ____='____',
    # Set the experiment name as Insurance
    ____='____',
    env_manager="local",
    synchronous=True,
)
Edit and Run Code