exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 3 question 42 discussion

Actual exam question from Microsoft's DP-100
Question #: 42
Topic #: 3
[All DP-100 Questions]

DRAG DROP -
You plan to explore demographic data for home ownership in various cities. The data is in a CSV file with the following format: age,city,income,home_owner
21,Chicago,50000,0
35,Seattle,120000,1
23,Seattle,65000,0
45,Seattle,130000,1
18,Chicago,48000,0
You need to run an experiment in your Azure Machine Learning workspace to explore the data and log the results. The experiment must log the following information:
✑ the number of observations in the dataset
✑ a box plot of income by home_owner
✑ a dictionary containing the city names and the average income for each city
You need to use the appropriate logging methods of the experiment's run object to log the required information.
How should you complete the code? To answer, drag the appropriate code segments to the correct locations. Each code segment may be used once, more than once, or not at all. You may need to drag the split bar between panes or scroll to view content.
NOTE: Each correct selection is worth one point.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:
Box 1: log -
The number of observations in the dataset.
run.log(name, value, description='')
Scalar values: Log a numerical or string value to the run with the given name. Logging a metric to a run causes that metric to be stored in the run record in the experiment. You can log the same metric multiple times within a run, the result being considered a vector of that metric.
Example: run.log("accuracy", 0.95)

Box 2: log_image -
A box plot of income by home_owner.
log_image Log an image to the run record. Use log_image to log a .PNG image file or a matplotlib plot to the run. These images will be visible and comparable in the run record.
Example: run.log_image("ROC", plot=plt)

Box 3: log_table -
A dictionary containing the city names and the average income for each city. log_table: Log a dictionary object to the run with the given name.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
SnowCheetah
Highly Voted 2 years, 3 months ago
The Answer is correct First is straightforward to store a single value is using log() Second since code try to save pyplot graph = image the second answer is log_image() On Last question Based on to_dict function https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.to_dict.html to save log with that format The last answer should use log_table() https://stackoverflow.com/questions/65156959/what-are-the-various-run-metrics-that-can-be-added-in-run-in-azureml
upvoted 26 times
...
Dilesha
Highly Voted 8 months, 1 week ago
On Exam 17 Feb 2023
upvoted 9 times
...
JTWang
Most Recent 1 year ago
Correct. https://learn.microsoft.com/en-us/python/api/azureml-core/azureml.core.run(class)?view=azure-ml-py
upvoted 4 times
...
racnaoamo
1 year, 5 months ago
similar question on 18-5-22
upvoted 3 times
...
[Removed]
1 year, 8 months ago
On 20Feb2022
upvoted 2 times
...
hargur
2 years ago
on 19Oct2021
upvoted 3 times
...
kisskeo
2 years ago
On Exam 01 Oct 2021
upvoted 2 times
...
mthombenindhl84
2 years, 1 month ago
on exam 11/9/2021
upvoted 2 times
...
snsnsnsn
2 years, 1 month ago
on 2/9/21
upvoted 3 times
...
dushmantha
2 years, 1 month ago
On exam 2021/08/31
upvoted 3 times
...
datamijn
2 years, 2 months ago
on 2/8/2021
upvoted 3 times
...
azurecert2021
2 years, 4 months ago
yes given answer is correct https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.run(class)?view=azure-ml-py
upvoted 4 times
...
prashantjoge
2 years, 5 months ago
i think the last one is list
upvoted 2 times
trickerk
2 years, 2 months ago
For log a dictionary you need to use the log_table() function
upvoted 1 times
...
prashantjoge
2 years, 5 months ago
wrong, the answer is correct.https://stackoverflow.com/questions/65156959/what-are-the-various-run-metrics-that-can-be-added-in-run-in-azureml
upvoted 3 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago