Question 38
Domain 5: Monitor, retrain, and manage ML lifecycleYou have been contracted by Wayne Enterprises to help integrate Azure Machine Learning into their inference services. The IT team wants to log custom telemetry metrics for the model's behavior and analyze them using Application Insights. What should the team include in the entry script to capture custom metrics appropriately using Azure Machine Learning SDK v2?
Correct answer: B
Explanation
Azure Machine Learning SDK v2 supports MLflow-based logging in entry scripts, and custom telemetry can be recorded as metrics with "mlflow.log_metric()". Those metrics are then available for analysis in Application Insights when the service is configured to collect inference telemetry.
Why each option is right or wrong
A. Use a print statement to write the metrics in the STDOUT log.
B. Use mlflow.log_metric() to log the custom metrics.
Azure Machine Learning SDK v2 inference entry scripts are expected to use the MLflow tracking API for custom telemetry, and `mlflow.log_metric()` is the supported call for recording numeric metrics from the running model. In this context, the metric is emitted from the online endpoint’s scoring code and can then be surfaced through the service’s telemetry pipeline into Application Insights when inference logging is enabled.
C. Use the Run.log method to log the custom metrics.
D. Save the custom metrics in the./outputs folder.