AWS Exams GCP Exams Azure Exams GitHub Exams Jira Exams ISC2 Exams

Video: Scenario: Pym Tech, a U.S.-based technology azure video

Question 1 Be Honest
« Back   Next azure Cloud dp-100-data-scientist-assoc Question »
Answer

Full Certification Question

Scenario: Pym Tech, a U.S.-based technology manufacturer, is thriving under the leadership of Hank Pym, with its headquarters on Treasure Island, San Francisco, California. The company’s expansion plans are introducing IT challenges, prompting Hank to contract you as an advisor for his IT team. Currently, the team is focused on running an experiment using Azure Machine Learning to train a classification model. Hank wants to utilize Hyperdrive to optimize hyperparameters for maximizing the AUC metric. One of the developers has configured the HyperDriveConfig as follows: python hyperdrive = HyperDriveConfig ( estimator = pym_estimator , hyperparameter_sampling = hanks_params , policy = policy , primary_metric_name = "AUC" , primary_metric_goal = PrimaryMetricGoal . MAXIMIZE , max_total_runs = 6 , max_concurrent_runs = 4 ) The team will use this setup to run a script that trains a random forest model and then validates it using test data. The label values for the validation dataset are stored in the variable y_test , and the predicted probabilities are stored in y_predicted . Requirement: To ensure Hyperdrive can optimize hyperparameters for the AUC metric, you need to add logging to the script. Existing Code: python import json , os from sklearn . metrics import roc_auc_score import logging # Code to train model omitted auc = roc_auc_score ( y_test , y_predicted ) os . makedirs ( "outputs" , exist_ok = True ) with open ( "outputs/AUC.txt" , "w" ) as file_cur : file_cur . write ( str ( auc )) Question: What logging modifications should be made to the script to allow Hyperdrive to optimize hyperparameters for the AUC metric?