nerdexam
Microsoft

DP-100 · Question #234

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might h

The correct answer is B. No. The solution does not meet the goal. In this series (same scenario as Q6 and Q8), a different proposed solution is evaluated. A common incorrect approach is using run.log_list() to log the actual label values rather than run.log() to log the count of unique labels, or logging met

Explore data and run experiments

Question

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution. After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen. 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: from azureml.core import Run import pandas as pd run = Run.get_context() data = pd.read_csv('data.csv') label_vals = data['label'].unique() # Add code to record metrics here run.complete() 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: run.log_table('Label Values', label_vals) Does the solution meet the goal?

Options

  • AYes
  • BNo

How the community answered

(54 responses)
  • A
    28% (15)
  • B
    72% (39)

Explanation

The solution does not meet the goal. In this series (same scenario as Q6 and Q8), a different proposed solution is evaluated. A common incorrect approach is using run.log_list() to log the actual label values rather than run.log() to log the count of unique labels, or logging metadata that doesn't align with what the evaluator expects (e.g., logging the list of unique values instead of the integer count). Another common mistake is placing run.complete() before the logging call, so the run finishes before the metric is recorded. Only the solution in Q8 correctly meets the stated goal.

Topics

#Azure Machine Learning SDK#Experiment Tracking#Metrics Logging#Python

Community Discussion

No community discussion yet for this question.

Full DP-100 Practice