exam questions

Exam DP-100 All Questions

View all questions & answers for the DP-100 exam

Exam DP-100 topic 3 question 2 discussion

Actual exam question from Microsoft's DP-100
Question #: 2
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
DennisWitjes
Highly Voted 3 years, 2 months ago
To allow optimize hyperdrive you require to use Azure ML run context to log and use it in the hyperdrive config. logging.info() logs it but does not allow for optimizing hyperdrive See: https://docs.microsoft.com/en-us/learn/modules/tune-hyperparameters-with-azure-machine-learning/6a-knowledge-check
upvoted 20 times
JohnDup
2 years, 10 months ago
The question is "You need to add logging to the script to allow Hyperdrive to optimize hyperparameters for the AUC metric." so it should be correct, since it only ask for log. Answer: A. Yes
upvoted 1 times
...
spaceykacey
3 years ago
agreed. correct answer is B.
upvoted 2 times
...
...
synapse
Highly Voted 2 years, 7 months ago
Selected Answer: B
Copying a good explanation: The question is not about just logging AUC but logging to allow Hyperdrive to optimize hyperparameters for the AUC metric. So you must log using run instance. That way the Hyperdrive has access to that metric to compare with other runs. SO the correct answer is "No"
upvoted 6 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
...
PradhanManva
1 year, 1 month ago
Selected Answer: B
B is the answer
upvoted 1 times
...
abhishekm94
1 year, 4 months ago
"The training script for your model must log the primary metric during model training using the same corresponding metric name so that the SweepJob can access it for hyperparameter tuning." - link :: https://learn.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters?view=azureml-api-2 clearly says mlflow logging is required. Any other logging will not work.
upvoted 1 times
...
Tommo565
1 year, 7 months ago
Selected Answer: B
B is correct
upvoted 1 times
...
phdykd
1 year, 8 months ago
B. Logging the AUC metric alone is not enough to allow Hyperdrive to optimize hyperparameters for that metric. The HyperDriveConfig object needs to be used to initiate the Hyperdrive run, and the script needs to pass the HyperDriveConfig object as an argument to the Azure Machine Learning experiment run function. This will enable Hyperdrive to monitor the logged AUC metric and adjust the hyperparameters during the run to optimize the AUC metric.
upvoted 6 times
...
klowqw
2 years, 2 months ago
run.log
upvoted 6 times
...
prasad06
3 years, 1 month ago
The answer should be B
upvoted 5 times
...
dev2dev
3 years, 7 months ago
technically this might work if filemode was w+ instead of w but logger module is simple
upvoted 1 times
chaudha4
3 years, 6 months ago
It still won't work. The logging should be done on run instance so that the hyperdrive experiment can actually get that value. Writing it to a file or printing it to stdout will not help.
upvoted 7 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