Ultimate access to all questions.
You are using Azure Machine Learning to train a classification model and have configured HyperDrive to optimize the AUC metric. You plan to run a script that trains a random forest model, where the validation data labels are in a variable named y_test
and the predicted probabilities are in a variable named y_predicted
.
You need to add logging to the script to enable Hyperdrive to optimize hyperparameters for the AUC metric.
The proposed solution is to run the following code:
from sklearn.metrics import roc_auc_score
auc = roc_auc_score(y_test, y_predicted)
run.log('AUC', auc)
Does this solution meet the goal?