DP-100 practice question 11 of 35
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…
Choose your answer, then check it against the explanation.
Domain Run experiments and train models
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?
Question 11 of 35
Keep practicing
Take the free DP-100 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other DP-100 practice questions
- Question 2Note: This question is part of a series of questions that present the same scenario. Each…
- Question 5You have an Azure Machine Learning workspace. You plan to run a job to tram a model as an…
- Question 6You create a script that trains a convolutional neural network model over multiple epochs…
- Question 8You train and register an Azure Machine Learning model You plan to deploy the model to an…
- Question 14You use Azure Machine Learning to train a model based on a dataset named dataset1. You de…
- Question 18You use the designer to create a training pipeline for a classification model. The pipeli…
