exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 3 question 3 discussion

Actual exam question from Microsoft's DP-100
Question #: 3
Topic #: 3
[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 are using Azure Machine Learning to run an experiment that trains a classification model.
You want to use Hyperdrive to find parameters that optimize the AUC metric for the model. You configure a HyperDriveConfig for the experiment by running the following code:

You plan to use this configuration to run a script that trains a random forest model and then tests it with validation data. The label values for the validation data are stored in a variable named y_test variable, and the predicted probabilities from the model are stored in a variable named y_predicted.
You need to add logging to the script to allow Hyperdrive to optimize hyperparameters for the AUC metric.
Solution: Run the following code:

Does the solution meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
scott_klein_12345
Highly Voted 3 years, 5 months ago
The answer is No. The exact question appears in the learning material provided by Microsoft. Check out this link - https://docs.microsoft.com/en-us/learn/modules/tune-hyperparameters-with-azure-machine-learning/6a-knowledge-check
upvoted 38 times
...
chaudha4
Highly Voted 3 years, 6 months ago
I think the answer is wrong. The logging is printing with "AUC: " while the primary_metric_name is "AUC". How is hyperdrive experiment suppose to know that they are the same !! Moreover logging should be done on "run" instance. So many mistakes in this code !!
upvoted 9 times
aakash_0086
3 years, 4 months ago
Have you ever used python for development , its the logging mechnism where u print any string along with generated log "AUC:" or "XYCCC" anything will be there with str(auc). the solution is correct here
upvoted 1 times
treadst0ne
3 years, 4 months ago
Yes, but the question is asking to allow Hyperdrive to optimize hyperparameters. You need to use: run.log('AUC', np.float(acc)) https://docs.microsoft.com/en-us/learn/modules/tune-hyperparameters-with-azure-machine-learning/5-hyperdrive-experiment Correct answer is NO.
upvoted 4 times
...
...
...
evangelist
Most Recent 5 months ago
Selected Answer: B
# Get the current run context run = Run.get_context() # Log the AUC score run.log("AUC", auc)
upvoted 1 times
...
phdykd
1 year, 8 months ago
B. No. The solution does not meet the goal as it only saves the AUC score to a text file in the "outputs" directory. It does not log the AUC metric in a way that can be monitored by Azure Machine Learning and Hyperdrive. In order to allow Hyperdrive to optimize hyperparameters for the AUC metric, the AUC score needs to be logged using the run.log method, as follows: import json, os from sklearn.metrics import roc_auc_score import logging auc=roc_auc_score(y_test, y_predicted) run.log("AUC", auc)
upvoted 2 times
...
Tj87
2 years, 6 months ago
It seems this question has been repeated for several times. Looking at section "Log metrics for hyperparameter tuning" of Microsoft doc(https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters), we need to use the following codes: from azureml.core.run import Run run_logger = Run.get_context() run_logger.log("accuracy", float(val_accuracy)) So log.info doesn't seem to be the correct option. The hyperDrive needs to know the metric value of each run to be able to compare the values
upvoted 2 times
...
zehraoneexam
2 years, 7 months ago
I think the answer is yes. logging info can print the results. We can have more than one solution...
upvoted 1 times
...
synapse
2 years, 7 months ago
Selected Answer: B
Answer is B. No. Get a reference to the Azure ML run context and use a run.log() statement to write the AUC value to the run log https://docs.microsoft.com/en-us/learn/modules/tune-hyperparameters-with-azure-machine-learning/6a-knowledge-check
upvoted 1 times
...
Krupek
2 years, 9 months ago
Selected Answer: B
answer should be no
upvoted 2 times
...
BlindedByScience
3 years, 2 months ago
The answer should be 'YES'. The documentation says for print(val) the destination is driver logs.
upvoted 1 times
...
trickerk
3 years, 3 months ago
"You need to add logging", print() function doesn't add any log. So answer is NO.
upvoted 1 times
...
dtus
3 years, 5 months ago
the Answer is NO
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