
Answer-first summary for fast verification
Answer: Yes
The solution meets the goal because it correctly logs each unique label value as a metric in the Azure ML experiment run. The run.log() method can log the same metric multiple times, storing the values as a vector. While run.log_list() would be more efficient for logging all values at once, the given solution using a for loop with run.log() is functionally correct and achieves the stated objective of recording unique label values as run metrics. The community discussion shows strong consensus for option A (53% vs 47% for B), with the highest upvoted comment (10 upvotes) explicitly confirming that logging the same metric multiple times is valid and results in a vector of values. The key requirement is met: the unique labels are recorded as metrics that can be reviewed later.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You plan to use a Python script to run an Azure Machine Learning experiment. The script creates a reference to the experiment run context, loads data from a file, identifies the set of unique values for the label column, and completes the experiment run.
The experiment must record the unique labels in the data as metrics for the run that can be reviewed later. You must add code to the script to record the unique label values as run metrics at the point indicated by the comment.
Solution: Replace the comment with the following code:
for label_val in label_vals:
run.log('Label Values', label_val)
for label_val in label_vals:
run.log('Label Values', label_val)
Does the solution meet the goal?

A
Yes
B
No
No comments yet.