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.
Proposed Solution: Run the following code:
from sklearn.metrics import roc_auc_score
import mlflow
auc = roc_auc_score(y_test, y_predicted)
mlflow.log('AUC', auc)
Does the solution meet the goal?