nerdexam
Microsoft

DP-100 · Question #344

You manage an Azure Machine Learning workspace. You experiment with an MLflow model that trains interactively by using a notebook in the workspace. You need to log dictionary type artifacts of the…

The correct answer is A. mlflow.log_artifact(my_dict). To log a dictionary type artifact in Azure Machine Learning using MLflow, you should first serialize the dictionary to a file and then use the mlflow.log_artifact() function to log that file.

Explore data and run experiments

Question

You manage an Azure Machine Learning workspace. You experiment with an MLflow model that trains interactively by using a notebook in the workspace. You need to log dictionary type artifacts of the experiments in Azure Machine Learning by using MLflow. Which syntax should you use?

Options

  • Amlflow.log_artifact(my_dict)
  • Bmlflow.log_metric("my_metric", my_dict)
  • Cmlflow.log_metrics(my_dict)
  • Dmlflow.log_artifacts(my_dict)

How the community answered

(48 responses)
  • A
    92% (44)
  • B
    2% (1)
  • C
    2% (1)
  • D
    4% (2)

Why each option

To log a dictionary type artifact in Azure Machine Learning using MLflow, you should first serialize the dictionary to a file and then use the `mlflow.log_artifact()` function to log that file.

Amlflow.log_artifact(my_dict)Correct

The `mlflow.log_artifact()` method logs a local file or directory as an artifact. To log a dictionary, it must first be saved to a file (e.g., JSON, YAML), and then the path to that file is passed to `mlflow.log_artifact()` for tracking.

Bmlflow.log_metric("my_metric", my_dict)

`mlflow.log_metric()` is used to log a single numeric metric, not a dictionary or other complex data types as artifacts.

Cmlflow.log_metrics(my_dict)

`mlflow.log_metrics()` is used to log a dictionary of key-value pair metrics where values are numeric, not to log a dictionary itself as an artifact.

Dmlflow.log_artifacts(my_dict)

`mlflow.log_artifacts()` is used to log multiple artifacts from a specified directory, not to log a dictionary object directly.

Concept tested: MLflow logging artifacts

Source: https://mlflow.org/docs/latest/python_api/mlflow.html#mlflow.log_artifact

Topics

#MLflow#Experiment Tracking#Logging Artifacts#Azure Machine Learning

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice