
Answer-first summary for fast verification
Answer: Use the aiplatform.log_classification_metrics function to log the F1 score and the confusion matrix.
The correct answer is B. According to the Vertex AI Python SDK documentation, the `aiplatform.log_classification_metrics` function is designed specifically for logging metrics relevant to classification tasks, including both the F1 score and the confusion matrix. Therefore, it's the most appropriate function to use for logging these metrics for comparing the scikit-learn and TensorFlow classifier models.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You have developed a scikit-learn classifier model and now want to migrate it to TensorFlow. The plan is to use the same training dataset used for the scikit-learn model to train the new TensorFlow classifier model. After training, you aim to compare the performances of both models using a common test set. You decide to use the Vertex AI Python SDK to manually log evaluation metrics, specifically focusing on the F1 scores and confusion matrices of each model. What is the correct way to log these metrics using the Vertex AI Python SDK?
A
Use the aiplatform.log_classification_metrics function to log the F1 score, and use the aiplatform.log_metrics function to log the confusion matrix.
B
Use the aiplatform.log_classification_metrics function to log the F1 score and the confusion matrix.
C
Use the aiplatform.log_metrics function to log the F1 score and the confusion matrix.
D
Use the aiplatform.log_metrics function to log the F1 score and use the aiplatform.log_classification_metrics function to log the confusion matrix.