New Year Sale 2026! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Microsoft DP-100 Exam - Topic 6 Question 6 Discussion

Actual exam question for Microsoft's DP-100 exam
Question #: 6
Topic #: 6
[All DP-100 Questions]

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?

Show Suggested Answer Hide Answer
Suggested Answer: B

Instead use the run_log function to log the contents in label_vals:

for label_val in label_vals:

run.log('Label Values', label_val)


https://www.element61.be/en/resource/azure-machine-learning-services-complete-toolbox-ai

Contribute your Thoughts:

0/2000 characters
Reita
4 months ago
Yup, that's how you do it!
upvoted 0 times
...
Emmanuel
5 months ago
Wait, can you really log arrays like that?
upvoted 0 times
...
Denae
5 months ago
I thought you needed to log it differently?
upvoted 0 times
...
Hubert
5 months ago
Definitely meets the goal!
upvoted 0 times
...
Kerry
5 months ago
That code looks solid!
upvoted 0 times
...
Leonora
5 months ago
I’m a bit confused; I thought we might need to convert label_vals to a different format before logging. Is it okay to log it as is?
upvoted 0 times
...
Valentin
5 months ago
I feel like logging the unique values directly as a table makes sense, but I wonder if there's a specific format we need to follow for the metrics.
upvoted 0 times
...
Ellen
5 months ago
I remember a similar question where we had to log metrics, and I think we used run.log instead. Could it be different here?
upvoted 0 times
...
Lorean
5 months ago
I think using run.log_table is correct since we need to log the unique labels, but I'm not entirely sure if that's the right method for this context.
upvoted 0 times
...
Catalina
5 months ago
Okay, let's see here. Scoping improves instance security by limiting accessibility to other apps - that makes sense. The other options don't seem as directly related to security benefits, so I'll go with that one.
upvoted 0 times
...
Regenia
6 months ago
Hmm, I'm a bit unsure about the specifics here. I know the method has to be static, but I can't remember if it requires a return value or not. I'll need to review the documentation carefully.
upvoted 0 times
...

Save Cancel