DP-100 · Question #489
You create an Azure Machine Learning workspace. You must use the Python SDK v2 to implement an experiment from a Jupyter notebook in the workspace. The experiment must log string metrics. You need…
The correct answer is D. mlflow.log_text(). 'mlflow.log_text(text, artifact_file)' logs a string value as a text artifact, making it the correct choice for recording string data. 'mlflow.log_metric()' only accepts numeric (float) values and will raise an error if passed a string. 'mlflow.log_artifact()' uploads a local…
Question
Options
- Amlflow.log_artifact()
- Bmlflow.log.dict()
- Cmlflow.log_metric()
- Dmlflow.log_text()
How the community answered
(16 responses)- A6% (1)
- C6% (1)
- D88% (14)
Explanation
'mlflow.log_text(text, artifact_file)' logs a string value as a text artifact, making it the correct choice for recording string data. 'mlflow.log_metric()' only accepts numeric (float) values and will raise an error if passed a string. 'mlflow.log_artifact()' uploads a local file path, not an in-memory string. 'mlflow.log.dict()' uses incorrect dot notation - the valid method is 'mlflow.log_dict()', which logs a dictionary as a JSON/YAML artifact, not a plain string.
Topics
Community Discussion
No community discussion yet for this question.