
Answer-first summary for fast verification
Answer: mlflow.log_metric()
The question specifically asks for logging string metrics. While mlflow.log_text() (option D) can log text as artifacts in files, it's not designed for metrics tracking. mlflow.log_metric() (option C) is the correct choice because it's specifically designed for logging numerical metrics, and in Azure ML with MLflow, string values can be logged as metrics when using the Azure ML SDK v2 integration. The community discussion shows confusion with some votes for A and D, but the Microsoft documentation referenced in the comments confirms that mlflow.log_metric() is the appropriate method for logging metrics, including string metrics in the Azure ML context. Option A (log_artifact) is for files, option B (log.dict) doesn't exist, and option D (log_text) creates text files rather than logging metrics.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You create an Azure Machine Learning workspace and need to implement an experiment from a Jupyter notebook using the Python SDK v2. The experiment must log string metrics.
Which method should you use to log the string metrics?
A
mlflow.log_artifact()
B
mlflow.log.dict()
C
mlflow.log_metric()
D
mlflow.log_text()