Logging MLflow Dictionary Artifacts in Azure Machine Learning
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?
Community Votes
100% of anonymous learners picked answer C. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
Tests knowledge of MLflow tracking functions; the trap is confusing metric logging with parameter or artifact logging, though the question's use of 'artifacts' is technically imprecise terminology for metrics.
This question tests the correct MLflow Python API syntax for logging multiple key-value pairs as metrics. The community consensus confirms that mlflow.log_metrics() is the standard method for handling dictionary inputs in ML experiments.
Option B (log_metric) is incorrect because it expects a single value, not a dictionary. Option A (log_input) is for input data tracking, and D (log_text) is for raw text strings.
Community Discussion (4 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Themlflow.log_metrics() function accepts a dictionary of key-value pairs where keys are metric names and values are numeric scores. This allows efficient batch logging of multiple evaluation results (e.g., accuracy, loss) in a single call, which matches the requirement to log a dictionary.Why the Other Options Are Wrong
mlflow.log_metric takes a single string key and float value, making it unsuitable for dictionaries. mlflow.log_input is used to track dataset versions, not model performance metrics. mlflow.log_text logs arbitrary text content, not structured numerical metrics.Community Comment Notes
Comment [1] provides official documentation examples showingmlflow.log_metrics(metrics) with a dictionary. Comment [3] correctly notes that if these were hyperparameters, log_params would be appropriate, but since they are typically experiment outputs, log_metrics is the best fit among the choices. Official Reference
Exam Strategy
Distinguish between MLflow functions by their data type: log_metric/log_metrics for numbers, log_param/log_params for strings/configs, and log_artifact for files. Always check if the input is a single value or a collection to choose between singular and plural method names.