nerdexam
Microsoft

DP-100 · Question #462

Drag and Drop Question You manage an Azure Machine Learning workspace named workspace1 and a Data Science Virtual Machine (DSVM) named DSMV1. You must run an experiment on DSMV1 by using a Jupyter…

The correct answer is Instantiate an object of the MLClient class.; Retrieve the tracking URI of workspace1.; Set the MLflow tracking URI. To enable MLflow tracking for metrics and artifacts in an Azure Machine Learning workspace using Python SDK v2, you must first connect to the workspace, then retrieve its MLflow tracking URI, and finally configure MLflow to use that URI.

Explore data and run experiments

Question

Drag and Drop Question You manage an Azure Machine Learning workspace named workspace1 and a Data Science Virtual Machine (DSVM) named DSMV1. You must run an experiment on DSMV1 by using a Jupyter notebook and Python SDK v2 code. You must store metrics and artifacts in workspace1. You start by creating Python SDK v2 code to import all required packages. You need to implement the Python SDK v2 code to store metrics and artifacts in workspace1. Which three actions should you perform in sequence? To answer, move the appropriate actions from the list of actions to the answer area and arrange them in the correct order. Answer:

Exhibit

DP-100 question #462 exhibit

Answer Area

Drag items

Instantiate an object of the Output class.Set the MLflow tracking URI.Instantiate an object of the MLClient class.Retrieve the tracking URI of workspace1.Set the URI parameter of the mlflow.projects.run method.

Correct arrangement

  • Instantiate an object of the MLClient class.
  • Retrieve the tracking URI of workspace1.
  • Set the MLflow tracking URI.

Explanation

To enable MLflow tracking for metrics and artifacts in an Azure Machine Learning workspace using Python SDK v2, you must first connect to the workspace, then retrieve its MLflow tracking URI, and finally configure MLflow to use that URI.

Approach. The correct interaction is to drag the following three actions, in this exact sequence, to the 'Answer Area':

  1. Instantiate an object of the MLClient class.
  2. Retrieve the tracking URI of workspace1.
  3. Set the MLflow tracking URI.

This sequence is correct because:

  • To interact with an Azure Machine Learning workspace programmatically using Python SDK v2, you first need to establish a connection by instantiating the MLClient class. This MLClient object serves as the primary interface for managing Azure ML resources.
  • Once connected via the MLClient, you can then retrieve specific properties of the workspace, including its unique MLflow tracking URI. This URI tells MLflow where to send experiment logs.
  • Finally, mlflow.set_tracking_uri() is the standard MLflow function used to configure the MLflow client to direct all subsequent experiment tracking (metrics, parameters, artifacts) to the specified URI, which in this case is the Azure Machine Learning workspace's tracking endpoint.

Common mistakes.

  • common_mistake. Common mistakes include selecting irrelevant actions or arranging the correct actions in an incorrect order.
  • 'Instantiate an object of the Output class': The Output class in Azure ML SDK v2 is used to define outputs for jobs and components within pipelines, not for setting up MLflow experiment tracking. It's unrelated to the task of configuring MLflow to log to a workspace.
  • 'Set the URI parameter of the mlflow.projects.run method': The uri parameter in mlflow.projects.run typically refers to the URI of the MLflow project source code (e.g., a Git repository or local path), not the MLflow tracking server URI. The tracking URI is set globally for the experiment using mlflow.set_tracking_uri(), not as a parameter to mlflow.projects.run for tracking purposes.
  • Incorrect order: Attempting to retrieve the tracking URI before instantiating the MLClient object would fail because the client object is required to query workspace details. Similarly, trying to set the MLflow tracking URI before retrieving it from the workspace would result in an invalid or non-existent URI being used.

Concept tested. This question tests the understanding of MLflow integration with Azure Machine Learning for experiment tracking, specifically how to configure MLflow to log metrics and artifacts to an Azure ML workspace using the Azure ML Python SDK v2.

Reference. null

Topics

#Azure Machine Learning#Python SDK v2#Experiment Tracking#MLflow

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice