DP-100 · Question #151
DP-100 Question #151: Real Exam Question with Answer & Explanation
The correct answer is A: Set the primary_metric_goal of the estimator used to run the bird_classifier_train.py script to. {"question_number": 4, "correct_answer": "A, D, F", "explanation": "Three actions are required to configure Hyperdrive to optimize for accuracy. First (F): the training script bird_classifier_train.py must contain code that calculates validation accuracy and logs it using run.log
Question
You create a multi-class image classification deep learning model that uses the PyTorch deep learning framework. You must configure Azure Machine Learning Hyperdrive to optimize the hyperparameters for the classification model. You need to define a primary metric to determine the hyperparameter values that result in the model with the best accuracy score. Which three actions must you perform? Each correct answer presents part of the solution. NOTE: Each correct selection is worth one point.
Options
- ASet the primary_metric_goal of the estimator used to run the bird_classifier_train.py script to
- BAdd code to the bird_classifier_train.py script to calculate the validation loss of the model and log
- CSet the primary_metric_goal of the estimator used to run the bird_classifier_train.py script to
- DSet the primary_metric_name of the estimator used to run the bird_classifier_train.py script to
- ESet the primary_metric_name of the estimator used to run the bird_classifier_train.py script to
- FAdd code to the bird_classifier_train.py script to calculate the validation accuracy of the model
Explanation
{"question_number": 4, "correct_answer": "A, D, F", "explanation": "Three actions are required to configure Hyperdrive to optimize for accuracy. First (F): the training script bird_classifier_train.py must contain code that calculates validation accuracy and logs it using run.log('validation_accuracy', value). Hyperdrive reads metrics from the run logs, so the metric must be explicitly logged inside the training script. Second (D): the primary_metric_name in the HyperDriveConfig must be set to the exact string name logged in the script (e.g., 'validation_accuracy'). This tells Hyperdrive which logged value to track across child runs. Third (A): primary_metric_goal must be set to PrimaryMetricGoal.MAXIMIZE, because a higher accuracy score is better. Options B and C are distractors likely involving validation loss (which would be minimized, not maximized) and options E references the wrong metric name, none of which align with optimizing for accuracy.", "generated_by": "claude-sonnet", "llm_judge_score": 4}
Topics
Community Discussion
No community discussion yet for this question.